# Does the VIF make sense for a model with categorical variables?

I'm trying to detect multicollinearity in my model, it has count response variable and some proportional and one categorical explanatory variable called site. In R the model looks like this:

glm(Total ~ percent_flower + Percent_typeofflower + Percent_ohtertypeoflower + Site,
family=poisson, data=pollinator)


I want to know whether I should calculate the vif() without Site, it doesn't seem to make sense to calculate a correlation between a numerical variable and a categorical one.

Also if I have to keep Site in to calculate the vif(), will running a GLMM instead of a GLM take care of the collinearity issue?

• I'm not sure about the conceptual difficulty - if there was a correlation between Site and your other variables it would simply mean that there was a meaningful difference in one or more of your other explanatory variables dependent on changing sites. This seems very plausible and worth checking. – Robert de Graaf Apr 19 '17 at 0:50
• @RobertdeGraaf are you saying i should be adding interactions between sites and the other variables? – rhomboideus capitis Apr 20 '17 at 20:28
• I don't think I'm saying that - I'm more saying that you appear to be assuming that the other variables are independent of Site simply because Site is categorical, and that doesn't seem reasonable. In fact it seems very plausible that one or more of the other variables in your model is strongly influenced by Site, and that needs to be considered in your analysis. – Robert de Graaf Apr 24 '17 at 1:49

My recommendation, if you want to test for collinearity and have categorical variables as well as continuous ones and are using R is to use the perturb package. The idea here is to add small amounts of random noise to the variables - by adding uniform or normal noise to the continuous variables and by shifting some categorical ones - and seeing what happens to the coefficients.