Re: [R] power of 2 way ANOVA with interaction

From: Greg Snow <Greg.Snow_at_imail.org>
Date: Mon, 04 Apr 2011 10:02:46 -0600

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
801.408.8111



> -----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.
______________________________________________ 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.
Received on Mon 04 Apr 2011 - 16:06:46 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 04 Apr 2011 - 16:20:27 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive