# Required sample size with unequal variances

I have a setup with equal sample sizes ($N_1=N_2$) from two groups (sample means $\mu_1$, $\mu_2$), but different variances $\sigma_1^2$, $\sigma_2^2$ in both groups. If the variances were equal, there are lots of well-known formulas to calculate the necessary sample size to obtain some requested statistical power.

How do I calculate the power or sample size for unequal variances? (Bonus question: Which function can I use in R?)

I am planning to test for difference of means using a Welch t-test.

• Your notation may confuse people, because ordinarily "$(\mu_1,\mu_2)$" would be understood to refer to (assumed) sample means (which may be relevant here), rather than sample sizes. The power and sample size calculations will depend on what test you elect to apply, so perhaps you could edit this post to include that information? – whuber Apr 21 '15 at 15:57
• Thanks for the comment, I hope the question is clearer now. – quazgar Apr 22 '15 at 7:44
• It is clearer, but I still wonder about one thing: you say you already have data. Is the purpose of performing a power analysis because you contemplate obtaining more data? Or to do a follow-on study? Some other reason? – whuber Apr 22 '15 at 15:46
• The background is to calculate sample sizes for another study where I assume similar distributions to a previous one. The condition $N_1=N_2$ comes from the experimental setup where two measurements $X_1, X_2$ are taken from each subject. – quazgar Apr 23 '15 at 8:22
• Hello! I'm having a similar problem, and would like to know if there's any update on that question (maybe @quazgar found a solution by himself). – Bruno Nov 3 '18 at 5:22