Linked Questions

233 votes
3 answers
198k views

R's lmer cheat sheet

There's a lot of discussion going on on this forum about the proper way to specify various hierarchical models using lmer. I thought it would be great to have all ...
26 votes
2 answers
23k views

Why do lme and aov return different results for repeated measures ANOVA in R?

I am trying to move from using the ez package to lme for repeated measures ANOVA (as I hope I will be able to use custom ...
Henrik's user avatar
  • 14.4k
28 votes
2 answers
5k views

Does it make sense for a fixed effect to be nested within a random one, or how to code repeated measures in R (aov and lmer)?

I have been looking through this overview of lm/lmer R formulas by @conjugateprior and got confused by the following entry: Now assume A is random, but B is fixed and B is nested within A. ...
amoeba's user avatar
  • 107k
14 votes
2 answers
7k views

What is the lme4::lmer equivalent of a three-way repeated measures ANOVA?

My question is based on this response which showed which lme4::lmer model corresponds to a two-way repeated measures ANOVA: ...
Henrik's user avatar
  • 14.4k
7 votes
1 answer
8k views

Is there a way to specify a lme model with more than one within-subjects factor?

The data Suppose we have a dataset d with two between-subject factors (i.e., groups), group and ...
Henrik's user avatar
  • 14.4k
1 vote
1 answer
2k views

Specifying mixed-linear model in lme() for pre-/post-treatment design

Dear crossvalidated community! I am analyzing a data of a study in which every participant's performance in a memory task was measured twice (once under placebo, once under drug treatment in random ...
jokel's user avatar
  • 2,793
4 votes
1 answer
2k views

Two-way mixed effects ANOVA model

Consider the two-way ANOVA model with mixed effects : $$ Y_{i,j,k} = \underset{M_{i,j}}{\underbrace{\mu + \alpha_i + B_j + C_{i,j}}} + \epsilon_{i,j,k}, $$ with $\textbf{(1)}$ : $\sum \alpha_i = 0$...
Stéphane Laurent's user avatar
2 votes
1 answer
2k views

r - 2-way Repeated Measures ANOVA - different degree of freedom among ezAnova, aov and lme [closed]

I would like to run a simple repeated measures ANOVA with 2 factors (Food & Drink). Let's have a dummy df: ...
Not Sure's user avatar
3 votes
0 answers
1k views

Repeated measures on split plot design with blocking

This is the first time I'm posting a question here. I have regularly been using the questions and answers here as example solutions for my problems, and searching has always helped me figure things ...
XiaoFo's user avatar
  • 31
4 votes
0 answers
221 views

Syntax differences between aov and lmer for two-way repeated measures design

I'm working with the following data frame using R. It consists of measurements obtained from 7 subjects with two independent variables (IV1 and ...
user3050269's user avatar
2 votes
0 answers
112 views

Which random effects should be included in my mixed-effect model? Repeated measures design with 3 within-subject factors

I am considering a design where the dependent variable ('DV') is measured in each subject ('Sub') for each level of three factors ('TH', 'A', and 'B'). From what I understand this is a repeated ...
ongoingActivity's user avatar