[R-sig-ME] OR random effects - multilevel model

Chuck Cleland ccleland at optonline.net
Tue May 11 19:14:16 CEST 2010


On 5/11/2010 11:11 AM, Etn wrote:
> Hi All,
> 
> I would really appreciate any advice on extracting Odds Ratios for random
> effects from my multilevel model. I want to find the OR for the random
> effects School and School:Student_ID......
> I have tried several approaches with no success.....

  Perhaps you are looking for the median odds ratio described by Larsen
and Merlo (2005)?

http://aje.oxfordjournals.org/cgi/content/short/161/1/81

  If not, you may want to further explain what you mean.

hope this helps,

Chuck Cleland

> Model<- lmer(Res~Gender+(1|School)+(1|School:Student_ID),
> family=binomial,data=Data)
> 
> 
> I can extract the ORs for the fixed effects using:
> 
> OR_fixed=exp(fixef(Model))
> OR_fixed
> 
> However, I cannot seem to extract for Random effects...
> 
> The methods I have tried are:
> 
> 1): This gives the OR for School..... but I'm unsure how to get
> School:Student_ID
> 
> Random1 = coef(Model)$School
> OR_Random<-exp(Random1)
> 
> 
> 2) This extracts the random effects, but I cannot exp to get OR
> 
> 
> ranef(Model)
> exp(ranef(Model))
> 
> Error in exp(ranef(Model)) :
>   Non-numeric argument to mathematical function
> 
> 2a)
> 
> exp(ranef(Model)$School:Student_ID)
> Error in ranef(Model)$School:Student_ID: NA/NaN argument
> In addition: Warning message:
> In ranef(Model)$School:Student_ID:
>   numerical expression has 43159 elements: only the first used
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models

-- 
Chuck Cleland, Ph.D.
NDRI, Inc. (www.ndri.org)
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 512-0171 (M, W, F)
fax: (917) 438-0894




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