Skip to content

Testing for a trend across ordered groups

When doses or levels have an order, an omnibus test wastes it. Jonckheere–Terpstra, Cuzick, Chacko and Mack–Wolfe aim at the pattern you expect.

Advanced ~10 min8 steps

What runs in CodeSplash

You will be able to

  • Explain why a trend test has more power for an ordered alternative
  • Choose among Jonckheere–Terpstra, Cuzick and Chacko
  • Use Mack–Wolfe for a rise then fall, and handle an unknown peak

Read first

01

An omnibus test ignores your hypothesis

Read

Kruskal–Wallis gives the same answer however you shuffle the order of the groups. If you gave four increasing doses, that ignores the most important thing you know.

An ordered alternativeOrdered alternativeA hypothesis that groups rise or fall in a stated order, rather than merely differing somehow. states the pattern in advance:

H1: θ1≤θ2≤⋯≤θk,with at least one strict inequalityH_1:\ \theta_1 \le \theta_2 \le \dots \le \theta_k, \quad \text{with at least one strict inequality}

All its power goes to that pattern, so an order you only noticed afterwards can't be tested this way.

02

Predict the gain

Predict

Predict first

Four increasing doses are given to 33 subjects. The response rises gently. Which p-value is smaller: Kruskal–Wallis or a one-sided trend test?

The trend test's p-value is smallerThe omnibus p-value is smallerAbout the same
Reveal

The trend test's. Kruskal–Wallis gives p = .389, while Jonckheere–Terpstra gives p = .092 and Cuzick p = .060. Neither crosses 0.05 here, so this is modest evidence of a trend, not proof of one.

03

Three ways to test a trend

Read
TestHow it worksUse when
Jonckheere–TerpstraJonckheere–Terpstra testRank test for a monotone trend across ordered groups, built from Mann–Whitney counts for every pair of groups.Sums Mann–Whitney counts over all ordered pairs of groupsGroups are ordered, with no numeric dose
CuzickCuzick's trend testRank test for trend that multiplies pooled ranks by each group's score, so the scores may be unevenly spaced.Correlates ranks with group scoresDoses have numbers you want to respect
ChackoChacko's testA Kruskal–Wallis statistic with mean ranks forced to follow the stated order, using pooling of adjacent groups.Kruskal–Wallis after pooling groups that violate the orderYou want an order-restricted H

Jonckheere's statistic here is 243.5, z = 1.33, with concordance 0.60.

04

Run it

In the app

Set Alternative hypothesis to Increases across the group order, choose the Trend test, and drag the Group order list into your planned order. Use Use numeric group labels as doses for Cuzick.

The Code tab shows the same calculation in Python and R, using the app's helper functions.

05

A rise and a fall

Read

Some responses climb to a peak and then fall. The Mack–WolfeMack–Wolfe testRank test for an umbrella pattern, where groups rise to a peak and then fall. umbrella test combines an increasing test before the peak with a decreasing one after it.

With a known peak at level d3, z = 3.68, p < .001.

Choosing the peak from the data would cheat unless the test accounts for it. With an unknown peak, CodeSplash scans every candidate and calibrates by permutation: none of the 1,999 shuffles matched it, giving p < .001.

06

Mind the direction

Reflect

Chacko's test on one three-group example gives p = .002, close to its omnibus p = .002.

A one-sided trend test can only find what you pointed it at. A strong effect in the opposite direction would give a large p-value. If an opposite pattern would matter to you, is a one-sided trend test what you want, or should you plan both directions?

07

Check your understanding

Checkpoint

Check yourself

When is a trend test justified?

Show the answer

Answer: a

Choosing an order after seeing the means is a form of multiple testing. Without a planned order, the omnibus test is the honest one.

Check yourself

Doses of 0, 10, 20 and 80 mg were given, and you expect the response to follow the dose. Which test uses that spacing?

Show the answer

Answer: b

Cuzick correlates ranks with scores, so numeric doses count. Jonckheere–Terpstra uses only the order.

Check yourself

A response peaks at some dose you didn't specify in advance. Which is sound?

Show the answer

Answer: b

Using the data to choose the peak and then testing as if it had been known inflates the error rate.

08

Recap

Recap
  • If you planned an order, test that order; if not, use the omnibus test.
  • Jonckheere–Terpstra uses order, Cuzick uses dose values, Chacko restricts H, and Mack–Wolfe handles a peak.
  • Trend tests are one-sided, so they find only what you pointed them at.

Concepts in this lesson