Stata Analysis Tools
Anova Power Simulation

The simpower ado does a Monte Carlo power simulation of one-way anova designs. Here is how you can download the commands from ATS. You can download the simpower command by typing findit simpower (see How can I use the findit command to search for programs and get additional help? for more information about using findit). Now, let's looks at several examples using simpower.

Let's begin by simulating a three group anova using usage #1.

simpower, groups(3) n(5 5 5) mu(10 12 14) s(3 3 3)

Sample Sizes, Means and Standard Deviations
-------------------------------------------
N1 = 5        MU1 = 10         S1 = 3
N2 = 5        MU2 = 12         S2 = 3
N3 = 5        MU3 = 14         S3 = 3

 1000 simulated ANOVA F tests
------------------------------
 Alpha   Simulated 
 Level     Power
------------------------------
 0.1000   0.5260       
 0.0750   0.4680       
 0.0500   0.3820       
 0.0250   0.2600       
 0.0100   0.1440       

simpower, groups(3) n(10 10 10) mu(10 12 14) s(3 3 3)

Sample Sizes, Means and Standard Deviations
-------------------------------------------
N1 = 10       MU1 = 10         S1 = 3
N2 = 10       MU2 = 12         S2 = 3
N3 = 10       MU3 = 14         S3 = 3

 1000 simulated ANOVA F tests
------------------------------
 Alpha   Simulated 
 Level     Power
------------------------------
 0.1000   0.8330       
 0.0750   0.7800       
 0.0500   0.7110       
 0.0250   0.5900       
 0.0100   0.4440 
Next, we will use simpower beginning with a real anova (usage #2).
use http://www.ats.ucla.edu/stat/stata/ado/analysis/crf33

anova y b

                           Number of obs =      45     R-squared     =  0.2957
                           Root MSE      = 9.35626     Adj R-squared =  0.2621

                  Source |  Partial SS    df       MS           F     Prob > F
              -----------+----------------------------------------------------
                   Model |  1543.33333     2  771.666667       8.82     0.0006
                         |
                       b |  1543.33333     2  771.666667       8.82     0.0006
                         |
                Residual |  3676.66667    42  87.5396825   
              -----------+----------------------------------------------------
                   Total |     5220.00    44  118.636364   

simpower y b

Sample Sizes, Means and Standard Deviations
-------------------------------------------
N1 = 15       MU1 = 27.666666  S1 = 8.7722502
N2 = 15       MU2 = 35.333332  S2 = 7.8437114
N3 = 15       MU3 = 42         S3 = 11.141941

Results of Standard ANOVA
----------------------------------------------------------------------
Dependent Variable is y and Independent Variable is b
F(  2,  42.00) =   8.815, p= 0.0006
----------------------------------------------------------------------

 1000 simulated ANOVA F tests
------------------------------
 Alpha   Simulated 
 Level     Power
------------------------------
 0.1000   0.9730       
 0.0750   0.9580       
 0.0500   0.9350       
 0.0250   0.8840       
 0.0100   0.8260