Each row represents an individual object, with the successive columns corresponding to the variables and their specific values for that object.
[1][2][3] It can contain indicator variables (ones and zeros) that indicate group membership in an ANOVA, or it can contain values of continuous variables.
The theory relating to such models uses the design matrix as input to some linear algebra : see for example linear regression.
A notable feature of the concept of a design matrix is that it is able to represent a number of different experimental designs and statistical models, e.g., ANOVA, ANCOVA, and linear regression.
) represents the value of the jth variable associated with the ith object.
The design matrix has dimension n-by-p, where n is the number of samples observed, and p is the number of variables (features) measured in all samples.
For example, suppose an experiment is run where 10 people are pulled off the street and asked 4 questions.
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.
The design matrix for an arithmetic mean is a column vector of ones.
This section gives an example of simple linear regression—that is, regression with only a single explanatory variable—with seven observations.
This model can be represented in matrix form as where the first column of 1s in the design matrix allows estimation of the y-intercept while the second column contains the x-values associated with the corresponding y-values.
This section contains an example of multiple regression with two covariates (explanatory variables): w and x.
), values wi and xi of the two covariates are also observed.
This section contains an example with a one-way analysis of variance (ANOVA) with three groups and seven observations.
The ANOVA model could be equivalently written as each group parameter
Typically this reference point is taken to be one of the groups under consideration.
is not included in the matrix because its difference from the reference group (itself) is necessarily zero.