The GLMMOD Procedure

A One-Way Design

(View the complete code for this example.)

A one-way analysis of variance considers one treatment factor with two or more treatment levels. This example employs PROC GLMMOD together with PROC REG to perform a one-way analysis of variance to study the effect of bacteria on the nitrogen content of red clover plants. The treatment factor is bacteria strain, and it has six levels. Red clover plants are inoculated with the treatments, and nitrogen content is later measured in milligrams. The data are derived from an experiment by Erdman (1946) and are analyzed in Chapters 7 and 8 of Steel and Torrie (1980). PROC GLMMOD is used to create the design matrix. The following DATA step creates the SAS data set Clover.

title 'Nitrogen Content of Red Clover Plants';
data Clover;
   input Strain $ Nitrogen @@;
   datalines;
3DOK1  19.4 3DOK1  32.6 3DOK1  27.0 3DOK1  32.1 3DOK1  33.0
3DOK5  17.7 3DOK5  24.8 3DOK5  27.9 3DOK5  25.2 3DOK5  24.3
3DOK4  17.0 3DOK4  19.4 3DOK4   9.1 3DOK4  11.9 3DOK4  15.8
3DOK7  20.7 3DOK7  21.0 3DOK7  20.5 3DOK7  18.8 3DOK7  18.6
3DOK13 14.3 3DOK13 14.4 3DOK13 11.8 3DOK13 11.6 3DOK13 14.2
COMPOS 17.3 COMPOS 19.4 COMPOS 19.1 COMPOS 16.9 COMPOS 20.8
;

The variable Strain contains the treatment levels, and the variable Nitrogen contains the response. The following statements produce the design matrix:

proc glmmod data=Clover;
   class Strain;
   model Nitrogen = Strain;
run;

The classification variable, or treatment factor, is specified in the CLASS statement. The MODEL statement defines the response and independent variables. The design matrix produced corresponds to the model

where and .

Figure 48.1 and Figure 48.2 display the output produced by these statements. Figure 48.1 displays information about the data set, which is useful for checking your data.

Figure 48.1: Class Level Information and Parameter Definitions

Nitrogen Content of Red Clover Plants

The GLMMOD Procedure

Class Level Information
ClassLevelsValues
Strain63DOK1 3DOK13 3DOK4 3DOK5 3DOK7 COMPOS

Number of Observations Read30
Number of Observations Used30

Parameter Definitions
Column NumberName of Associated
Effect
CLASS Variable
Values
Strain
1Intercept 
2Strain3DOK1
3Strain3DOK13
4Strain3DOK4
5Strain3DOK5
6Strain3DOK7
7StrainCOMPOS


The design matrix, shown in Figure 48.2, consists of seven columns: one for the mean and six for the treatment levels. The vector of responses, Nitrogen, is also displayed.

Figure 48.2: Design Matrix

Design Points
Observation
Number
NitrogenColumn Number
1234567
119.41100000
232.61100000
327.01100000
432.11100000
533.01100000
617.71000100
724.81000100
827.91000100
925.21000100
1024.31000100
1117.01001000
1219.41001000
139.11001000
1411.91001000
1515.81001000
1620.71000010
1721.01000010
1820.51000010
1918.81000010
2018.61000010
2114.31010000
2214.41010000
2311.81010000
2411.61010000
2514.21010000
2617.31000001
2719.41000001
2819.11000001
2916.91000001
3020.81000001


Usually, you will find PROC GLMMOD most useful for the data sets it can create rather than for its displayed output. For example, the following statements use PROC GLMMOD to save the design matrix for the clover study to the data set CloverDesign instead of displaying it.

proc glmmod data=Clover outdesign=CloverDesign noprint;
   class Strain;
   model Nitrogen = Strain;
run;

Now you can use the REG procedure to analyze the data, as the following statements demonstrate:

proc reg data=CloverDesign;
   model Nitrogen = Col2-Col7;
run;

The results are shown in Figure 48.3.

Figure 48.3: Regression Analysis Using the REG Procedure

Nitrogen Content of Red Clover Plants

The REG Procedure
Model: MODEL1
Dependent Variable: Nitrogen

Number of Observations Read30
Number of Observations Used30

Analysis of Variance
SourceDFSum of
Squares
Mean
Square
F ValuePr > F
Model5847.04667169.4093314.37<.0001
Error24282.9280011.78867  
Corrected Total291129.97467   

Root MSE3.43346R-Square0.7496
Dependent Mean19.88667Adj R-Sq0.6975
Coeff Var17.26515  


Note:Model is not full rank. Least-squares solutions for the parameters are not unique. Some statistics will be misleading. A reported DF of 0 or B means that the estimate is biased.


Note:The following parameters have been set to 0, since the variables are a linear combination of other variables as shown.

Col7 =Intercept - Col2 - Col3 - Col4 - Col5 - Col6

Parameter Estimates
VariableLabelDFParameter
Estimate
Standard
Error
t ValuePr > |t|
InterceptInterceptB18.700001.5354912.18<.0001
Col2Strain 3DOK1B10.120002.171514.66<.0001
Col3Strain 3DOK13B-5.440002.17151-2.510.0194
Col4Strain 3DOK4B-4.060002.17151-1.870.0738
Col5Strain 3DOK5B5.280002.171512.430.0229
Col6Strain 3DOK7B1.220002.171510.560.5794
Col7Strain COMPOS00...