[R-sig-ME] Complex Error terms With Non-nested Error Structure
tkelleykemple @ending from g@h@rv@rd@edu
Thu Jan 10 23:38:04 CET 2019
I'm trying to fit a model that has observations of scores, cross nested
within students and test items, (eg 10 students each answer 6 test items),
that then get scored on 2 dimensions. There are person and item random
effects, but the dimension effects are fixed (in the sense that these are
the exact two dimensions we care about; they aren't drawn from a wider
population of ways to evaluate the scores). I can write the code to get the
random effects for persons and items within each dimension (as well as the
covariances across dimensions), but am having trouble getting the syntax
right for separate residuals for each level of the fixed effects.
Ideally, I would have an estimate of the variance of the residuals for each
of the two dimensions, as well has how those residuals co-vary across those
two dimensions (ie. for a given person/item combination, how do the two
scores covary across the dimensions).
To get the main part of the model I can write:
lmer(score ~ 1 + (-1+v1+v2| p) + (-1+v1+v2| i ), data=data)
Here p is a factor indexing persons, i is a factor indexing items, and v1
and v2 are the dummies for the two score dimensions.
However, I can't figure out how to get the complex error structure in lmer.
I've looked into nmle and somewhat figured out the hack suggested to get
crossed random effects (nest them within a dummy random effect), but
haven't had much success there either. I'm open to suggestions either in
lmer or other packages.
Thanks in advance for any help!
[[alternative HTML version deleted]]
More information about the R-sig-mixed-models