[R] GLM with random effects

Andrew Robinson A.Robinson at ms.unimelb.edu.au
Fri Apr 13 00:22:03 CEST 2007


Hello Brendan,

do you have any particular objection to

lmer(nor.tot.lep ~ In.Out + (1|Replicate), data=coho, family=poisson)

?

Andrew

On Thu, Apr 12, 2007 at 02:58:07PM -0700, Brendan Connors wrote:
> Hi R-Users,
> 
> I have 3 replicates ('Replicate) of counts of parasites ('nor.tot.lep') 
> before and after an experiment ('In.Out'). I am trying to treat the 
> three replicates as a random effect in order to determine if the main 
> effect (In.Out) significantly influences my dependent variable 
> (nor.tot.lep) after the variance explained by the replicates is 
> accounted for. I have tried:
> 
>  >lmer(nor.tot.lep ~ In.Out + (In.Out|Replicate),data=coho, family=poisson)
> Generalized linear mixed model fit using PQL
> Formula: nor.tot.lep ~ In.Out + (In.Out | Replicate)
> Data: coho
> Family: Poisson
> AIC BIC logLik deviance
> 849.2 867.4 -419.6 839.2
> Random effects:
> Groups Name Variance Std.Dev. Corr
> Replicate (Intercept) 0.78861 0.88804
> In.Out 0.67232 0.81995 -1.000
> Residual 2.96308 1.72136
> number of obs: 279, groups: Replicate, 3
> 
> Fixed effects:
> Estimate Std. Error t value
> (Intercept) -0.2431 0.6619 -0.3672
> In.Out 1.6004 0.5645 2.8349
> 
> Correlation of Fixed Effects:
> (Intr)
> In.Out -0.975
> There were 30 warnings (use warnings() to see them)
> 
>  > warnings()
> Warning messages:
> 1: Estimated variance-covariance for factor ?Replicate? is singular
> in: LMEopt(x = mer, value = cv)
> 2: nlminb returned message false convergence (8)
> in: LMEopt(x = mer, value = cv)
> 
> but as Mr. Bates pointed out, this is inappropriate b/c I am trying to 
> use 3 distinct replicates to estimate 3 variance-covariance
> parameters. "It won't work. Notice that the estimated correlation is
> -1.000. Your estimated variance-covariance matrix is singular"
> 
> I have also tried:
> 
>  >glmmPQL(nor.tot.lep ~ In.Out, random = (In.Out|Replicate), family = 
> poisson, data = coho)
> 
> Error in glmmPQL(nor.tot.lep ~ In.Out, random = (In.Out | Replicate), :
> object "In.Out" not found
> 
> and R cannot find "In.Out"
> 
> If anyone has any suggestions they would be extremely appreciated!
> 
> Cheers,
> 
> Brendan
> 
> ______________________________________________
> 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.

-- 
Andrew Robinson  
Department of Mathematics and Statistics            Tel: +61-3-8344-9763
University of Melbourne, VIC 3010 Australia         Fax: +61-3-8344-4599
http://www.ms.unimelb.edu.au/~andrewpr
http://blogs.mbs.edu/fishing-in-the-bay/



More information about the R-help mailing list