HOME Module List Site Index About This Site Glossary Resources Innovative Technology Center UT Statistics Courses
Using SAS Choose Design ANOVA Compare Means Regression Examples
What is the MMAOV SAS Macro?

The Mixed Model Analysis of Variance (MMAOV) macro is a SAS program that allows complex ANOVA models to be easily analyzed in SAS. It was written by Arnold Saxton at The University of Tennessee. The goal is to allow inexperienced users to correctly run statistical analyses, including all the auxiliary results needed to verify data and model validity. With the macro, what might take 20 or 30 lines of SAS instructions can be requested with one statement.

Use your browser's BACK button to return to your module.

%MMAOV needs the dataset, the dependent variable, and a description of the statistical model. Models are described by:

1) specifying which model variables are factors with levels, as opposed to regression variables. Factor variables are given in the CLASS= list, regression variables are not listed. Typically treatments are "class" variables, since their levels simply indicate which group an observation belongs to.

2) specifying the models terms, separated into lists of fixed terms (FIXED=) and random terms (RANDOM=). The overall mean and residual error are created for you, and should not be typed in.

For example:

%MMAOV(one, response, CLASS=trt, FIXED=trt);

%MMAOV(one, response, FIXED=trt);

requests two analyses of the variable RESPONSE in dataset ONE. The first is an ANOVA model, comparing the means of the levels of the class variable TRT. Class is short for classification, indicating the values of the TRT variable simply classify observations into treatment groups. The second analysis would run a regression analysis across the values of TRT.

Fixed effects in the model are generally treatments and regression variables, things of scientific interest. Random effects are sources of variation that are being blocked on, or are creating error terms to test treatments. A randomized block design with sampling is requested by

%MMAOV(one, response, CLASS=block trt, FIXED=trt, RANDOM=block block*trt);

where the random option lists the block term and the correct error term for TRT.


A brief users guide is included here, listing all the options that can be requested.

CLASS= list variables whose values represent classification.
Do not list variables with quantitative values to be used in regression.

FIXED= specify fixed model terms, such as treatments, their interactions, covariates, etc.

RANDOM= specify random model terms, such as blocks, error terms, samples, etc.


Other options:

REPEAT= to specify ONE repeated measures factor, which MUST be in the lowest sub-plot.

CONTRASTS=%str(your statements) to request tests of contrasts.

CONTRAST= can be used instead of CONTRASTS=.

BY= to have separate analyses for each level of the variable(s) specified.


Special Options:

AT= (cov1 cov2)=(5 60) will request least squares means to be calculated at the specified covariate values. Covariate mean values are the default.

TYPE= to change the repeated measures correlation pattern, AR(1) by default.
The default is ar(1), autoregressive.

ADJUST= to use a mean separation other than LSD (default).

DDFM= denominator degrees of freedom method. MMAOV switches to Kenward-Rogers approximate df for models with more than one error term, or if repeat is used. To prevent this, user can specify the desired method. Default is CONTAIN.

PLOT= list a term with 1 or 2 treatment factors to plot treatment means.

DIAGNOSTICS=OFF to not produce any checks for normality, equal variance, etc.


The following options deal with mean separation processing.

SORT= YES or NO (default) to have least square means sorted by value.

ALPHA= .05 (default), the significance level used for mean separation.

SLICE=variables Effects containing all the slice variables will be subdivided, and mean separation reporting done within slice levels. Note that all comparisons are made, just reporting of comparisons across slice levels is suppressed. This is useful to reduce the complexity of letter groupings.

TEST0=NO by default. Any other value will print tests of Ho: lsmean=0.


Transform options:

By default the transvalue is 0, except arsinsqrt has a default of 1; rank transform does ranking within levels of random class variables (assumed to be blocks).


Other output: Mean separation values, LSD value by default, are printed in the SAS Log. Min and max values are printed to help decide if the average value is appropriate to use in unbalanced situtations.

Use your browser's BACK button to return to your module.


Home | Contact us | Module list & summary | Glossary/Terms | About this site | Stats courses | Links | Index