Jonckheere-Terpstra Test
The Jonckheere-Terpstra test is a non-parametric test for a monotonic trend across three or more ordered groups. A monotonic trend means the response tends to rise, or tends to fall, as you move from the lowest group to the highest. In toxcore it answers "does the effect increase with dose?".
It differs from the Kruskal-Wallis test, which only asks whether the groups differ in some way. Because the Jonckheere-Terpstra test uses the order of the groups, it is more powerful when a dose-related trend is expected.
- Steps
Load the dataset -> Go to ToxCore -> Jonckheere-Terpstra Test -> Move the numeric response to Response Variable -> Move the dose or group variable to Ordered Grouping Variable -> Set the group order and the trend direction -> Execute the dialog.

Video walkthrough
Video walkthrough coming soon.
Data requirements
One row per observation (long format), with a numeric response column and a group column.
The grouping variable must have at least 3 levels that have a natural order, for example doses 0, 10, 30, 100 or Control, Low, Medium, High.
Rows with a missing response or missing group are left out.
Dialog options
- Enter Result Name
A name for this analysis (default
JonckheereTerpstra1).- Response Variable (numeric)
The measured outcome.
- Ordered Grouping Variable (≥3 levels)
The dose or group variable.
- Group Level Ordering
numeric_ascending (default): sorts the groups by numeric value (0 < 10 < 30 < 100). Use it for numeric dose columns. If the labels are not numbers, alphabetical order is used.
alphabetical: sorts the group labels A to Z.
- Custom Level Order
Optional. Type the group labels from lowest to highest, separated by commas, for example
Control,Low,Medium,High. When filled in, it overrides Group Level Ordering. Use it when text labels do not sort correctly on their own.- Alternative Hypothesis (Trend Direction)
two.sided (default): a trend in either direction.
increasing: the response increases from the lowest to the highest group.
decreasing: the response decreases from the lowest to the highest group.
- Use Exact Permutation Test
When checked, the exact p-value is calculated. This is recommended for fewer than 100 observations; with tied values or larger samples a normal approximation is used instead. When unchecked, the p-value is estimated from random permutations.
- Number of Permutations (if not exact)
Number of random permutations used when the exact test is not selected (default 1000).
- Show Descriptive Statistics by Group
Shows N, median, mean and standard deviation for each group in the order used by the test. On by default.
Output
- Descriptive Statistics by Ordered Group
Group, N, Median, Mean and SD, listed from the lowest to the highest group.
- Statistic / Value
The Jonckheere-Terpstra (JT) statistic.
- p_value
p-value for the chosen trend direction. A small value (for example below 0.05) means there is a significant trend.
- Alternative
The trend direction that was tested.
- Method
Exact permutation, or approximate with the number of permutations.
- Ordered groups (low → high)
The order the test used. Always check this line.
R function used: DescTools::JonckheereTerpstraTest(). R package required: DescTools.