Linear Statistical Models

anova1: The Program

Updated for Stata 11


One-way analysis of variance, more so, than other designs follows a very predictable pattern of analysis. Thus, it is possible to write a program that does, just about, everything you would want to do for any particular one-way anova.

The program anova1.do needs to be copied, pasted into the do-file editor and saved to your data directory. To run the program type

This program requires that the commands omega2, prcomp and fhcomp are installed on your computer. These programs can be obtain in two different ways. Both methods require that your computer be connected to the Internet.

Try the findit method first following the instructions on the screen:

findit effectsize
findit tukeyhsd
findit tkcomp
findit qsturng
If you arre having problems with findit try these commands:
net from http://www.ats.ucla.edu/stat/stata/ado/analysis/
net install effectsize
net install tukeyhsd
net install tkcomp
net install qsturng
Here is an example of how to run anova1:
use http://www.phhilender.com/courses/data/cr4a, clear

do anova1 y grp

Here is the anova1.do program. You will need to copy it, psate it into your do-file editor, and save in your data directory.

Here is the Stata 11 version.

/* --------  anova1.do begin Stata 11 version --------------------- */
args dv iv
window manage forward results
summarize `dv', detail
more
hist `dv', normal
window manage forward graph
more
kdensity `dv', normal
window manage forward graph
more
window manage forward results
tabulate `iv', summ(`dv')
more
tabstat `dv', by(`iv') stat(n mean sd var)
more
sort `iv'
graph box `dv', over(`iv')
window manage forward graph
more
histogram `dv',  by(`iv') normal
window manage forward graph
more
window manage forward results
anova `dv' `iv'
more
effectsize `iv'
more
tkcomp `iv'
more
tukeyhsd `iv'
more
oneway `dv' `iv', noanova bonferroni sidak scheffe
/* -------- anova1.do end Stata 11 version ----------------------- */


Linear Statistical Models Course

Phil Ender, 17sep10, 10apr06, 25May00