|
Chapter Contents |
Previous |
Next |
| The GLM Procedure |
Other SAS procedures that can be used to analyze models with random effects include the MIXED and VARCOMP procedures. Note that, for these procedures, the random effects specification is an integral part of the model, affecting how both random and fixed effects are fit; for PROC GLM, the random effects are treated in a post hoc fashion after the complete fixed effect model is fit. This distinction affects other features in the GLM procedure, such as the results of the LSMEANS and ESTIMATE statements. These features assume that all effects are fixed, so that all tests and estimability checks for these statements are based on a fixed effects model, even when you use a RANDOM statement. Standard errors for estimates and LS-means based on the fixed effects model may be significantly smaller than those based on a true random effects model; in fact, some functions that are estimable under a true random effects model may not even be estimable under the fixed effects model. Therefore, you should use the MIXED procedure to compute tests involving these features that take the random effects into account; see Chapter 37, "The MIXED Procedure," for more information.
Note that, for balanced data, the test statistics computed when you specify the TEST option on the RANDOM statement have an exact F distribution only when the design is balanced; for unbalanced designs, the p values for the F-tests are approximate. For balanced data, the values obtained by PROC GLM and PROC MIXED agree; for unbalanced data, they usually do not.
The expected mean squares are computed as follows. Consider the model

where
represents the fixed effects
and
represent the random effects.
Random effects are assumed to be
normally and independently distributed.
For any L in the row space of
,the expected value of the sum of squares for
is

where C is of the same dimensions as L and is partitioned as the X matrix. In other words,

Furthermore, C = ML, where M is the inverse of the lower triangular Cholesky decomposition matrix of L(X'X)-L'. SSQ(A) is defined as tr(A'A).
For the model in the following MODEL statement
model Y=A B(A) C A*C; random B(A);
with B(A) declared as random, the expected mean square of each effect is displayed as
If any fixed effects appear in the expected mean square of an effect, the letter Q followed by the list of fixed effects in the expected value is displayed. The actual numeric values of the quadratic form (Q matrix) can be displayed using the Q option.
To determine appropriate means squares for testing the effects in the model, the TEST option in the RANDOM statement performs the following:
PROC GLM determines the combination of other expected mean squares in the model that has expectation
Refer to Goodnight and Speed (1978), Milliken and Johnson (1984, Chapters 22 and 23), and Hocking (1985) for further theoretical discussion.
For arguments in favor of not assuming that terms involving fixed effects sum to zero, see Section 9.7 of Searle (1971) and Sections 1 and 4 of McLean, Sanders, and Stroup (1991). Other references are Hartley and Searle (1969) and Searle, Casella, McCulloch (1992).
For example, suppose you have a two-way design with factors A and B in which the main effect for B and the interaction are random. In order to compute the Type III expected mean squares (in addition to the fixed-effect analysis), you can use the following statements:
proc glm;
class A B;
model Y = A B A*B;
random B A*B;
run;
If you use the SS4 option in the MODEL statement,
proc glm;
class A B;
model Y = A B A*B / ss4;
random B A*B;
run;
then only the Type IV expected mean squares are computed (as well as the Type IV fixed-effect tests). For the Type I expected mean squares, you can use the following statements:
proc glm;
class A B;
model Y = A B A*B / e1;
random B A*B;
run;
For each of these cases, in order to perform random effect analysis of variance tests for each effect specified in the model, you need to specify the TEST option in the RANDOM statement, as follows:
proc glm;
class A B;
model Y = A B A*B;
random B A*B / test;
run;
The GLM procedure automatically determines the appropriate error term for each test, based on the expected mean squares.
|
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.