Means: One and Two Groups
Calculate the sample size needed for a two-sided or one-sided two-sample t-test when the two independent groups are allocated unequally. The calculation assumes normally distributed outcomes with a common population standard deviation and uses the noncentral t distribution, matching the this method equal-variance method.
This calculator implements the traditional two-sample equal-variance t-test used by this method for independent groups. The planning assumptions are a common standard deviation, a specified difference in population means, a Type I error rate, a desired power, and an allocation constraint between the two groups. this method explicitly supports unequal allocation by setting R = N2/N1 and calculating N2 = ceil(R × N1).
For the final analysis, the pooled standard deviation is used because the two population variances are assumed equal:
For planning, this method calculates the degrees of freedom as df = N1 + N2 − 2 and the noncentrality parameter as:
The power is then obtained from the noncentral t distribution using the appropriate central-t critical value. For a two-sided test, power is the probability outside the two critical values; for a one-sided test, it is the probability beyond the single critical value in the specified direction. when solving for sample size it uses this same power formulation and searches for the required parameter.
When the allocation ratio is R = N2/N1, the Group 2 sample size is calculated as N2 = ceil(R × N1). The calculator then searches over integer values of N1. The first combination whose actual power is at least the requested target is reported. Because sample sizes are discrete, actual power can be slightly above the target.
Using the documented this method method, consider a two-sided test with α = 0.05, 80% target power, δ = 0.05, σ = 0.10, and R = 2.00. The allocation rule gives N2 = 2N1. The calculation gives N1 = 48 and N2 = 96, for a total sample size of 144, with actual power approximately 0.80214. The immediately smaller allocation, N1 = 47 and N2 = 94, has power approximately 0.79374, so 48/96 is the first allocation meeting 80% power.
The underlying outcome distributions are assumed to be normal and to have equal population variances. If unequal variances are expected, use an unequal-variance/Welch procedure instead. the relevant methodological literature identifies the equal-variance and unequal-variance procedures separately.
Chow, S.C., Shao, J., Wang, H., & Lokhnygina, Y. (2018). Sample Size Calculations in Clinical Research, 3rd Edition. Taylor & Francis/CRC, Boca Raton, Florida.
Julious, S.A. (2010). Sample Sizes for Clinical Trials. Chapman & Hall/CRC, Boca Raton, Florida.