[R] GLM with random effects
Brendan Connors
bconnors at sfu.ca
Thu Apr 12 23:58:07 CEST 2007
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
More information about the R-help
mailing list