|
Chapter Contents |
Previous |
Next |
| The GLM Procedure |
There is no limit to the number of CONTRAST statements you can specify, but they must appear after the MODEL statement. In addition, if you use a CONTRAST statement and a MANOVA, REPEATED, or TEST statement, appropriate tests for contrasts are carried out as part of the MANOVA, REPEATED, or TEST analysis. If you use a CONTRAST statement and a RANDOM statement, the expected mean square of the contrast is displayed. As a result of these additional analyses, the CONTRAST statement must appear before the MANOVA, REPEATED, RANDOM, or TEST statement.
In the CONTRAST statement,
You can specify the following options in the CONTRAST statement after a slash(/):
As stated previously, the CONTRAST statement
enables you to perform custom hypothesis tests.
If the hypothesis is testable in the univariate case,
SS(
) is computed as
where b = (X'X)-X'y. This is the sum of squares displayed on the analysis-of-variance table.
For multivariate testable hypotheses, the usual multivariate tests are performed using
where B = (X'X)-X'Y and Y is the matrix of multivariate responses or dependent variables. The degrees of freedom associated with the hypothesis is equal to the row rank of L. The sum of squares computed in this situation are equivalent to the sum of squares computed using an L matrix with any row deleted that is a linear combination of previous rows.
Multiple-degree-of-freedom hypotheses can be specified by separating the rows of the L matrix with commas.
For example, for the model
proc glm;
class A B;
model Y=A B;
run;
with A at 5 levels and B at 2 levels, the parameter vector is

To test the hypothesis that the pooled A linear and A quadratic effect is zero, you can use the following L matrix:
![L = [ 0 & -2 & -1 & 0 & 1 & 2 & 0 & 0 \ 0 & 2 & -1 & -2 & -1 & 2 & 0 & 0 \ ]](images/glmeq10.gif)
The corresponding CONTRAST statement is
contrast 'A LINEAR & QUADRATIC'
a -2 -1 0 1 2,
a 2 -1 -2 -1 2;
If the first level of A is a control level and you want a test of control versus others, you can use this statement:
contrast 'CONTROL VS OTHERS' a -1 0.25 0.25 0.25 0.25;
See the following discussion of the ESTIMATE statement and the "Specification of ESTIMATE Expressions" section for rules on specification, construction, distribution, and estimability in the CONTRAST statement.
|
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.