uoepsy / msmr

Multivariate Statistics & Methodolgy in R
https://uoepsy.github.io/msmr/
1 stars 0 forks source link

lab 4 2019/20 #1

Closed josiahpjking closed 1 month ago

josiahpjking commented 4 years ago

See email from student - example maximal models used in lab don't include an interaction term in the random effects.

email below

In the lab 4 of multivariate R course, we got exercise 2 and exercise 3. In the example of exercise 2, items are labelled as Test_word. Obviously, all items have appeared in both Delay test (min and week) and both test groups (StudyStudy and StudyTest). In the fixed effect model, interaction term Delay:Group was included in DelayGroup. My question is why the interaction term was not included in the maximal random model of by-item analysis? As a result the structure of the full model should be (the changed part was marked red): m <- glmer(Correct ~ DelayGroup + (1 + Delay | Subject_ID) + (1 + Delay Group | Test_word), data=tel, family="binomial", glmerControl(optimizer = "bobyqa")) The same question is also asked about the maximal model of exercise 3. All the 5 therapists have treated patients from both groups across all sessions. Why the interaction term and the main effect group term were only included in the fixed effect structure but not in the maximal random model of by-item analysis? As a result the structure of the full model should be (the changed part was marked red): m1 <- lmer(Score ~ session group + (1 + session | PID) + (1 + session * group | therapist), data=tx, REML=FALSE) In general, when the interaction term should be included in the maximal random effect structure when we shouldn't?

Another quite related but also unrelated question is, as mentioned above, we have 175 items as Test-word in exercise 2 and 5 items as therapists in exercise 3, what if in my own data, there are only 2 different items (2 words yellow and red in Chinese as experimental materials)? Is it worth a by-item analysis? There is no theoretical background suggesting that they should exert different effect. And they have almost equal lexical characteristics. What worries me is that by-item analysis would be accompanied by very very long random effect structure resulting in very tricky convergence issues, which also occurred in the two exercise examples shown above.

dmirman commented 3 years ago

Re exercise 2: student is correct that I didn't start with the full model, which was just because I was sure it wouldn't converge. For the purposes of practice simplifying random effects, it'll be good to start with the actual full model, then move to the no-interaction one, then continue simplifying until model converges.

Similar problem for exercise 3: properly full random effects structure is an over-parameterized model and has a pretty bad convergence failure. But for pedagogical purposes, maybe it makes sense to start there and make that explicit before simplifying to a more sensible model.

Re small number of items: with only 2 items, I'd suggest treating them as fixed effects and testing whether there are any differences between them (main effects and interactions) and use treat them as control/adjustment variables. If they do not have any substantive effects, could also drop them from the model entirely, though there is some disagreement about whether this is better than leaving them.