University of Southern California

ITS Information Technology Services

A division of the Office of the Chief Information Officer

Analysis of Variance Using SAS

Analysis of Variance is the preferred statistical technique when:
  1. The dependent variable is numeric and approximately normally distributed, AND
  2. The hypothesis to be tested is whether there is a significant difference among the means of three or more groups, OR
    There are two or more factors to be tested, and at least one of those factors is categorical.

A few examples of research designs that would use some type of Analysis of Variance include:

How to Do an Analysis of Variance Using SAS

There are actually multiple options for ANOVA using SAS. One of these is PROC GLM. GLM stands for General Linear Model. Analysis of Variance, Repeated Measures Analysis of Variance, Regression and Analysis of Covariance are all specific cases of the general linear model. To perform an ANOVA using the GLM procedure, type the following:

Proc glm data= dataset-name ;
Class categorical variable(s) ;
Model dependent = independents ;

Usually, you will also want to add a statement requesting post hoc tests. Post hoc is Latin for "after this". The phrase is meant literally. A post hoc test is necessary ONLY after a significant F-statistic is found.

What Does an F-Test Test?

An F-test tests whether the variance among groups is greater than the variance between groups. If your F-test is significant, showing that at least one group is significantly different from the others, the next question is,

"Which group is significantly different?"

This question is answered by use of a post hoc test. If the F-test is non-significant, leading to the conclusion that none of the groups are significantly different, then obviously it doesn't make any sense to do a post hoc test and see which one or more of them is different.

There are several options for post hoc tests available using SAS. The most commonly used is the Tukey test. If you have three groups, A, B and C, the Tukey tests whether A is significantly different from B or C, and whether B is significantly different than C. In other words, it does all possible pair-wise comparisons.

Click here for examples of how to use SAS to perform the two most commonly requested types of ANOVAs.

Last updated:
September 04, 2008

SAS

The use of all USC computing resources is governed by the USC Computing Policies.