```
set.seed(1234)
g <- ordered(rep(1:5, rep(10,5)))
x <- rnorm(50) + 0.3 * as.numeric(g)
JonckheereTerpstraTest(x, g)
x[1:2] <- mean(x[1:2]) # tied data
JonckheereTerpstraTest(x, g)
JonckheereTerpstraTest(x, g, nperm=5000)
# Duller, S. 222
coffee <- list(
c_4=c(447,396,383,410),
c_2=c(438,521,468,391,504,472),
c_0=c(513,543,506,489,407))
# the list interface:
JonckheereTerpstraTest(coffee)
# the formula interface
breaking <- data.frame(
speed=c(20,25,25,25,25,30,30,30,35,35),
distance=c(48,33,59,48,56,60,101,67,85,107))
JonckheereTerpstraTest(distance ~ speed, breaking, alternative="increasing")
```

Run the code above in your browser using DataLab