[R] power of 2 way ANOVA with interaction

Greg Snow Greg.Snow at imail.org
Mon Apr 4 18:02:46 CEST 2011

You can use simulation:

1. decide what you think your data will look like
2. decide how you plan to analyze your data
3. write a function that simulates a dataset (common arguments include sample size(s) and effect sizes) then analyzes the data in your planned manner and returns the p-value(s) or other statistic(s) of interest
4. run the function from 3 a bunch (1000 or more) times, the replicate function is useful for this (progress bars can also be useful)
5. the proportion of times that the results are significant is your estimate of power

Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org

> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Timothy Spier
> Sent: Sunday, April 03, 2011 5:11 PM
> To: R Help
> Subject: [R] power of 2 way ANOVA with interaction
> I've been searching for an answer to this for a while but no joy. I
> have a simple 2-way ANOVA with an interaction. I'd like to determine
> the power of this test for each factor (factor A, factor B, and the A*B
> interaction). How can I do this in R? I used to do this with "proc
> Glmpower" in SAS, but I can find no analogue in R.
> 	[[alternative HTML version deleted]]
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list