[R-sig-ME] vcov function in glmer or glmmTMB package
wilson 1998
w||@onLO1998 @end|ng |rom hotm@||@com
Thu Feb 18 13:46:39 CET 2021
Hi There,
I have some questions on this package. Basically, I would like to know how the package generate the vcov or variance covariance matrix of the betas while considering the random effects.
In my simulation, for example I am using count data �Salamanders� which is incorporated in glmmTMB package, and for example I choose the poisson model. In the first case, I thought using the idea from generalized estimating equations to get the variance of beta would give the same answer, but it proves me that the idea has not been successfully replicating the vcov output produced by glmmTMB. Would you be able to explain how the package give the output for vcov output?
So here is my attempt:
fit0 = glmmTMB(count~spp + (1|site), family=poisson)
fit1 = glmer(count~spp + (1|site), family=poisson)
vcov(fit0)
vcov(fit1)
then the output is:
> vcov(fit0)
Conditional model:
(Intercept) sppPR sppDM sppEC-A sppEC-L sppDES-L sppDF
(Intercept) 0.100414787 -0.009259333 -0.009259333 -0.009259333 -0.009259334 -0.009259334 -0.009259333
sppPR -0.009259333 0.046295871 0.009259332 0.009259332 0.009259333 0.009259333 0.009259332
sppDM -0.009259333 0.009259332 0.016612285 0.009259333 0.009259333 0.009259333 0.009259333
sppEC-A -0.009259333 0.009259332 0.009259333 0.029259437 0.009259333 0.009259333 0.009259333
sppEC-L -0.009259334 0.009259333 0.009259333 0.009259333 0.014234439 0.009259333 0.009259333
sppDES-L -0.009259334 0.009259333 0.009259333 0.009259333 0.009259333 0.013954163 0.009259333
sppDF -0.009259333 0.009259332 0.009259333 0.009259333 0.009259333 0.009259333 0.017806382
> vcov(fit1)
7 x 7 Matrix of class "dpoMatrix"
(Intercept) sppPR sppDM sppEC-A sppEC-L sppDES-L sppDF
(Intercept) 0.099481765 -0.009148415 -0.009148235 -0.009148238 -0.009148235 -0.009148193 -0.009148190
sppPR -0.009148415 0.045738988 0.009147988 0.009147896 0.009147974 0.009147959 0.009147990
sppDM -0.009148235 0.009147988 0.016412580 0.009147989 0.009148018 0.009148012 0.009148022
sppEC-A -0.009148238 0.009147896 0.009147989 0.028907530 0.009147995 0.009147994 0.009147998
sppEC-L -0.009148235 0.009147974 0.009148018 0.009147995 0.014063315 0.009148014 0.009148020
sppDES-L -0.009148193 0.009147959 0.009148012 0.009147994 0.009148014 0.013786369 0.009148015
sppDF -0.009148190 0.009147990 0.009148022 0.009147998 0.009148020 0.009148015 0.017592178
I tried to reproduce using the idea of Generalized estimating equations for the vcov and found very similar entries, except for the entry (1,1)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.009265 -0.00926500 -0.00926500 -0.00926500 -0.00926500 -0.00926500 -0.00926500
[2,] -0.009265 0.04632422 0.00926500 0.00926500 0.00926500 0.00926500 0.00926500
[3,] -0.009265 0.00926500 0.01662246 0.00926500 0.00926500 0.00926500 0.00926500
[4,] -0.009265 0.00926500 0.00926500 0.02927735 0.00926500 0.00926500 0.00926500
[5,] -0.009265 0.00926500 0.00926500 0.00926500 0.01424315 0.00926500 0.00926500
[6,] -0.009265 0.00926500 0.00926500 0.00926500 0.00926500 0.01396271 0.00926500
[7,] -0.009265 0.00926500 0.00926500 0.00926500 0.00926500 0.00926500 0.01781728
So I would like to know how do glmmTMB / glmer produce the output for vcov please?
Thankyou.
Regards,
WIlson
[[alternative HTML version deleted]]
More information about the R-sig-mixed-models
mailing list