Jonckheere–Terpstra Test with Three Ordered Groups
2026-11-26

Jonckheere–Terpstra Test with Three Ordered Groups

When independent test groups represent ordered settings, the comparison can look for observations that tend to rise along that declared order. The Jonckheere–Terpstra test summarizes the numbers of cross-group comparisons pointing in one direction. A six-observation example gives a statistic that can be counted by hand and an exact reference distribution that can be enumerated. The group order comes from the experimental question, so it is set before looking at the observed values.

Choose a one-sided ordered alternative before counting

Imagine three independently sampled groups labeled low, middle and high, with two observations in each. The invented values are (1, 3) at low, (2, 6) at middle and (5, 7) at high. The alternative is that later groups tend toward higher outcomes. The null used for the exact calculation is that the groups have identical outcome distributions and the observations are exchangeable between labels under that null. A record measured repeatedly in all three settings would have a different sampling structure.

For each comparison, take one observation from an earlier group and one from a later group. Count one point if the later observation is greater. This example has no ties, so a smaller later observation contributes zero. Comparisons within a group do not enter the statistic. The result depends on the ordering of the group labels and the relative ordering of the values, so it does not measure how many units the outcome changes.

Tally the three sets of cross-group pairs

Low against middle gives four comparisons. The low value one is below both middle values. The low value three is below six and above two. These make three increasing pairs out of four. Low against high gives four, because both low values are below both high values. Middle against high gives three: middle value two is below five and seven, and middle value six is below seven and above five.

Add the three blocks to get a Jonckheere–Terpstra statistic of 3 + 4 + 3 = 10. The maximum is twelve here because each of the three unordered group pairs provides four comparisons, with a fixed earlier-to-later direction. The score of ten allows two comparisons pointing the other way. A series of group averages could rise even if many individual pairs were out of order, so the three means alone would not recover this count.

The three blocks yield 3, 4 and 3 increasing pairs.
For each pair, compare the row value with the column value. Source: Zhilianhai editorial desk, original AI-assisted conceptual illustration.

Enumerate the reference distribution with fixed group sizes

Pool the six observed values and assign two to the low group, two of the remaining four to the middle group and the final two to the high group. There are fifteen choices for the first group and six for the second, giving ninety distinct allocations. Order within a group has no influence on the score. Counting unique allocations makes each outcome equally weighted under exchangeability, without counting internal reorderings as additional evidence.

For example, allocating the two smallest observations (1, 2) to low, (3, 5) to middle and (6, 7) to high gives the maximum score of twelve. Swapping the low and high groups produces the minimum score of zero, while holding the middle group fixed. The complete distribution has five allocations at score ten, two at eleven and one at twelve. The exact upper tail includes the observed statistic, so the probability is (5 + 2 + 1)/90, or about 0.0889.

Scores 10, 11 and 12 have 5, 2 and 1 assignments in the exact enumeration.
The observed score is 10, so all eight orange cases contribute to the upper tail. Source: Zhilianhai editorial desk, original AI-assisted conceptual illustration.

Read the tail with the declared statistic and direction

This is the fraction of allocations at least as favorable to the prespecified increasing alternative as the observed one. It is not a probability that the null is true or that any particular pair of groups changes by a certain amount. With the distinct values here, reversing the group order sends every score J to twelve minus J. That symmetry provides a check on enumeration. Using a program that counts the opposite comparison direction can therefore give the complementary raw count with the same inferential result when the corresponding tail is used.

A worksheet can keep the six original values, the ordered label sequence, the three block counts and the denominator for the exact calculation. Larger examples may use a computationally efficient exact distribution or a random approximation. A report should identify which one it used. If observations tie, the convention for ties and the reference distribution require their own checks. The deliberately distinct values here avoid that extra step. Related reading is available in the site's technical articles and industry resources.

As a second check, adding ten to every reading preserves every inequality, both in the observed groups and in every reassignment. The score and its exact tail probability therefore stay the same. The same rule applies to any strictly increasing transformation that leaves distinct values distinct.

Sources include NIST Dataplot’s statement of the ordered alternative and the original clinfun exact distribution and tail implementation.

18028484626 CONTACT US

公司:智联海(惠州)科技有限公司

地址:惠州仲恺高新区陈江街道白云山工业大道 5 号六楼 601

Q Q:18028484626

Copyright © 2002-2026

粤xxx

咨询 在线留言 电话:18028484626
微信 微信扫码添加我