df <- sim_design(between = list(time = 1:6), plot = FALSE) %>%
add_contrast("time", "poly")
# test all polynomial contrasts
lm(y ~ time, df) %>% broom::tidy()
# test only the linear and quadratic contrasts
lm(y ~ `time^1` + `time^2`, df) %>% broom::tidy()
Run the code above in your browser using DataLab