Design matrix

From Wikipedia, the free encyclopedia
Jump to: navigation, search

In statistics, a design matrix is a matrix of explanatory variables, often denoted by X, that is used in certain statistical models, e.g., the general linear model.[1][2] It can contain indicator variables (ones and zeros) that indicate group membership in an ANOVA.

The design matrix represents the independent variables in statistical models which describe observed data (often called dependent variables) in terms of other known variables (explanatory variables). The theory relating to such models makes substantial use of matrix manipulations involving the design matrix: 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.

Contents

[edit] Definition

In a regression model, written in matrix-vector form as

y=X\beta+ \epsilon,

the matrix X is the design matrix.

[edit] Examples

[edit] Simple Regression

Example of simple linear regression with 7 observations. Suppose there are 7 data points {yi, xi}, where i = 1, 2, …, 7. The model simple linear regression model is

 y_i = \beta_0 + \beta_1 x_i +\epsilon_i, \,

where  \beta_0 is the y-intercept and \beta_1 is the slope of the regression line. This model can be represented in matrix form as


\begin{bmatrix}y_1 \\ y_2 \\ y_3 \\ y_4 \\ y_5 \\ y_6 \\ y_7 \end{bmatrix} 
= 
\begin{bmatrix}1 & x_1  \\1 & x_2  \\1 & x_3  \\1 & x_4  \\1 & x_5  \\1 & x_6 \\ 1 & x_7  \end{bmatrix}
\begin{bmatrix} \beta_0 \\ \beta_1  \end{bmatrix}
+ 
\begin{bmatrix} \epsilon_1 \\ \epsilon_2 \\ \epsilon_3 \\ \epsilon_4 \\ \epsilon_5 \\ \epsilon_6 \\ \epsilon_7 \end{bmatrix}

where the first column of ones in the design matrix represents the y-intercept term while the second column is the x-values associated with the y-value.

[edit] Multiple Regression

Example of multiple regression with covariates w_i and x_i. Again suppose that the data are 7 observations, and for each observed value to be predicted (y_i), there are two covariates that were also observed w_i and x_i. The model to be considered is

 y_i = \beta_0 + \beta_1 w_i + \beta_2 x_i + \epsilon_i

This model can be written in matrix terms as


\begin{bmatrix}y_1 \\ y_2 \\ y_3 \\ y_4 \\ y_5 \\ y_6 \\ y_7 \end{bmatrix} = 
\begin{bmatrix} 1 & w_1 & x_1  \\1 & w_2 & x_2  \\1 & w_3 & x_3  \\1 & w_4 & x_4  \\1 & w_5 & x_5  \\1 & w_6 & x_6 \\ 1& w_7  & x_7  \end{bmatrix}
\begin{bmatrix} \beta_0 \\ \beta_1 \\ \beta_2  \end{bmatrix}
+ 
\begin{bmatrix} \epsilon_1 \\ \epsilon_2 \\ \epsilon_3 \\ \epsilon_4 \\ \epsilon_5 \\ \epsilon_6 \\ \epsilon_7 \end{bmatrix}

[edit] One-way ANOVA (Cell Means Model)

Example with a one-way analysis of variance (ANOVA) with 3 groups and 7 observations. The given data set has the first three observations belonging to the first group, the following two observations belong to the second group and the final two observations are from the third group. If the model to be fit is just the mean of each group, then the model is

 y_{ij} = \mu_i + \epsilon_{ij}

which can be written


\begin{bmatrix}y_1 \\ y_2 \\ y_3 \\ y_4 \\ y_5 \\ y_6 \\ y_7 \end{bmatrix} = 
\begin{bmatrix}1 & 0 & 0 \\1 &0  &0 \\ 1 & 0 & 0 \\  0 & 1 & 0 \\  0 & 1 & 0 \\  0 & 0 & 1 \\  0 & 0 & 1\end{bmatrix}
\begin{bmatrix}\mu_1 \\ \mu_2 \\ \mu_2  \end{bmatrix}
+ 
\begin{bmatrix} \epsilon_1 \\ \epsilon_2 \\ \epsilon_3 \\ \epsilon_4 \\ \epsilon_5 \\ \epsilon_6 \\ \epsilon_7 \end{bmatrix}

It should be emphasized that in this model \mu_i represents the mean of the ith group.

[edit] One-way ANOVA (offset from reference group)

The ANOVA model could be equivalently written as each group parameter \tau_i being an offset from some overall reference. Typically this reference point is taken to be one of the groups under consideration. This makes sense in the context of comparing multiple treatment groups to a control group and the control group is considered the "reference". In this example, group 1 was chosen to be the reference group. As such the model to be fit is

 y_{ij} = \mu + \tau_i + \epsilon_{ij}

with the constraint that \tau_1 is zero.


\begin{bmatrix}y_1 \\ y_2 \\ y_3 \\ y_4 \\ y_5 \\ y_6 \\ y_7 \end{bmatrix} = 
\begin{bmatrix}1 &0 &0 \\1 &0  &0 \\ 1 & 0 & 0 \\ 1 & 1 & 0 \\ 1 & 1 & 0 \\ 1 & 0 & 1 \\ 1  & 0 & 1\end{bmatrix}
\begin{bmatrix}\mu \\  \tau_2 \\ \tau_3 \end{bmatrix}
+ 
\begin{bmatrix} \epsilon_1 \\ \epsilon_2 \\ \epsilon_3 \\ \epsilon_4 \\ \epsilon_5 \\ \epsilon_6 \\ \epsilon_7 \end{bmatrix}

In this model \mu is the mean of the reference group and \tau_i is the difference from group i to the reference group. \tau_1 and is not included in the matrix because its difference from the reference group (itself) is necessarily zero.

[edit] See also

[edit] References

  1. ^ Everitt,B.S. (2002) Cambridge Dictionary of Statistics, CUP. ISBN 0-521-91099-x
  2. ^ Box, G.E.P., Tiao, G.C. (1973) Bayesian Inference in Statistical Analysis, Wiley. ISBN 0-471-57427-7 (Section 8.1.1)
Personal tools
Namespaces

Variants
Actions
Navigation
Interaction
Toolbox
Print/export
Languages