[R] power.t.test formula

Karl Ove Hufthammer Karl.Hufthammer at math.uib.no
Fri Apr 24 10:41:24 CEST 2009


Peter Dalgaard:

>> Does anyone of you knows a reference for the formula used in power.t.test
>> function? And also why it uses the Student's distribution instead of
>> Normal. (I know both of them can be used but don't see whether choose one
>> or the other)
> 
> It is  a straightforward first-principles calculation. The t
> distribution calculation is exact for normally distributed data with the
> same unknown variance in both groups.

I didn’t know about power.t.test. A very nice function, indeed. Is there a 
similar function that handles unequal number of observations for each 
group, and unequal variances?

The help file mislead me into thinking that power.t.test handles unequal 
number of observations, and for example  ‘power.t.test(c(10,3),1)’ *does* 
give some output (and not a warning or error), just not the output I was 
expecting.

(It gives two power values, one for sample of size 10 (for each group) and 
one for samples of size 3 (for each group), while I was expecting the power 
for a sample size 10 for one group and 3 for the other group).

-- 
Karl Ove Hufthammer




More information about the R-help mailing list