[R-sig-ME] Fw: Unbalanced Nested Models with Heteroscedastic Errors

Reinstein, Ilan Il@n@Rein@tein @ending from nyul@ngone@org
Tue Dec 18 21:21:38 CET 2018

I sent the previous message as a non-member. I have signed up to the list so hopefully I can get an answer.

Thanks again for your time.

From: Reinstein, Ilan
Sent: Tuesday, December 18, 2018 12:06 PM
To: r-sig-mixed-models using r-project.org
Subject: Unbalanced Nested Models with Heteroscedastic Errors


I am trying to model a multilevel structure of items (questions in a test) of different classes or types. Specifically, each of the items belongs to a particular class and the classes are mutually exclusive and the number of items by class is different. I want to avoid adding a a fixed effect to each class as I would like to see: first, the variation of classes around the intercept or grand mean, and second, the variation of items within each class but centered around the class mean and not the grand mean/intercept.

I have fitted several models like so:

~ 1 + (1|class/item)

This model returns an intercept and two random effects for class and items respectively, although both are centered around the intercept. I need one variance term by class to understand the within-class variability.

The second model that seems to help is:

 ~ 1 + class + (1 + class|item)

I have variances by class but the random effects for items are still centered around zero and one of the classes is now the reference/intercept (not an issue).

The last model is the one that seems to work best for my needs, however, I do need the variance of each class to be centered around the corresponding fixed effect and not zero, as it appears to be happening. Also, this model is considering crossed effects rather than nested. I may be willing to sacrifice the nesting as long as I can get variances for each class centered around their mean.

Ideally, I would like to get both a variance of class around an overall grand mean intercept, as well as variances for each of the classes informed only by those items that belong to that class.

 - Is this possible to fit in lme4?

 - Am I extracting the coefficients correctly? I am using ranef() and that is where I note the random effects by class are centered around zero. However, when using coef() the average value of the REs for each class is equal to the fixed effect, but I am not sure this is the result I need and if I can say those numbers are random effects rather than the FE + RE value.

- I understand I may not have enough items by class to get a reliable estimate of the variance around the fixed effect but as a theoretical model and our context it is not critical since we expect to gather enough data in the future.


 - The response variable is binary so I am using glmer with binomial link.

 - The modeling context is very similar to the LLTM with heteroscedastic error from IRT, which I have previously modeled as

~  -1 + class + (-1 + class|item) + (1|person)

Thank you in advance for your time, I appreciate any insight

Kind regards,

Ilan Reinstein

This email message, including any attachments, is for th...{{dropped:14}}

More information about the R-sig-mixed-models mailing list