views:

352

answers:

2

I am trying to calculate the necessary sample size for a 2x2 factorial design. I have two questions.

1) I am using the package pwr and the one way anova function to calculate the necessary sample size using the following code

pwr.anova.test(k = , n = , f = , sig.level = , power = )

However, I would like to look at two way anova, since this is more efficient at estimating group means than one way anova. There is no two-way anova function that I could find. Is there a package or routine in [R] to do this?

2) Moreover, am I safe in assuming that since I am using a one-way anova power calculations, that the sample size will be more conservative (i.e. larger)?

A: 

In a 2 x 2 ANOVA involving Factor A, Factor B, and AxB, you will get separate statistical power estimates for each of these three effects.

G Power 3 provides free software and some clear tutorials for estimating power of effects in factorial designs: http://www.psycho.uni-duesseldorf.de/abteilungen/aap/gpower3/user-guide-by-design

Jeromy Anglim
A: 

Hi Thomas, After searching - I couldn't find any solution for this online.

What I would suggest you to do (if you know how) is to program this using a simulation. If you don't know how to do it, then write a SO question about "How can I write a simulation of two-way anova, to achieve power analysis" and see what people might help you with :)

Also, you could start by reviewing the code here:

http://www.rforge.net/doc/packages/NCStats/power.sim.html

For a start on power calculation through simulation.

Notice what Jeromy wrote - this power analysis is for multiple outcomes.

Interesting subject - I'd love to followup on it.

Best,

Tal

Tal Galili
Thanks you two for the input Jeremy and Tal. I will think about your suggestions and how to incorporate them.
Thomas