July 30, 2018 at 18:30 GMT+0000 #297blazko m. (b1azk0)Participant
I know I’ve been a pain recently but this is most likely my last question.
As before I already posted it on CV with no luck: linear-mixed-effects-model-equation[…]
I’ve been asked to provide a linear equation for a
mixed()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 linear equation for two
mixed()mixed-effects models where:
1. random slopes are correlated
mixed(Y ~ A*B*C + (A*B*C | Subj), data)
2. random slopes are uncorrelated due to convergence errors
mixed(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]
July 31, 2018 at 13:31 GMT+0000 #298henrikKeymaster
Expand Random Effects
expand_re = TRUEallows to expand the random effects structure before passing it to
lmer. This allows to disable estimation of correlation among random effects for random effects term containing factors using the
||notation which may aid in achieving model convergence (see Bates et al., 2015). This is achieved by first creating a model matrix for each random effects term individually, rename and append the so created columns to the data that will be fitted, replace the actual random effects term with the so created variables (concatenated with
+), and then fit the model. The variables are renamed by prepending all variables with
iis the number of the random effects term) and replacing
mixed(Y ~ A*B*C + (A*B*C || Subj), data, expand_re = TRUE)
July 31, 2018 at 13:49 GMT+0000 #299blazko m. (b1azk0)Participant
Henrik I know that… that’s my 2nd model.
I m interested in a mathematical (statistcal?) equation for these two models.
- You must be logged in to reply to this topic.