Stata Help

Post-Hocs in Stata

In the case of one-way ANOVAs possessing a significant result and more than two groups, Stata has the built-in option to run a sidak bonferroni or scheffe comparison. Simply specify one (or all) after the oneway command. As usual, options should come after a comma (oneway [depvar] [groupvar], sidak for example).

In cases where anova is used (the ANOVA has more than one dimension), no such built-in options exist. However, a number of user-written programs can be obtained to run the Tukey HSD, the Tukey-Kramer or the Fisher-Hayter, the latter two being preferred for unequal cell sizes. Specific instructions for running a Tukey-HSD can be found here; however, the ideas outlined apply equally well to the Tukey-Kramer and Fisher-Hayter.

Post-hoc analyses for more complex designs get complicated quickly. Additionally, http://www.ats.ucla.edu/stat/stata/faq/sme_dummy.htm offers information about running simple main effect tests after dummy coding variables for a regression. The UCLA website gives access to test data files so you can learn with examples how to tame this fairly complex coding. These resources can point you to additional user-created programs such as prcomp, too.

Stata also has the test command which, if you are unafraid of both the syntax and the theory behind ANOVA, can basically do any sort of follow-up test you can imagine. A useful guide to doing post-hocs using Stata's built-in functionality can be found here on Stata's help website.

You can use the test command via the menus by going to Statistics => Linear models and related => ANOVA/MANOVA => Test linear hypotheses after anova. The useful thing about using the menu is there is a link to a help postestimation anova example which offers the most straightforward guide to using Stata to do simple effects tests.

Packages might also exist for the specific test you want to run. Try typing findit [test name] into the Command window and see what comes up.

Another useful package is the simple main effects package, created for further exploring significant interaction effects. UCLA has some documentation on it here including how to find it (the same as with Tukey-HSD findit sme).

Back to ANOVA