I've been asked to provide a linear equation for a
lme4:lmer() model that I report in one paper.
I tried to adapt examples from http://rpsychologist.com/r-guide-longitudinal-lme-lmer but this is not my area of expertise and I would like to avoid any guesswork.
Given a repeated measurement experiment dataset where:
- A and B are 2-level factors fully balanced within-subjects
- C is a dichotomous (yes or no response) independent variable
- Y is the outcome
- The 3-way interaction within fixed effects is of main interest
How can I write down a regression style statistical equation for two
lmer() mixed-effects models where:
- random slopes are correlated
lmer(Y ~ A*B*C + (A*B*C | Subj), data)
- random slopes are uncorrelated due to convergence errors
lmer(Y ~ A*B*C + (A*B*C || Subj), data)
PS. Reproducible example of a dataset that simulates my real experiment is posted here: Compute partial η2 for all fixed effects anovas from a lme4 model