[R] Power of t test for unequal variances?

Gerrit Eichner Gerrit.Eichner at math.uni-giessen.de
Tue Dec 20 08:54:42 CET 2016

Hello, Mauricio,

maybe pwr.t2n.test() in package pwr or/and n.ttest() in package
samplesize do what you need/want.

  Hth  --  Gerrit

Dr. Gerrit Eichner                   Mathematical Institute, Room 212
gerrit.eichner at math.uni-giessen.de   Justus-Liebig-University Giessen
Tel: +49-(0)641-99-32104          Arndtstr. 2, 35392 Giessen, Germany
Fax: +49-(0)641-99-32109            http://www.uni-giessen.de/eichner

Am 20.12.2016 um 00:31 schrieb David Winsemius:
>> On Dec 19, 2016, at 1:47 PM, Mauricio Cornejo via R-help <r-help at r-project.org> wrote:
>> Is there a function similar to stats::power.t.test that can handle unequal variances from two samples?
>> I noticed that stats::t.test has an argument for indicating whether or not to treat the two sample variances as equal.  Wondering why stats::power.t.test doesn’t have that option.
>> Thanks,Mauricio
>> 	[[alternative HTML version deleted]]
> Because R was developed by statisticians for statisticians and they assumed those other statisticians would know how to extend its functions when needed. But R-help is not advertised as the place to ask such questions when you don't have the statistical skills. (You might want to look at the code of `t.test` to see how you might construct appropriate arguments for `power.t.test` in the situation you imagine. Seems to me it should be fairly straightforward. `power.t.test` is built around the non-central t-distribution and solves a uniroot problem for the missing parameter among  n, delta, power, sd, and sig.level, given the other 4 parameters.)

More information about the R-help mailing list