[R-sig-ME] Package lme4 question

ONKELINX, Thierry Thierry.ONKELINX at inbo.be
Mon Sep 12 10:42:39 CEST 2011


Dear Sarah,

(1|LOCATION)+(1|IDF) gives crossed random effects whereas (1|LOCATION/IDF) gives nested random effects (IDF nested in LOCATION).

Do you have multiple birds per location? And do some birds use more than one location? If both answers are yes, then go for the crossed random effects. If the answers are yes/no then you need nested random effects. If the answer to the first question is no then you need to drop either the location of bird random effect.

Best regards,

Thierry

> -----Oorspronkelijk bericht-----
> Van: r-sig-mixed-models-bounces at r-project.org [mailto:r-sig-mixed-models-
> bounces at r-project.org] Namens Sarah Saunders
> Verzonden: vrijdag 9 september 2011 4:44
> Aan: r-sig-mixed-models at r-project.org
> Onderwerp: [R-sig-ME] Package lme4 question
> 
> Hi,
> I am a graduate student at University of Minnesota working with R. I am using
> package lme4 to run my models and had a question that I hope you can answer.
> I would like to have multiple concurrent random effects in my Poisson model
> and was wondering whether R is nesting these effects?
> 
> I have copied a line of my code below as an example. My response variable
> (FLEDGE) is fledging success, or the number of birds from a nest that survive to a
> certain age of independence. My explanatory variable here is age of the female
> parent (AGEF) that rears them to independence. My two random effects are nest
> site location (LOCATION) and ID of the female parent (IDF). I have included both
> of these to account for psuedoreplication in my dataset that repeats both
> nesting sites and female birds. But nest site location and ID of the female are
> not independent (they're confounded).
> 
> So, in summary, are these random effects nested using this code (i.e., ID of
> female nested within site)? That is what my goal is since these effects are not
> independent. If there is a different way to code this, I would greatly appreciate
> the help.
> 
> r2<-glmer(FLEDGE~AGEF+(1|LOCATION)+(1|IDF),family=poisson,REML=FALSE)
> 
> Thank you for your help!
> Sarah
> 
> --
> Sarah Saunders
> Conservation Biology Graduate Program
> University of Minnesota
> Hodson Hall
> 1980 Folwell Ave.
> St. Paul, MN 55108
> saund196 at umn.edu
> 
> 
> 
> --
> Sarah Saunders
> Conservation Biology Graduate Program
> University of Minnesota
> Hodson Hall
> 1980 Folwell Ave.
> St. Paul, MN 55108
> saund196 at umn.edu
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models




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