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

Means: One and Two Groups

Two-Sample t-Test (Equal Variance) Sample Size

Calculates the required equal sample size in each of two independent groups for a two-sided or one-sided Student's t-test assuming a common population variance. The calculation uses the exact noncentral-t power formulation rather than a normal-approximation shortcut.

Study Design

Enter the assumed means, common standard deviation, significance level, and desired power.

Required Sample Size

The smallest integer sample size per group whose exact noncentral-t power meets or exceeds the requested target.
Enter the design assumptions and click Calculate Sample Size.

Methodology

This calculator implements the traditional two-sample Student's t-test for two independent groups when the two population variances are assumed to be equal. Note that this as the Two-Sample T-Tests Assuming Equal Variance procedure and describes it as a parallel-group design. this is also known as the Two Sample Student's t-test (equal variances).

For equal group sizes, the test has 2n − 2 degrees of freedom. If the assumed mean difference is δ = μ1 − μ2 and the common standard deviation is σ, the noncentrality parameter is based on δ / [σ√(1/n + 1/n)]. power is obtained from the noncentral-t distribution and that sample size is found by searching over the discrete sample-size values.

df = 2n − 2

λ = δ / [σ√(1/n + 1/n)] = (δ/σ)√(n/2)

Two-sided power = P(T > t1−α/2,df) + P(T < −t1−α/2,df)

Required n = smallest integer for which Power ≥ target power

What the inputs mean

The two means define the anticipated difference under the alternative hypothesis. The common standard deviation is assumed to apply to both populations. The significance level controls the Type I error rate, while target power is the probability of rejecting the null hypothesis under the specified alternative. this method specifically notes that the assumed mean difference is the difference at which the study is powered; it does not mean that the study is guaranteed to demonstrate that exact difference.

Equal-variance assumption

The procedure assumes that the two populations are normally distributed and have the same variance. If unequal variances are expected, this method provides a separate unequal-variance procedure.

Exact noncentral-t calculation

Rather than using the common normal approximation n ≈ 2(z1−α/2 + zpower)2σ22, this implementation evaluates the noncentral-t distribution and searches integer values of n. This follows the power-calculation approach documented in the statistical literature, which uses the central-t critical value, the noncentrality parameter, and the noncentral-t distribution.

Validation example

This worked example

the relevant methodological literature gives a two-sided calculation with target power 0.90, equal group allocation, μ1 = 11, μ2 = 9, and common σ = 2. At α = 0.05, This yields 23 subjects per group, 46 total, with actual power 0.91250.

The implementation reproduces this result: n = 23 per group, actual power approximately 0.91250. The preceding value, n = 22, has power approximately 0.89971 and therefore does not meet the 0.90 target.

References

the software, LLC. (2024). this method Sample Size Software: Two-Sample T-Tests Assuming Equal Variance, Chapter 422. the software.com. The documentation describes the assumptions, noncentral-t power calculation, sample-size search, worked examples, and references used by the this method procedure.

View the this method procedure documentation

Chow, S. C., Shao, J., Wang, H., & Lokhnygina, Y. (2018). Sample Size Calculations in Clinical Research, 3rd ed. Taylor & Francis/CRC, Boca Raton, Florida. this method cites this text as a reference for its two-sample equal-variance t-test power calculations.

. The documentation identifies the corresponding design as the Two Sample Student's t-test (equal variances); its validation documentation describes the related two-group t-test methodology and checks against established sample-size references.

View documentation