Method document
Sample size for the Cochran–Armitage test for trend
How many participants are needed to show that the probability of a binary outcome rises or falls across three or more ordered groups, such as doses or exposure levels, from the expected proportion in each group, the groups’ scores, and their relative sizes. Covers clustering and dropout.
https://statwisely.com/methods/proportions-trend/
When to use it
- A dose-response study or an ordered exposure (none, low, medium, high) with a yes/no outcome, where the question is whether the outcome becomes more or less likely as the exposure increases.
Not for
- Two groups. Compare the two proportions.
- Unordered groups, or any difference between groups rather than a trend. Use the chi-square test of independence.
- A pattern expected to rise and then fall. A linear trend test can miss it entirely.
Notation
- Number of ordered groups
- Participants in group i
- Outcome probability in group i
- Score of group i, such as its dose
- Size-weighted mean score and outcome probability
- The trend statistic, Σ xᵢ(dᵢ − d̄), where xᵢ is the number of outcomes in group i
- 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
- Intracluster correlation coefficient (ICC)
- Average number of participants per cluster
- Coefficient of variation of cluster size
- Clusters per group
- Expected loss of whole clusters
- Expected dropout
Formulas
The trend statistic under the null and the alternative
V₀ is the variance of U when every group shares one probability, V₁ its variance under the expected proportions [2, 1].
The smallest group sizes with enough power
s is 1 for a one-sided test and 2 for a two-sided one. The first group gets the smallest whole number of participants reaching the power, and every other group that number times its relative size. No continuity correction is applied [1].
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].
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.
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
Expected proportion in each group
Values: At least three, each between 0 and 1, from the lowest group to the highest
The smallest trend worth detecting, written as the proportion expected in each ordered group.
Group scoresOptional
Values: One per group, increasing; equally spaced if omitted
The dose or exposure level of each group. Only the spacing matters, so 1, 2, 3 and 10, 20, 30 give the same size.
Relative group sizesOptional
Values: One per group, each above 0; equal if omitted
How many participants each group gets relative to the others.
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.
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.
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 [7]; 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.
Assumptions
- Participants are independent apart from any clustering specified, each in exactly one group.
- The proportions change roughly monotonically across the groups; the test has power against a linear trend in the scores.
- 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.
Worked examples
Three doses
Success rates of 80%, 85% and 90% at one, two and three doses a day; two-sided α = 0.05, 80% power: 199 per group, N = 597.
199 per group · Total: 597
Open this example in the calculatorProtocol statement
To detect outcome proportions of 80%, 85%, 90% across the groups with 80% power at a two-sided significance level of 0.05, using a Cochran–Armitage test for trend across 3 ordered groups, the required sample size is 199 per group (597 in total, across 3 groups). Calculated with StatWisely (statwisely.com) using: Nam: solve power of U=Σxᵢ(dᵢ-d̄), Var₀=p̄q̄Σnᵢ(dᵢ-d̄)², Var₁=Σnᵢpᵢqᵢ(dᵢ-d̄)². These are planning estimates; confirm the final design with a qualified statistician.
Only an increasing trend matters
The same rates with a one-sided test: 157 per group, N = 471.
157 per group · Total: 471
Open this example in the calculatorTwice as many at the lowest dose
Allocating 2 : 1 : 1: 300 at one dose a day and 150 at each of the others, N = 600.
group1: 300 · group2: 150 · group3: 150 · Total: 600
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.
- StatWisely reproduces the four worked examples of Stata’s power trend command, which implements the same method: 597 for the three doses, 471 one-sided, 600 with 2 : 1 : 1 allocation, and 1,030 for five unequally spaced exposures [3]. Simulating the test itself at those sizes gives power of 0.80 to 0.81.
How to cite
StatWisely. Sample size for the Cochran–Armitage test for trend. Method document, engine version 1.0.0, reviewed 2026-10-04. https://statwisely.com/methods/proportions-trend/
Cite the original references for the formulas your design uses as well.
References
- 1.Nam JM. A simple approximation for calculating sample sizes for detecting linear trend in proportions. Biometrics. 1987;43(3):701–705. doi:10.2307/2531969
- 2.Armitage P. Tests for linear trends in proportions and frequencies. Biometrics. 1955;11(3):375–386. doi:10.2307/3001775
- 3.StataCorp. Stata Power, Precision, and Sample-Size Reference Manual, Release 19: power trend. College Station, TX: Stata Press; 2025.
- 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.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