1
$\begingroup$

I have run a zero-inflated model as follows: number of birds ~ treatment * date + minutes after sunrise + snow cover + (1|site)

This was the code (in R):

zip_mod <- glmmTMB(sum.50 ~ trtmt*julian2 +min_aft_sunrise2 + 
                   snow_cover + (1|site), data = data_bcch, 
                   ziformula=~1, family=poisson)

All variables are continuous except for snow cover and site. When I load the car package and try to use the vif() function as follows,

vif(zip_mod)

I get an error:

Error in cov2cor(v) : 'V' is not a square numeric matrix
In addition: Warning message:
In vif.default(zip_mod) : No intercept: vifs may not be sensible.

I can't seem to figure out what's wrong. I've run the model without the categorical variables, without the random effect, and still receive an error. I also tried vif.merMod() because maybe vif() doesn't recognize glmmTMB objects correctly. Not sure if this is a technical issue or a statistical one.

$\endgroup$

2 Answers 2

1
$\begingroup$

I think the problem might be in how the vcov() calculates the variance-covariance matrix of the glmmTMB. It defaults to full=FALSE, which doesn't return the full variance-covariance matrix.

But now that it is running, I'm not sure it is returning "sensible" VIF values

                      GVIF Df GVIF^(1/(2*Df))
trtmt            155.962368  3        2.320082
julian2           76.023830  1        8.719165
min_aft_sunrise2   1.136723  1        1.066172
snow_cover         3.071310  1        1.752515
trtmt:julian2    146.079335  3        2.294905
Warning message:
In vif.default(zip_mod) : No intercept: vifs may not be sensible.
$\endgroup$
1
  • 1
    $\begingroup$ Actually I am experiencing the same issue but I have not understood how you managed to make car::vif work with your glmmTMB object. I have the last versions of car and glmmTMB but it still does not work... Error in cov2cor(v) : 'V' is not a square numeric matrix In addition: Warning message: In vif.default(x) : No intercept: vifs may not be sensible. In my case is a model with a random intercept, no zero inflation, and a compois distribution (with poisson I get the same Error). $\endgroup$
    – simone
    Commented May 26, 2019 at 15:59
-1
$\begingroup$

I had the same error and tried running my model with lme4's glmer instead, and got a normal looking VIF output using vif(), so I think it may be an issue with glmmTMB-produced models. I know this was a while ago but hopefully if anyone else has this issue this might help! If you haven't used lme4::glmer() it takes the same syntax as glmmTMB, so you can use the same code.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.