Method document
Sample size for Welch’s t-test
How many participants are needed in each of two independent groups to show that their means differ when the groups are expected to vary differently. Welch’s test does not pool the two standard deviations. Covers unequal allocation, a baseline covariate, clustering, non-adherence and dropout.
https://statwisely.com/methods/means-welch/
When to use it
- Two independent groups whose standard deviations are expected to differ, for example when a treatment makes responses more variable.
- Any two-group comparison where equal spread cannot be assumed; Welch’s test is the default two-sample test in much current practice.
Not for
- Groups with the same spread and equal sizes, where Student’s test needs the same sample and is simpler to describe.
Notation
- Participants in groups 1 and 2
- Allocation ratio n₂ / n₁
- Difference between the group means
- Standard deviations in groups 1 and 2
- Satterthwaite degrees of freedom
- Significance level: the chance of a false positive
- Power: the chance of detecting the effect if it is real
- Number of tails: 2 for a two-sided test, 1 for one-sided
- Correlation between the outcome and a baseline covariate
- Intracluster correlation coefficient (ICC)
- Average number of participants per cluster
- Coefficient of variation of cluster size
- Clusters per group
- Expected loss of whole clusters
- Share of the treatment arm not taking treatment, and of the control arm receiving it
- Expected dropout, overall or for each arm (q₁, q₂)
Formulas
The smallest n₁ with enough power
Welch’s test uses each group’s own variance in the standard error rather than pooling them [1], and its power is computed on the noncentral t distribution with the Satterthwaite degrees of freedom below.
Satterthwaite degrees of freedom
Fewer than n₁ + n₂ − 2 when the variances differ, which is the price of not assuming they are equal [2].
The most efficient allocation
Allocating in proportion to the standard deviations needs the fewest participants in total; the calculator reports it alongside the result.
Adjusting for a baseline covariate
Analysing with a baseline measurement as a covariate (ANCOVA) removes the share r_b² of the outcome’s variance the test would otherwise have to overcome. One participant per group is added back for the degree of freedom the covariate uses [3].
Clustering
When participants are recruited or randomised in clusters, observations within a cluster repeat information, and the sample is multiplied by the design effect. With equal clusters (CV = 0) this is 1 + (m − 1)ρ [4, 5].
Few clusters
Optional. A cluster trial is analysed on cluster-level summaries, so its critical values come from t on 2(C − 1) degrees of freedom rather than the normal distribution. With few clusters this costs participants; because C depends on the sample, it is iterated until it settles [6].
Non-adherence and crossover
An intention-to-treat analysis keeps everyone in the arm they were allocated to, so participants who do not receive their allocated treatment dilute the difference. Lachin’s correction restores the power [7].
All adjustments together
The adjustments multiply, in this order, and the result is rounded up once. Any adjustment not used contributes a factor of 1.
Dropout
Applied last, to the participants actually recruited. The rate can differ between the arms; when it does not, q₁ = q₂ = q.
Clusters to recruit
Per group. Losing a whole cluster loses every participant in it, so an expected loss of clusters inflates the clusters recruited rather than the participants.
Parameters
Difference to detect
Values: Not zero, in the measurement’s units
The smallest difference that would matter clinically or practically.
Standard deviation in group 1
Values: Above 0
From comparable studies or pilot data.
Standard deviation in group 2
Values: Above 0
From comparable studies or pilot data. If it equals σ₁, Student’s test is equivalent.
Significance level
Values: Between 0 and 1; usually 0.05
The false-positive rate you accept. A smaller α, for example to allow for several primary outcomes, needs a larger sample.
Power
Values: Between 0 and 1; usually 0.80 or 0.90
The chance of a significant result if the assumed effect is real. Funders and ethics committees commonly expect at least 0.80.
One- or two-sided
Values: 2 (two-sided) or 1 (one-sided)
Two-sided is the default. A one-sided test is justified only when an effect in the other direction would be treated exactly as no effect, and should be stated in advance.
Allocation ratioOptional
Values: Above 0; 1 for equal groups
The planned size of group 2 divided by group 1. σ₂ / σ₁ minimises the total.
Expected dropoutOptional
Values: 0% up to, but not including, 100%
The share of participants expected to provide no outcome, from comparable studies. Recruiting more restores the numbers, not the comparability of the groups: if dropout is related to the outcome, the estimate can still be biased.
Dropout in each armOptional
Values: 0% up to, but not including, 100%, for each arm
When dropout is expected to differ between arms, for example higher with an unpleasant treatment. Each arm is then inflated by its own rate.
Baseline correlationOptional
Values: Between −1 and 1
The correlation between the outcome and its baseline measurement, from previous data. Only use it if the analysis will adjust for the baseline.
Intracluster correlation (ICC)Optional
Values: From 0 to 1
For clustered designs only. Published ICCs for health outcomes in primary-care and community clusters are mostly small, often below 0.05 [8]; prefer an estimate from a comparable trial.
Average cluster sizeOptional
Values: At least 1
The average number of participants per cluster. Given with the ICC.
Variation in cluster sizeOptional
Values: 0 or more; 0 for equal clusters
The SD of cluster sizes divided by their mean. Unequal clusters cost power on their own account [5].
Expected loss of whole clustersOptional
Values: 0% up to, but not including, 100%
Clusters, such as practices or schools, expected to withdraw entirely.
Correction for few clustersOptional
Values: On or off
Worth applying when there are few clusters per group, roughly fewer than 15–20.
Non-adherence and crossoverOptional
Values: 0% up to, but not including, 100%; the two together below 100%
The share of the treatment arm expected not to take it, and of the control arm expected to receive it, from comparable trials.
Assumptions
- The groups are independent, and participants are independent apart from any clustering specified.
- The outcome is roughly normal in each group; the standard deviations may differ.
- With clustering: clusters are independent, with the same ICC throughout, and the analysis accounts for the clustering, for example with a mixed model or cluster-level summaries [4].
- Dropout is unrelated to the outcome; recruiting more participants restores the numbers but cannot remove bias.
- Non-adherence is corrected for an intention-to-treat analysis, with treatment received having its full effect and no effect otherwise.
Worked examples
Equal groups, unequal spread
Difference 5, SDs 10 and 15; α = 0.05 two-sided, 80% power: 104 per group, 208 in total, with about 179 Satterthwaite degrees of freedom.
Group 1: 104 · Group 2: 104 · Total: 208
Open this example in the calculatorProtocol statement
To detect a difference in means of 5 with 80% power at a two-sided significance level of 0.05, using Welch’s t-test, and assuming standard deviations of 10 and 15 in the two groups, the required sample size is 104 per group (208 in total). Calculated with StatWisely (statwisely.com) using: n₁: solve noncentral-t power with Var=s₁²/n₁+s₂²/n₂ and Satterthwaite degrees of freedom. These are planning estimates; confirm the final design with a qualified statistician.
Allocating by the standard deviations
With n₂ / n₁ = 15 / 10 = 1.5: 80 and 120, 200 in total, fewer than the 208 needed with equal groups.
Group 1: 80 · Group 2: 120 · Total: 200
Open this example in the calculatorValidation
- Every worked example on this page is recomputed by the StatWisely engine whenever the software is built. If a number or formula here stopped matching the calculator, the release would be stopped until this document was corrected.
- An independent implementation in R recomputes this test every night and before each production release, and the results are compared with the engine’s.
How to cite
StatWisely. Sample size for Welch’s t-test. Method document, engine version 1.0.0, reviewed 2026-10-01. https://statwisely.com/methods/means-welch/
Cite the original references for the formulas your design uses as well.
References
- 1.Welch BL. The generalization of “Student’s” problem when several different population variances are involved. Biometrika. 1947;34(1–2):28–35.
- 2.Satterthwaite FE. An approximate distribution of estimates of variance components. Biometrics Bulletin. 1946;2(6):110–114.
- 3.Borm GF, Fransen J, Lemmens WAJG. A simple sample size formula for analysis of covariance in randomized clinical trials. Journal of Clinical Epidemiology. 2007;60(12):1234–1238.
- 4.Donner A, Klar N. Design and Analysis of Cluster Randomization Trials in Health Research. London: Arnold; 2000.
- 5.Eldridge SM, Ashby D, Kerry S. Sample size for cluster randomized trials: effect of coefficient of variation of cluster size and analysis method. International Journal of Epidemiology. 2006;35(5):1292–1300. doi:10.1093/ije/dyl129
- 6.Hayes RJ, Moulton LH. Cluster Randomised Trials. 2nd ed. Boca Raton: CRC Press; 2017.
- 7.Lachin JM. Biostatistical Methods: The Assessment of Relative Risks. New York: John Wiley & Sons; 2000.
- 8.Adams G, Gulliford MC, Ukoumunne OC, Eldridge S, Chinn S, Campbell MJ. Patterns of intra-cluster correlation from primary care research to inform study design and analysis. Journal of Clinical Epidemiology. 2004;57(8):785–794. doi:10.1016/j.jclinepi.2003.12.013