Dear lmer users, The experiment includes 15 groups of (3 males and 1 female). The female is characterized by its quality Q1 and Q2. Each male of a group is characterized by the number of MatingAttempts (with Poisson distribution). I want to examine if male mating attempts depend on female quality. I can see from graphic exploration that the within-group heterogeneity of male attempts increases with female quality Q1.
When including the method weights in the function lmer, I get the message that variables' length varies and the model does not run. lmer(MatingAttempts~Q1+Q2+(1|Group),data=file,family="poisson",na.action=na.omit, REML=FALSE, weights=varExp(form=~Q1)) If I run the same model (fixed effects and random effects) with lme, it works properly, which shows that there is no problem with data structure. lme(MatingAttempts~Q1+Q2,random=~1|Group,data=file,na.action=na.omit, method="ML", weights=varExp(form=~Q1)) I saw on the forum that lmer had problems in taking into account variance heterogeneity. Yet, the messages were old and there are maybe new solutions. How can I correct the analyses for this problem of heteroscedasticity? Should I normalise the within group variance before implementing the model? And deal with the variance (as a new variable to explain) in another model? Is there another way to solve this problem? Thank you in advance for your help Doris Gomez [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.