Skip to content

Jonckheere-Terpstra Trend Test

Test whether outcomes increase (or decrease) consistently across three or more ordered groups, such as increasing dose levels or ordered experience categories, using the declared order you supply, never an order inferred from labels.

List groups in the order you expect the trend to run, from lowest to highest.

What this answers

This test answers "do outcomes tend to increase (or decrease) consistently as we move through a meaningful, ordered sequence of groups?" rather than just "do these groups differ at all," which is the more general question the Kruskal-Wallis test answers without using any order information.

How it is calculated

For every pair of groups where one comes later in your declared order than the other, this calculator counts how many cross-group value comparisons favor the expected increasing direction (a later group's value exceeding an earlier group's value), with ties counted as half a point each. The J statistic sums these counts across every such pair. Its significance is judged against a normal approximation using J's known mean and variance under the null hypothesis of no trend; this calculator's variance formula does not include the additional tie-correction term some references add, a documented simplification.

Worked example

For three groups of 1, 2, then 3, 4, then 5, 6 supplied in that increasing order, every single cross-group comparison favors the expected direction (every later group's values exceed every earlier group's values), giving J equal to the maximum possible value of 12 and a small p-value, strong evidence of the expected increasing trend.

Assumption audit

Calculated from your data: the J statistic from every ordered cross-group comparison, and its z score and p-value from the normal approximation.
Evidence to review: whether the trend, if significant, looks monotonic across every group transition or is driven mainly by one or two extreme groups; this omnibus statistic does not distinguish those patterns on its own.
You must verify: that the order you entered the groups in reflects a real, meaningful, a-priori ordering (such as dose level or time), not a convenient or alphabetical arrangement chosen after seeing the data.

What this result does not mean

A significant trend test means the data are more consistent with a monotonic ordering than chance would predict, not that the relationship is linear, and not that every adjacent pair of groups differs significantly on its own. It also assumes your declared order is substantively correct; testing every possible ordering after the fact and reporting only the significant one would invalidate the result entirely.

Limitations

The p-value approximation here is unadjusted for ties, a documented simplification that can make the reported p-value slightly optimistic when your data contains many tied values across groups; treat results with heavy tying as approximate.