# Data matrix (multivariate statistics)

In multivariate statistics, a data matrix is a matrix of data of dimension n-by-p, where n is the number of samples observed, and p is the number of variables (features) measured in all samples.[1][2]

In this representation different rows typically represent different repetitions of an experiment, while columns represent different types of data (say, the results from particular probes). For example, suppose an experiment is run where 10 people are pulled off the street and asked four questions. The data matrix M would be a 10×4 matrix (meaning 10 rows and 4 columns). The datum in row i and column j of this matrix would be the answer of the i th person to the j th question.

This arrangement reflects the convention most commonly used to present the linear regression problem, as requiring the estimation of B in the equation

${\displaystyle \mathbf {Y} \approx \mathbf {X} \mathbf {B} }$

where Y is an n-by-q data matrix containing the observed dependent variables, X is the design matrix, an n-by-p data matrix containing the values of the explanatory variables, and B is a p-by-q matrix of unknown regression coefficients.