LoslegenKostenlos loslegen

Repeated measures ANOVA

In the previous exercise, you saw how a paired t-test is more powerful than a regular t-test. During this exercise, you will see how statistical methods generalize. First, you will see how a paired t-test is a special case of a repeated measures ANOVA. In the process, you will see how a repeated measures ANOVA is a special case of a mixed-effects model by using lmer() in R.

The first part of this exercise will consist of transforming the simulated data from two vectors into a data.frame(). The second part will have you examine the model results to see how they are different. The third part will have you examine the outputs of the models and compare the results.

Diese Übung ist Teil des Kurses

Hierarchical and Mixed Effects Models in R

Kurs anzeigen

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Create the data.frame, using the variables from the previous exercise. 
# y is the joined vectors before and after.
# trial is the repeated names before and after, each one repeated n_ind
# ind is the letter of the individual, repeated 2 times (because there were two observations)
dat <- data.frame(y = c(___, ___), 
                  trial = rep(c("before", "after"), each = ___),
                  ind = rep(letters[1:n_ind], times = ___))
Code bearbeiten und ausführen