1. Learn
  2. /
  3. Courses
  4. /
  5. Hierarchical and Mixed Effects Models in R

Connected

Exercise

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.

Instructions 1/3

undefined XP
    1
    2
    3
  • Create the data.frame() dat:
    • y is the combined vector before and after, which have all been loaded for you.
    • trial is the repeated vector "before" and "after", each one repeated n_ind.
    • ind is the individual ID vector, repeated 2 times because there were two observations.