[R] Power of t test for unequal variances?

David Winsemius dwinsemius at comcast.net
Tue Dec 20 00:31:02 CET 2016

> 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.)


David Winsemius
Alameda, CA, USA

More information about the R-help mailing list