Chapter Contents
Chapter Contents
The GLM Procedure


The following statements are available in PROC GLM.

PROC GLM < options > ;
CLASS variables ;
MODEL dependents=independents < / options > ;

ABSORB variables ;
BY variables ;
FREQ variable ;
ID variables ;
WEIGHT variable ;

CONTRAST 'label' effect values < ... effect values > < / options > ;
ESTIMATE 'label' effect values < ... effect values > < / options > ;
LSMEANS effects < / options > ;
MANOVA < test-options >< / detail-options > ;
MEANS effects < / options > ;
OUTPUT < OUT=SAS-data-set >
      keyword=names < ... keyword=names > < / option > ;
RANDOM effects < / options > ;
REPEATED factor-specification < / options > ;
TEST < H=effects > E=effect < / options > ;

Although there are numerous statements and options available in PROC GLM, many applications use only a few of them. Often you can find the features you need by looking at an example or by quickly scanning through this section.

To use PROC GLM, the PROC GLM and MODEL statements are required. You can specify only one MODEL statement (in contrast to the REG procedure, for example, which allows several MODEL statements in the same PROC REG run). If your model contains classification effects, the classification variables must be listed in a CLASS statement, and the CLASS statement must appear before the MODEL statement. In addition, if you use a CONTRAST statement in combination with a MANOVA, RANDOM, REPEATED, or TEST statement, the CONTRAST statement must be entered first in order for the contrast to be included in the MANOVA, RANDOM, REPEATED, or TEST analysis.

The following table summarizes the positional requirements for the statements in the GLM procedure.

Table 30.1: Positional Requirements for PROC GLM Statements
Statement   Must Appear Before the   Must Appear After the
ABSORB first RUN statement  
BY first RUN statement  
CLASS MODEL statement  
  or RANDOM statement  
ESTIMATE   MODEL statement
FREQ first RUN statement  
ID first RUN statement  
LSMEANS   MODEL statement
    MODEL statement
MEANS   MODEL statement
OUTPUT   MODEL statement
    MODEL statement
    or TEST statement
TEST MANOVA or MODEL statement
  REPEATED statement  
WEIGHT first RUN statement  

The following table summarizes the function of each statement (other than the PROC statement) in the GLM procedure:

Table 30.2: Statements in the GLM Procedure
Statement Description
ABSORBabsorbs classification effects in a model
BYspecifies variables to define subgroups for the analysis
CLASSdeclares classification variables
CONTRASTconstructs and tests linear functions of the parameters
ESTIMATEestimates linear functions of the parameters
FREQspecifies a frequency variable
IDidentifies observations on output
LSMEANScomputes least-squares (marginal) means
MANOVAperforms a multivariate analysis of variance
MEANScomputes and optionally compares arithmetic means
MODELdefines the model to be fit
OUTPUTrequests an output data set containing diagnostics for each observation
RANDOMdeclares certain effects to be random and computes expected mean squares
REPEATEDperforms multivariate and univariate repeated measures analysis of variance
TESTconstructs tests using the sums of squares for effects and the error term you specify
WEIGHTspecifies a variable for weighting observations

The rest of this section gives detailed syntax information for each of these statements, beginning with the PROC GLM statement. The remaining statements are covered in alphabetical order.

PROC GLM Statement

ABSORB Statement

BY Statement

CLASS Statement

CONTRAST Statement

ESTIMATE Statement

FREQ Statement

ID Statement

LSMEANS Statement

MANOVA Statement

MEANS Statement

MODEL Statement

OUTPUT Statement

RANDOM Statement

REPEATED Statement

TEST Statement

WEIGHT Statement

Chapter Contents
Chapter Contents

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