The ANOVA Procedure

PROC ANOVA Statement

PROC ANOVA <options> ;

The PROC ANOVA statement invokes the ANOVA procedure. Table 25.2 summarizes the options available in the PROC ANOVA statement.

Table 25.2: PROC ANOVA Statement Options



Specify input and output data sets


Specifies input SAS data set


Requests the multivariate mode of eliminating observations with missing values


Requests that the input data set be reread when necessary, instead of using a utility file


Specifies the length of effect names


Suppresses the normal display of results


Specifies the sort order for the levels of the classification variables


Names an output data set for information and statistics on each model effect


Controls the plots produced through ODS Graphics.

You can specify the following options in the PROC ANOVA statement:


names the SAS data set used by the ANOVA procedure. By default, PROC ANOVA uses the most recently created SAS data set.


requests the multivariate mode of eliminating observations with missing values. If any of the dependent variables have missing values, the procedure eliminates that observation from the analysis. The MANOVA option is useful if you use PROC ANOVA in interactive mode and plan to perform a multivariate analysis.


requests that PROC ANOVA reread the input data set, when necessary, instead of writing the values of dependent variables to a utility file. This option decreases disk space usage at the expense of increased execution times and is useful only in rare situations where disk space is at an absolute premium.


specifies the length of effect names to be n characters long, where n is a value between 20 and 200 characters. The default length is 20 characters.


suppresses the normal display of results. The NOPRINT option is useful when you want to create only the output data set with the procedure. Note that this option temporarily disables the Output Delivery System (ODS); see Chapter 20: Using the Output Delivery System, for more information.


specifies the sort order for the levels of the classification variables (which are specified in the CLASS statement). This option applies to the levels for all classification variables, except when you use the (default) ORDER=FORMATTED option with numeric classification variables that have no explicit format. With this option, the levels of such variables are ordered by their internal value.

The ORDER= option can take the following values:

Value of ORDER=

Levels Sorted By


Order of appearance in the input data set


External formatted value, except for numeric variables with no explicit format, which are sorted by their unformatted (internal) value


Descending frequency count; levels with the most observations come first in the order


Unformatted value

By default, ORDER=FORMATTED. For ORDER=FORMATTED and ORDER=INTERNAL, the sort order is machine-dependent.


names an output data set that contains sums of squares, degrees of freedom, F statistics, and probability levels for each effect in the model. If you use the CANONICAL option in the MANOVA statement and do not use an M= specification in the MANOVA statement, the data set also contains results of the canonical analysis. See the section Output Data Set for more information.


controls the plots produced through ODS Graphics. When ODS Graphics is enabled, the ANOVA procedure can display a grouped box plot of the input data with groups defined by an effect in the model. Such a plot is produced by default if you have a one-way model, with only a single classification variable, or if you use a MEANS statement. Specify the PLOTS=NONE option to prevent these plots from being produced when ODS Graphics is enabled.

ODS Graphics must be enabled before plots can be requested. For example:

ods graphics on;
proc anova data = Clover;
   class strain;
   model Nitrogen = Strain;
ods graphics off;

For more information about enabling and disabling ODS Graphics, see the section Enabling and Disabling ODS Graphics in Chapter 21: Statistical Graphics Using ODS.

The following option can be specified in parentheses after PLOTS.


specifies that plots with elements that require processing of more than number points be suppressed. The default is MAXPOINTS=5000. This limit is ignored if you specify MAXPOINTS=NONE.