# Two groups of ten measured at three times. Both groups start at the
# same place and rise over time, and group B rises twice as fast, so the
# data generating means differ in slope as well as in level.
set.seed(113)
n_per <- 10
d <- data.frame(
subject = factor(1:(2 * n_per)),
group = factor(rep(c("A", "B"), each = n_per)),
t1 = c(rnorm(n_per, 0, 1), rnorm(n_per, 0, 1)),
t2 = c(rnorm(n_per, 0.4, 1), rnorm(n_per, 0.8, 1)),
t3 = c(rnorm(n_per, 0.8, 1), rnorm(n_per, 1.6, 1))
)
# Rows are the between-subjects effect (labeled A), the within-subjects
# effect (labeled B), and their interaction, each with all four
# multivariate criteria, followed by a row recording the sum-of-squares
# type. The multivariate tests make no sphericity assumption, which is
# what recommends them over the univariate repeated measures F and its
# epsilon corrections.
manova_split_plot(d, within = c("t1", "t2", "t3"), between = "group")
Run the code above in your browser using DataLab