Data @ Reed

You have two options to run an analysis of variance (ANOVA) in Stata.

Using command oneway

If you are running a one-way ANOVA, you can use oneway to run both your analysis and some multiple-comparisons tests (Bonferroni, Scheffé, Sidák). The syntax of oneway is fairly simple: oneway response_variable factor_variable

For example:

sysuse lifeexp

oneway lexp gnppc

To run multiple-comparisons test, indicate which tests you wish to run by adding , bonferroni or  , scheffe or , sidak after your oneway command.

Using command anova

If you are running a two-way ANOVA, a repeated-measures ANOVA - or anything beyond a oneway ANOVA, you will need to use the anova command. (You can also run one-way ANOVAs with the anova command; your results should be the same although they may be presented slightly differently.)

The syntax for the anova command is anova response_variable factor_variable_1 factor_variable_2 [etc...]. The anova command can take a number of options, including repeated measures designs, which is covered extensively in other documentation here.

Note that when you are using anova, Stata asks that you specify your error and interaction terms and Stata assumes that all factor variables are categorical. (To specify that variables are not categorical, use the c. factor-variable specification.)

Further resources

Stata documentation: oneway command

Stata documentation: anova command