example of simple linear regression—that is, regression with only a single explanatory variable—with seven observations. The seven data points are {yi, xi}, for i = 1, 2, …, 7. The simple linear regression model is where is the y-intercept and is the slope of the regression line. 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. Multiple regression This section contains an example of multiple regression with two covariates (explanatory variables): w and x. Again suppose that the data consist of seven observations, and that for each observed value to be predicted (), values wi and xi of the two covariates are also observed. The model to be considered is This model can be written in matrix terms as Here the 7×3 matrix on the right side is the design matrix. One-way ANOVA (cell means model) This section contains an example with a one-way analysis of variance (ANOVA) with three groups and seven observations. The given data set has the first three observations belonging to the first group, the following two observations belonging to the second group and the final two observations belonging to the third group. If the model to be fit is just the mean of each group, then the model is which can be written In this model represents the mean of the th group. One-way ANOVA (offset from reference group) The ANOVA model could be equivalently written as each group parameter 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 with the constraint that is zero. In this model is the mean of the reference group and is the difference from group to the reference group. is not included in the matrix because its difference from the reference group (itself) is necessarily zero. See also Moment matrix Projection matrix Jacobian matrix and determinant Scatter matrix Gram matrix Vandermonde matrix References Further reading Matrices Regression analysis Design of experiments Multivariate statistics Data