Skip to content
Prev 257300 / 398506 Next

Power Analysis

First, note that you are doing two separate power calculations,
one with n=2 and sd = 1.19, the other with n=3 and sd = 4.35.
I will assume this was on purpose.  Now...
Two-sample t test power calculation 

              n = 2
          delta = 13.5
             sd = 1.19
      sig.level = 0.05
          power = 0.9982097
    alternative = two.sided

Now, with n=2, the power is already .99.  With n=1, there are zero df.
So, what n corresponds to a power of .8?
Two-sample t test power calculation 

              n = 1.6305
          delta = 13.5
             sd = 1.19
      sig.level = 0.05
          power = 0.8003734
    alternative = two.sided

It looks like 1.63 subjects will do the job :-)

Finally, look at the power.t.test function, there is a line that explains
your error message:

 else if (is.null(n)) 
        n <- uniroot(function(n) eval(p.body) - power, c(2, 1e+07))$root

power.t.test() is making the sensible assumption that we only care about 
sample sizes of at least n = 2....

albyn
On Mon, Apr 18, 2011 at 02:31:19PM -0700, Schatzi wrote: