Chapter Contents 
Previous 
Next 
The ANOVA Procedure 
The assumptions of analysis of variance (Steel and Torrie 1980) are
The following example studies the effect of bacteria on the nitrogen content of red clover plants. The treatment factor is bacteria strain, and it has six levels. Five of the six levels consist of five different Rhizobium trifolii bacteria cultures combined with a composite of five Rhizobium meliloti strains. The sixth level is a composite of the five Rhizobium trifolii strains with the composite of the Rhizobium meliloti. 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). 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 analysis.
proc anova; class Strain; model Nitrogen = Strain; run;
The classification variable is specified in the CLASS statement. Note that, unlike the GLM procedure, PROC ANOVA does not allow continuous variables on the righthand side of the model. Figure 17.1 and Figure 17.2 display the output produced by these statements.

The "Class Level Information" table shown in Figure 17.1 lists the variables that appear in the CLASS statement, their levels, and the number of observations in the data set.
Figure 17.2 displays the ANOVA table, followed by some simple statistics and tests of effects.
The degrees of freedom (DF) column should be used to check the analysis results. The model degrees of freedom for a oneway analysis of variance are the number of levels minus 1; in this case, 61=5. The Corrected Total degrees of freedom are always the total number of observations minus one; in this case 301=29. The sum of Model and Error degrees of freedom equal the Corrected Total.
The overall F test is significant (F=14.37, p<0.0001), indicating that the model as a whole accounts for a significant portion of the variability in the dependent variable. The F test for Strain is significant, indicating that some contrast between the means for the different strains is different from zero. Notice that the Model and Strain F tests are identical, since Strain is the only term in the model.
The F test for Strain (F=14.37, p<0.0001) suggests that there are differences among the bacterial strains, but it does not reveal any information about the nature of the differences. Mean comparison methods can be used to gather further information. The interactivity of PROC ANOVA enables you to do this without rerunning the entire analysis. After you specify a model with a MODEL statement and execute the ANOVA procedure with a RUN statement, you can execute a variety of statements (such as MEANS, MANOVA, TEST, and REPEATED) without PROC ANOVA recalculating the model sum of squares.
The following command requests means of the Strain levels with Tukey's studentized range procedure.
means Strain / tukey; run;
Results of Tukey's procedure are shown in Figure 17.3.

The multiple comparisons results indicate, for example, that
Chapter Contents 
Previous 
Next 
Top 
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.