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

Ryan Simmons ry@n@@immon@ @ending from duke@edu
Wed Dec 19 15:52:50 CET 2018


Hi Ilan,

Could you clarify what you mean by "the random effects by class are centered around zero" and/or provide the code you are using to make this evaluation? It's hard to tell right now whether your issue is a coding one or a conceptual one. 

Random effects are, by definition, random variables with mean 0, and are often interpreted as the class-specific deviations from the grand mean. That is, if you just look at the random effect itself, of course it will be centered around zero, that's how it is defined in the model. The (conditional) mean for class j from the model would be calculated as something like: Intercept + Fixed-Effect for Class j + Random-Effect for Class j. There's nothing pathological about the random-effect term for a class in isolation being centered around 0, indeed that's exactly what you expect to see. 

Regards,

Ryan Simmons
Department of Biostatistics and Bioinformatics
Duke University
Durham, NC 27710
(919) 681-2567

-----Original Message-----
From: R-sig-mixed-models [mailto:r-sig-mixed-models-bounces using r-project.org] On Behalf Of r-sig-mixed-models-request using r-project.org
Sent: Wednesday, December 19, 2018 6:03 AM
To: r-sig-mixed-models using r-project.org
Subject: R-sig-mixed-models Digest, Vol 144, Issue 21

Send R-sig-mixed-models mailing list submissions to
	r-sig-mixed-models using r-project.org

To subscribe or unsubscribe via the World Wide Web, visit
	https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_r-2Dsig-2Dmixed-2Dmodels&d=DwICAg&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=szMipnZzQMIctqnszKsX-AUNBHtRn663-NaJh5_rHBE&m=hBvCaNGt_bk-s68BkfzjQ0IeU_UHl1q7w22Gi1IaYZY&s=ZNUPRM1S5yri6v5VDxxdjyTf_QDtZQF-x9GrHWHl5Fs&e=
or, via email, send a message with subject or body 'help' to
	r-sig-mixed-models-request using r-project.org

You can reach the person managing the list at
	r-sig-mixed-models-owner using r-project.org

When replying, please edit your Subject line so it is more specific than "Re: Contents of R-sig-mixed-models digest..."


Today's Topics:

   1. Fw: Unbalanced Nested Models with Heteroscedastic Errors
      (Reinstein, Ilan)
   2. Unbalanced Nested Models with Heteroscedastic Errors
      (Reinstein, Ilan)

----------------------------------------------------------------------

Message: 1
Date: Tue, 18 Dec 2018 20:21:38 +0000
From: "Reinstein, Ilan" <Ilan.Reinstein using nyulangone.org>
To: "r-sig-mixed-models using r-project.org"
	<r-sig-mixed-models using r-project.org>
Subject: [R-sig-ME] Fw: Unbalanced Nested Models with Heteroscedastic
	Errors
Message-ID: <873f52ba938e4c0da122474a4586b474 using nyulangone.org>
Content-Type: text/plain; charset="utf-8"

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


Hi,


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.


Notes:

 - 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}}




------------------------------

Message: 2
Date: Tue, 18 Dec 2018 17:06:39 +0000
From: "Reinstein, Ilan" <Ilan.Reinstein using nyulangone.org>
To: "r-sig-mixed-models using r-project.org"
	<r-sig-mixed-models using r-project.org>
Subject: [R-sig-ME] Unbalanced Nested Models with Heteroscedastic
	Errors
Message-ID: <5cdc01972b6e4ec8819c1d10e5db0073 using nyulangone.org>
Content-Type: text/plain; charset="utf-8"

Hi,


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.


Notes:

 - 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}}




------------------------------

Subject: Digest Footer

_______________________________________________
R-sig-mixed-models mailing list
R-sig-mixed-models using r-project.org
https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_r-2Dsig-2Dmixed-2Dmodels&d=DwICAg&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=szMipnZzQMIctqnszKsX-AUNBHtRn663-NaJh5_rHBE&m=hBvCaNGt_bk-s68BkfzjQ0IeU_UHl1q7w22Gi1IaYZY&s=ZNUPRM1S5yri6v5VDxxdjyTf_QDtZQF-x9GrHWHl5Fs&e=


------------------------------

End of R-sig-mixed-models Digest, Vol 144, Issue 21



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