Ed230B/C

anova1: The Program


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 omega2
findit tukeyhsd
findit fhcomp
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 omega2
net install tukeyhsd
net install fhcomp
net install qsturng
Here is an example of how to run anova1:
use http://www.gseis.ucla.edu/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 8 version.

/* --------  anova1.do begin Stata 8 or later 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
omega2
more
fhcomp `iv'
more
tukeyhsd `iv'
more
oneway `dv' `iv', noanova bonferroni sidak scheffe
/* -------- anova1.do end Stata 8 version ----------------------- */
Here is the Stata 7 version
/* --------  anova1.do begin Stata 7 version --------------------- */
args dv iv
window manage forward results
summarize `dv', detail
more
graph `dv', hist 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 `dv', box by(`iv')
window manage forward graph
more
graph `dv', hist by(`iv') normal
window manage forward graph
more
window manage forward results
anova `dv' `iv'
more
omega2
more
fhcomp `iv'
more
tukeyhsd `iv'
more
oneway `dv' `iv', noanova bonferroni sidak scheffe
/* -------- anova1.do end Stata 7 version ----------------------- */


Linear Statistical Models Course

Phil Ender, 10apr06, 25May00