Statistical Power–Calculate Sample Size Given Power

pwr.t.test(n = NULL, d = 0.2, sig.level = 0.05, 
+power = 0.90, type = "one.sample", +alternative = "two sided”)

One-sample Student's t-test power calculation

N = 264.6137

d = 0.2

sig.level = 0.05

power = 0.9

alternative = two.sided

For 90% power level, 265 samples are required if the effect size is small.

If  the power level is reduced to 80% power level, then fewer samples would be needed.

If effect size is medium, d = 0.5, the number of samples needed would only be only 44, which would clearly be a easier number of samples to obtain.


Transcript

So returning back again to the case where we have a small effect size.  How many samples would we need to get a 90% power? So you put in a power of 90% the number in this case set to NULL - we don't know it is. We have said it's a small effect size. We want the same significance (95%) level.  So now, what do we get? Well, it tells us that for a 90% power level, we need 265 samples - if the effect size is small.  If the power levels is reduced to 80%, then, of course, we can reduce the number of samples that we need. If the effect size were actually medium (d=0.5), then the number of samples we need is actually only 44.  And we see this is way less than the 199 that we actually had, so that means that with this [number of samples] that we don't have enough to see a _small effect_ but we certainly have enough samples from 119 to see a _medium size affect_.  Now, I encourage you to read more about our analysis and think about a power analysis calculation to figure out how many samples you actually need to be able to see the size of the effect that you are expecting.