Chapter Contents |
Previous |
Next |
The ANOVA Procedure |
The analysis-of-variance model specifies effects, which are combinations of classification variables used to explain the variability of the dependent variables in the following manner:
The general form of an effect can be illustrated using the class variables A, B, C, D, E, and F:
The crossed list should come first, followed by the nested list in parentheses. Note that no asterisks appear within the nested list or immediately before the left parenthesis.
proc anova; class A B C; model Y=A B C; run;
proc anova; class A B C; model Y=A B C A*B A*C B*C A*B*C; run;
proc anova; class A B C; model Y=A|B|C; run;
When the bar (|) is used, the expression on the right side of the equal sign is expanded from left to right using the equivalents of rules 2 -4 given in Searle (1971, p. 390). The variables on the right- and left-hand sides of the bar become effects, and the cross of them becomes an effect. Multiple bars are permitted. For instance, A | B | C is evaluated as follows:
A | B | C | { A | B } | C | |
{ A B A*B } | C | ||
A B A*B A*C B*C A*B*C |
You can also specify the maximum number of variables involved in any effect that results from bar evaluation by specifying that maximum number, preceded by an @ sign, at the end of the bar effect. For example, the specification A | B | C@2 results in only those effects that contain two or fewer variables; in this case, A B A*B C A*C and B*C.
The following table gives more examples of using the bar and at operators.
A | C(B) | is equivalent to | A C(B) A*C(B) |
A(B) | C(B) | is equivalent to | A(B) C(B) A*C(B) |
A(B) | B(D E) | is equivalent to | A(B) B(D E) |
A | B(A) | C | is equivalent to | A B(A) C A*C B*C(A) |
A | B(A) | C@2 | is equivalent to | A B(A) C A*C |
A | B | C | D@2 | is equivalent to | A B A*B C A*C B*C D A*D B*D C*D |
proc anova; class A B C; model y=A B C(A B); run;
The identity of a level is viewed within the context of the level of the containing effects. For example, if City is nested within State, then the identity of City is viewed within the context of State.
The distinguishing feature of a nested specification is that nested effects never appear as main effects. Another way of viewing nested effects is that they are effects that pool the main effect with the interaction of the nesting variable. See the "Automatic Pooling" section, which follows.
proc anova; class A B C; model Y=A B(A) C(A) B*C(A); run;
model Y=A B(A);
and
model Y=A A*B;
The effect B becomes a nested effect by virtue of the fact that it does not occur as a main effect. If B is not written as a main effect in addition to participating in A*B, then the sum of squares that is associated with B is pooled into A*B.
This feature allows the automatic pooling of sums of squares. If an effect is omitted from the model, it is automatically pooled with all the higher-level effects containing the class variables in the omitted effect (or within-error). This feature is most useful in split-plot designs.
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.