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.
What runs in CodeSplash
- STAT028Jonckheere–Terpstra test Runs in CodeSplash
- STAT029Cuzick trend test Runs in CodeSplash
- STAT030Mack–Wolfe umbrella test Runs in CodeSplash
- STAT031Chacko order restricted test Runs in CodeSplash
- Kruskal–Wallis test Verified in Python and R
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
An omnibus test ignores your hypothesis
ReadKruskal–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:
All its power goes to that pattern, so an order you only noticed afterwards can't be tested this way.
Predict the gain
PredictPredict 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?
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.
Three ways to test a trend
Read| Test | How it works | Use 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 groups | Groups 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 scores | Doses 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 order | You want an order-restricted H |
Jonckheere's statistic here is 243.5, z = 1.33, with concordance 0.60.
Run it
In the appSet 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.
A rise and a fall
ReadSome 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.
Mind the direction
ReflectChacko'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?
Check your understanding
CheckpointCheck 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.
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