Testing or estimation?
We have approached questions about the internal structure of the factor levels in an experiment by examining how constraints to the parameters affect the fit of the model in an analysis of variance table.
An alternative approach is to estimate the value of linear functions of the model parameters. For example, we examined whether levels A and B had the same mean response by imposing a constraint that the level parameters are equal and testing the change in the residual sum of squares (explained by the constraint). This approach would be necessary if we were comparing three or more factor levels, but if we are only comparing two, we can consider estimating the difference between the mean response of the two factor levels (or equivalently, estimating the difference between the two level parameters).
Contrasts, confidence intervals and tests
Computer software will provide a point estimate and standard error for any linear combination of parameters. (These linear combinations of parameters are called contrasts.) From these values, we can obtain 95% confidence intervals using t-values whose degrees of freedom are those of the residual sum of squares.
The estimates of such contrasts and their standard errors can also be used in t-tests for whether the contrasts are zero.
The p-value associated with the t-test about whether a contrast is zero is identical to the p-value that would be found in an analysis of variance table that used the contrast as a constraint.
Example
The diagram below shows data from a completely randomised experiment for a factor with six levels.
The pop-up menu can be used to display confidence intervals and perform t-tests for a few standard contrasts.
You can type other values into the text-edit boxes for the parameter coefficients (except for the first coefficient that is always set to make the sum of the coefficients zero). For example, set the coefficients to (0, -0.5, -0.5, 0.5, 0.5, 0) then click Inference about contrast. The confidence interval estimates the difference between the mean response for levels (D & E) and for levels (B & C), and the t-test tests whether these two means are equal.
Contrasts in block designs
Contrasts can be found in an identical way for more complex experiments such as randomised block designs. Computer software will provide estimates and standard errors from which confidence intervals may be obtained.