Statistical Calculators › Means: One and Two Groups › Two-Sample t-Test (Unequal Variance / Welch) Sample Size
← All Calculators

Means: One and Two Groups

Two-Sample t-Test (Unequal Variance / Welch) Sample Size

Calculate the minimum sample size for a two-sided or one-sided two-sample Welch t-test when the two population variances are not assumed to be equal. The calculation uses the noncentral t power function and searches over integer group sizes, matching the approach documented by PASS.

Study Design Inputs

Specify the effect, variability, error rate, power, and allocation between the two independent groups.

Required Sample Size

The result is the first integer allocation found whose calculated power meets or exceeds the target.
Enter the study assumptions and click Calculate Sample Size.

Methodology

This calculator implements the two-sample unequal-variance t-test, commonly called Welch's t-test or the Aspin-Welch-Satterthwaite test. PASS describes the corresponding procedure as a sample-size and power calculation for one- or two-sided two-sample t-tests without an equal-variance assumption. The underlying analysis assumes normally distributed populations.

Welch Test Statistic

For group means 1 and 2, standard deviations s1 and s2, and sample sizes n1 and n2, the Welch statistic is

t = (x̄₁ − x̄₂) / √(s₁²/n₁ + s₂²/n₂)

The Welch-Satterthwaite degrees of freedom are

df = (s₁²/n₁ + s₂²/n₂)² / [ (s₁²/n₁)²/(n₁−1) + (s₂²/n₂)²/(n₂−1) ]

Power and Sample Size

For planning, the assumed population standard deviations (σ1, σ2) replace the sample standard deviations in the variance terms. For a specified true mean difference δ, the noncentrality parameter is

λ = δ / √(σ₁²/n₁ + σ₂²/n₂)

For each candidate integer pair (n1, n2), the calculator obtains the critical value from the central t distribution using the Welch degrees of freedom and evaluates the rejection probability under the corresponding noncentral t distribution. It then searches upward until the calculated power is at least the requested target.

For a two-sided test, the rejection region is in both tails. For an upper one-sided test, rejection is in the upper tail; for a lower one-sided test, rejection is in the lower tail. The allocation ratio is defined as n2/n1; when the ratio is 1, the groups are equal in size.

Worked Validation Example

The PASS documentation's Example 1 provides a direct validation target. With a two-sided test, target power 0.90, α = 0.05, equal allocation, mean difference δ = 2, σ1 = 1, and σ2 = 2.5, PASS reports n1 = 21 and n2 = 21, for a total sample size of 42, with actual power 0.90607. The same PASS example also reports n1 = n2 = 30 for α = 0.01.

References

Welch, B. L. (1938). The Significance of the Difference Between Two Means when the Population Variances are Unequal. Biometrika, 29(3–4), 350–362. DOI: 10.1093/biomet/29.3-4.350.

NCSS, LLC. PASS Sample Size Software, Chapter 424: Two-Sample T-Tests Allowing Unequal Variance. The PASS documentation specifies the Welch/Aspin-Welch-Satterthwaite test statistic, Welch degrees of freedom, noncentral t power calculation, and the worked sample-size example used above.