[R] weights in lmer

Sundar Dorai-Raj sundar.dorai-raj at pdf.com
Tue Aug 14 20:47:09 CEST 2007


Try

weights = as.numeric(total)

BTW, there is a SIG (Special Interest Group) for lmer.

https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models

HTH,

--sundar

Chris O'Brien said the following on 8/14/2007 11:00 AM:
> Dear R users,
> 
> Prof. Ripley just corrected my understanding of the use of weights in glm, 
> which I thought would allow me to correctly use lmer.  However I'm still 
> having problems.
> 
> My data takes the form of # of infected and uninfected individuals that 
> were measured over time under different treatments.  I'm using lmer to 
> adjust for the repeated measures over time.
> 
> In fitting the model:
> 
>  > model1=lmer(y~treatment+(time | ID),family=binomial,weights = total)
> 
> where y = proportion of animals infected (number infected/total)
>          total = number of infected + number uninfected
> 
> this returns the error:
> 
> Error in lmer(y ~ treatment + (time | ID), family = binomial, weights = 
> total) :
>          object `weights' of incorrect type
> 
> Can anyone tell me what's wrong with the weights?
> 
> cheers,
> Chris
> 
> 
> 
> 
> 
> Chris O'Brien
> Sonoran Desert Research Station and
> School of Natural Resources
> Biological Sciences, room 125
> University of Arizona
> Tucson, AZ 85721
> work (520) 623-3720
> obrienc at email.arizona.edu
> 
> ______________________________________________
> R-help at stat.math.ethz.ch 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.



More information about the R-help mailing list