- Introduced by
- A. R. Jonckheere and T. J. Terpstra
- Year
- 1952
- Type
- Nonparametric trend test
What does it do?
The Jonckheere-Terpstra test is a nonparametric hypothesis test for a monotone trend across k ordered groups.
It asks whether the outcome tends to rise (or fall) systematically as the group order increases. It is the ordered-alternative counterpart of the Kruskal-Wallis test, which detects differences among groups without regard to direction. The test is due to A. R. Jonckheere (1954).
The intuition behind the method
Imagine measuring pain relief across four dose levels: low, medium, high, and very high. You do not merely want to know whether any group differs from another — you want to confirm that relief increases monotonically with dose. The Jonckheere-Terpstra test captures exactly this by counting, for every pair of ordered groups, how often the higher-dose observations outrank the lower-dose ones. A consistently large count is evidence of a genuine upward trend rather than random variation.
History
The test is due to A. R. Jonckheere, whose 1954 Biometrika paper, A distribution-free k-sample test against ordered alternatives, introduced it. T. J. Terpstra's 1952 paper on Kendall's test against trend, when ties are present in one ranking, addresses a closely related problem.
When to use it
Choose the Jonckheere-Terpstra test when the groups have a meaningful natural order, such as dose levels, severity stages, or education tiers, and you have a directional hypothesis about the outcome across that order, stated before the data are inspected. The outcome may be continuous or ordinal. The test assumes that observations are independent within and between groups. Do not use it when the groups have no natural order, when the expected pattern is non-monotone, or when the ordering is chosen after looking at the data; in those cases Kruskal-Wallis is the appropriate omnibus alternative. The test is defined for k ≥ 2 ordered groups. With exactly two ordered groups the statistic reduces to a single Mann-Whitney count, so the Mann-Whitney U test is the more natural choice there. The test is most often applied with three or more groups.
Limitations and considerations
- The test detects only a monotone trend in the hypothesised direction. A one-sided test has essentially no power against a decrease when the alternative is an increase, and none against U-shaped or inverted-U patterns.
- The group ordering must be fixed before the data are inspected. A post hoc ordering invalidates the p-value.
- The z value relies on a large-sample normal approximation, which becomes less accurate when the total or per-group sample sizes are small. Confirm the minimum sample size for the approximation in the software documentation or a standard nonparametric text before relying on it.
- A significant result indicates an overall trend across all groups but does not show which adjacent groups differ, so pairwise follow-up is required.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- The statistic sums only the pairs of groups in the hypothesised direction (i < j), so its sensitivity is concentrated on a monotone increase. When the true pattern is such a trend, it can be more powerful than Kruskal-Wallis, which is sensitive to any departure from equality. This advantage does not hold for non-monotone patterns.
- The U_ij counts use only comparisons between observations, so the test makes no normality or equal-variance assumption and limits the influence of extreme values compared with a mean-based comparison.
- Because only the order of observations matters, the test applies to ordinal outcomes as well as continuous ones.
- A tied pair contributes one-half to U_ij, so the data do not need to be strictly ordered. The null variance of J must still be adjusted for ties, as described in the statistic step.
Applications
- Dose-response experiments in which the outcome is expected to change monotonically across ordered dose levels.
- Clinical staging, for example testing whether a biomarker or symptom score worsens from one disease stage to the next.
- Exposure studies with naturally ordered exposure categories, where the outcome is hypothesised to rise or fall with exposure.
- Ordinal rating studies, such as checking whether severity or agreement ratings shift across ordered treatment or age groups.
How it works
How it works
The null hypothesis states that all k group location parameters (written θ in the formula) are equal, so there is no difference among groups. The ordered alternative states that the parameters are non-decreasing across the ordered groups, with at least one strict increase. Because the alternative fixes a direction, the test is more focused than an omnibus test when that ordering is expected in advance.
Formula
H_0:\ \theta_1 = \theta_2 = \cdots = \theta_k \quad H_1:\ \theta_1 \leq \theta_2 \leq \cdots \leq \theta_k \text{ (at least one strict)}J is the sum of the pairwise counts U_ij over all pairs of groups with i < j. For each pair, U_ij counts the comparisons in which an observation from the higher-ordered group j exceeds an observation from the lower-ordered group i, and tied pairs contribute one-half. Under H₀ the standardised value z = (J − μ_J)/σ_J is referred to the standard normal distribution, as a large-sample approximation. μ_J and σ_J are the mean and standard deviation of J under H₀. They depend on the sample sizes and, when ties are present, on the tie structure, so the variance must be tie-corrected; statistical software applies this correction.
Formula
J = \sum_{i < j} U_{ij}, \quad U_{ij} = \sum_{s=1}^{n_i}\sum_{t=1}^{n_j} \mathbf{1}(x_{is} < x_{jt}) + \tfrac{1}{2}\mathbf{1}(x_{is} = x_{jt})The standardised statistic z is compared with the standard normal distribution. The tail must be fixed before the data are examined, because the alternative is directional. For a planned one-sided test in the hypothesised increasing direction at the 0.05 level, reject H₀ when z > 1.645. For a two-sided test at the same level, reject H₀ when |z| > 1.96. A two-sided test is appropriate only when a trend in either direction is scientifically plausible. In both cases the rejection rule is equivalent to a p-value below 0.05 for the chosen tail.
Formula
z = \dfrac{J - \mu_J}{\sigma_J} \sim N(0,1);\quad \text{reject } H_0 \text{ if } p < 0.05Common pitfalls
- Choosing the group order after seeing the group means. This turns a directional test into a data-driven one and inflates the false-positive rate.
- Changing between one-sided and two-sided versions after seeing the results, or using a two-sided test when a direction was planned, which lowers power without justification.
- Treating the test as an omnibus k-sample test. A non-significant result does not rule out a non-monotone difference among groups, for which Kruskal-Wallis should be considered.
- Reporting only that p is below 0.05 without a measure of trend strength. A descriptive measure such as Kendall's tau-b between the group index and the outcome, or the standardised J, conveys how large the trend is.
Frequently asked questions
How is this different from the Kruskal-Wallis test?
The Kruskal-Wallis test is an omnibus test that detects any difference among k groups, regardless of direction. The Jonckheere-Terpstra test specifically tests for a monotone ordered trend (group 1 ≤ group 2 ≤ ... ≤ group k). When the true pattern is a monotone trend, the Jonckheere-Terpstra test is more powerful; when the pattern is non-monotone or the ordering is unknown, Kruskal-Wallis is the right choice.
Does the group ordering have to be pre-specified?
Yes — this is essential. The Jonckheere-Terpstra test's directional alternative is only valid when the order of groups was defined before the data were examined. Choosing the ordering based on the observed group means inflates the false-positive rate and invalidates the p-value.
What should I do after the test is significant?
The test identifies an overall monotone trend but does not pinpoint where the trend is concentrated. Follow up with pairwise Mann-Whitney U tests between adjacent groups (applying a Bonferroni or Holm correction), or compute Kendall's tau-b between the group index and the outcome as a descriptive measure of trend strength.
Can I use this test with ordinal (Likert-scale) data?
Yes. The Jonckheere-Terpstra test operates on ranks and does not require interval-level measurement, so it is appropriate for ordinal outcome variables such as Likert scales, severity ratings, or ranked scores, provided the groups themselves are also ordered.
Related methods
Sources
Jonckheere, A. R. (1954). A distribution-free k-sample test against ordered alternatives. Biometrika, 41(1-2), 133–145.
Open DOI referenceTerpstra, T. J. (1952). The asymptotic normality and consistency of Kendall's test against trend, when ties are present in one ranking. Indagationes Mathematicae, 14, 327–333.
Open publication referenceHollander, M., Wolfe, D. A., & Chicken, E. (2014). Nonparametric Statistical Methods (3rd ed.). Wiley.
ISBN: 978-0470387375