Method document
Sample size for a Jonckheere–Terpstra trend test of an ordinal outcome
How many participants are needed to show that an ordinal outcome rises or falls across three or more ordered groups, such as doses, from the expected probability of each category in each group. Allows for ties and unequal groups. Covers dropout.
https://statwisely.com/methods/nonparametric-jonckheere-terpstra/
When to use it
- An ordered outcome, such as a severity grade, compared across ordered groups, when the question is a trend.
Not for
- Unordered groups, or any difference rather than a trend. Use the Kruskal–Wallis test.
- A binary outcome. Use the Cochran–Armitage test for trend.
Notation
- Total number of participants
- Participants in ordered group i
- Probability that an observation in later group j exceeds one in earlier group i, ties counting half
- Expected number of participants in outcome category c
- The Jonckheere–Terpstra statistic
- 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
- Expected dropout
Formulas
How far the trend moves the statistic
J counts, over every pair of groups, how often the later group’s observation is the higher [1].
Power from the tie-corrected null variance
Var₀(J) is Hollander and Wolfe’s null variance corrected for ties, evaluated at the expected category counts t_c [2]. With two-sided tests the opposite tail is added. The first group gets the smallest whole number reaching the power, and every other group that number times its relative size.
Dropout
Applied last, to the participants actually recruited.
Parameters
Expected category probabilities in each ordered group
Values: At least three groups in trend order, with the same ordered categories; each adds to 1
The smallest trend worth detecting, as the share of each group in each category.
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.
Assumptions
- Participants are independent, each in exactly one group, and both the groups and the outcome categories are ordered.
- The null variance is used throughout, as in Noether’s formulas [3].
- Dropout is unrelated to the outcome; recruiting more participants restores the numbers but cannot remove bias.
Worked examples
Three ordered groups, four categories
The same groups as the Kruskal–Wallis example, tested for a trend: 135 per group, N = 405, against 164 per group for Kruskal–Wallis.
135 per group · Total: 405
Open this example in the calculatorProtocol statement
To detect the expected distributions of the outcome categories in each group with 80% power at a two-sided significance level of 0.05, using a Jonckheere–Terpstra trend test of an ordinal outcome across 3 ordered groups, the required sample size is 135 per group (405 in total, across 3 groups). Calculated with StatWisely (statwisely.com) using: N: normal power of J=Σᵢ<ⱼUᵢⱼ, E(J)-E₀(J)=Σnᵢnⱼ(θᵢⱼ-½), tie-corrected Var₀(J). These are planning estimates; confirm the final design with a qualified statistician.
Only an increasing trend matters
One-sided: 107 per group, N = 321.
107 per group · Total: 321
Open this example in the calculatorTwice as many in the first group
Allocating 2 : 1 : 1: 208 in the first group and 104 in each of the others.
group1: 208 · group2: 104 · group3: 104 · Total: 416
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.
- Simulating the tie-corrected Jonckheere–Terpstra test in R, 4,000 trials at each planned size gave power of 0.816 (two-sided), 0.807 (one-sided), 0.808 (2 : 1 : 1) and 0.817 (two categories), against a target of 0.80, and a type I error of 0.049 when the groups did not differ.
How to cite
StatWisely. Sample size for a Jonckheere–Terpstra trend test of an ordinal outcome. Method document, engine version 1.0.0, reviewed 2026-10-04. https://statwisely.com/methods/nonparametric-jonckheere-terpstra/
Cite the original references for the formulas your design uses as well.
References
- 1.Jonckheere AR. A distribution-free k-sample test against ordered alternatives. Biometrika. 1954;41(1–2):133–145. doi:10.1093/biomet/41.1-2.133
- 2.Hollander M, Wolfe DA. Nonparametric Statistical Methods. 2nd ed. New York: John Wiley & Sons; 1999.
- 3.Noether GE. Sample size determination for some common nonparametric tests. Journal of the American Statistical Association. 1987;82(398):645–647.