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.s...@imail.org
801.408.8111


> -----Original Message-----
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@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@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.

______________________________________________
R-help@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.

Reply via email to