[R-sig-ME] Error implementing Gamma glmm with glmer
Stephani.Zador at noaa.gov
Stephani.Zador at noaa.gov
Thu Dec 18 21:59:31 CET 2008
Dear all,
I am testing the influence of bottom depth and temperature on the fish catch rates (cpue). This is a 26 year time series of zero-inflated data. Therefore, I first test the presence/absence of the fish:
m1<-glmer(presence~btemp+bdepth+(1|year),data=clus1cpuebt, family=binomial, nAGQ=10)
Then, I test the non-zero catch rates, which fit the assumptions of being either lognormal or gamma-distributed:
m2<-glmer(log(cpue)~btemp+bdepth+(1|year), data=clus1subset, family=gaussian, REML=F)
m3<-glmer(cpue~btemp+bdepth+(1|year), data=clus1subset, family=Gamma(link="log"))
However, I get the error message for m3: Error in asMethod(object) : matrix is not symmetric [1,2]
Could someone please explain this error to me and how to resolve it? Further information is below:
A similar glm without the random effect is successful.
> gmmodel4<-glm(cpue~bdepth+btemp,data=clus1subset,family=Gamma(link="log"))
> summary(gmmodel4)
Call:
glm(formula = cpue ~ bdepth + btemp, family = Gamma(link = "log"),
data = clus1subset)
Deviance Residuals:
Min 1Q Median 3Q Max
-3.3772 -0.8814 -0.3467 0.2165 5.8240
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.223159 0.223077 5.483 4.93e-08 ***
bdepth 0.006368 0.001638 3.887 0.000106 ***
btemp 0.343002 0.041323 8.301 2.37e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for Gamma family taken to be 1.534698)
Null deviance: 1636.3 on 1434 degrees of freedom
Residual deviance: 1517.3 on 1432 degrees of freedom
AIC: 11950
Number of Fisher Scoring iterations: 8
The lognormal mixed model is also successful.
> m2<-glmer(log(cpue)~bdepth+btemp+(1|year),data=clus1subset,family=gaussian,REML=F)
> print(m2,digits=4)
Linear mixed model fit by maximum likelihood
Formula: log(cpue) ~ bdepth + btemp + (1 | year)
Data: clus1subset
AIC BIC logLik deviance REMLdev
4122 4148 -2056 4112 4130
Random effects:
Groups Name Variance Std.Dev.
year (Intercept) 0.37487 0.61227
Residual 0.97176 0.98578
Number of obs: 1435, groups: year, 26
Fixed effects:
Estimate Std. Error t value
(Intercept) -1.201085 0.220070 -5.458
bdepth 0.016921 0.001313 12.885
btemp 0.533073 0.037783 14.109
Correlation of Fixed Effects:
(Intr) bdepth
bdepth -0.595
btemp -0.454 -0.191
> sessionInfo()
R version 2.8.0 (2008-10-20)
i386-pc-mingw32
locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] lme4_0.999375-28 Matrix_0.999375-17 lattice_0.17-17
loaded via a namespace (and not attached):
[1] grid_2.8.0 tools_2.8.0
Many thanks,
Stephani Zador, PhD
Research Associate
Alaska Fisheries Science Center
More information about the R-sig-mixed-models
mailing list