Chapter Contents
Chapter Contents
The GLM Procedure

Specification of ESTIMATE Expressions

Consider the model
E(Y) & = & \beta_0 + \beta_1x_1 + \beta_2x_2 + \beta_3x_3.
The corresponding MODEL statement for PROC GLM is

   model y=x1 x2 x3;

To estimate the difference between the parameters for x1 and x2,

\beta_1 - \beta_2 & =& (0 & 1 & -1 & 0 )
 = (\beta_0 & \beta_1 & \beta_2 & \beta_3 )'

you can use the following ESTIMATE statement:

   estimate 'B1-B2'  x1 1  x2 -1;

To predict y at x1=1, x2=0, and x3 = -2, you can estimate

\beta_0+\beta_1-2\beta_3 & = &
 (1 & 1 & 0 & -2 ){\beta}
with the following ESTIMATE statement:

   estimate 'B0+B1-2B3' intercept 1 x1 1 x3 -2;

Now consider models involving class variables such as

   model y=A B A*B;

with the associated parameters:

( \mu & \alpha_1 & \alpha_2 & \alpha_3 & \beta_1 & \beta_2 &
\gamma_{11} & \gamma_{12} & \gamma_{21} &
\gamma_{22} & \gamma_{31} & \gamma_{32})

The LS-mean for the first level of A is {L \beta}, where

L = (1 & | & 1 & 0 & 0 & | & 0.5 & 0.5 & | &
0.5 & 0.5 & 0 & 0 & 0 & 0 )

You can estimate this with the following ESTIMATE statement:

   estimate 'LS-mean(A1)' intercept 1 A 1 B 0.5 0.5 A*B 0.5 0.5;

Note in this statement that only one element of L is specified following the A effect, even though A has three levels. Whenever the list of constants following an effect name is shorter than the effect's number of levels, zeros are used as the remaining constants. (If the list of constants is longer than the number of levels for the effect, the extra constants are ignored, and a warning message is displayed.)

To estimate the A linear effect in the preceding model, assuming equally spaced levels for A, you can use the following L:

L = (0 & | & -1 & 0 & 1 & | & 0 & 0 & | & -0.5 &
-0.5 & 0 & 0 & 0.5 & 0.5 )

The ESTIMATE statement for this L is written as

        estimate 'A Linear' A -1 0 1;

If you do not specify the elements of L for an effect that contains a specified effect, then the elements of the specified effect are equally distributed over the corresponding levels of the higher-order effect. In addition, if you specify the intercept in an ESTIMATE or CONTRAST statement, it is distributed over all classification effects that are not contained by any other specified effect. The distribution of lower-order coefficients to higher-order effect coefficients follows the same general rules as in the LSMEANS statement, and it is similar to that used to construct Type IV tests. In the previous example, the -1 associated with \alpha_1is divided by the number n1j of \gamma_{1j} parameters; then each \gamma_{1j} coefficient is set to -1/n1j. The 1 associated with \alpha_3 is distributed among the \gamma_{3j} parameters in a similar fashion. In the event that an unspecified effect contains several specified effects, only that specified effect with the most factors in common with the unspecified effect is used for distribution of coefficients to the higher-order effect.

Numerous syntactical expressions for the ESTIMATE statement were considered, including many that involved specifying the effect and level information associated with each coefficient. For models involving higher-level effects, the requirement of specifying level information can lead to very bulky specifications. Consequently, the simpler form of the ESTIMATE statement described earlier was implemented.

The syntax of this ESTIMATE statement puts a burden on you to know a priori the order of the parameter list associated with each effect. You can use the ORDER= option in the PROC GLM statement to ensure that the levels of the classification effects are sorted appropriately.

Note: If you use the ESTIMATE statement with unspecified effects, use the E option to make sure that the actual L constructed by the preceding rules is the one you intended.

A Check for Estimability

Each L is checked for estimability using the relationship: L = LH where H = (X'X)-X'X. The L vector is declared nonestimable, if for any i

{ABS}(L_i - ({LH})_i \gt
\{ \epsilon & & {if } L_i = 0 { or} \ 
 \epsilon x {ABS}(L_i) & &
 {otherwise} \.

where \epsilon = 10^{-4} by default; you can change this with the SINGULAR= option. Continued fractions (like 1/3) should be specified to at least six decimal places, or the DIVISOR parameter should be used.

Chapter Contents
Chapter Contents

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.