# How to test multicollinearity in Fixed Effects Model in R?

I was using plm package in R and run some pooling and fixed effects model. For pooling models I was able to use vif() for getting Variance Inflation Factor, but when I run it for fixed effect model, it showed me the below error:

> > vif(modelFE.1.i)
> > Error in R[subs, subs] : subscript out of bounds In
> addition: Warning message: In vif.default(modelFE.1.i) : No intercept:
> vifs may not be sensible.


So, I was wondering if there is some way to find multicollinearity under Fixed Effects settings?

The error says that VIF cannot be computed without intercept, I understand that. But, what can be the other tests that I can do for testing multicollinearity?

• which was the method used in your plm function? saving fixed effects models caused all kinds of confusion. If possible provide the code and explain what is the model you are fitting? We are only seeing the final code object modelFE.1, which makes sense to no one except yourself – StupidWolf Oct 29 '20 at 8:56

Reprex (courtesy of https://easystats.github.io/blog/posts/performance_check_collinearity/):

library(glmmTMB); library(performance)
#note: needed to also install the insight package before installation of performance

data(Salamanders)

# create highly correlated pseudo-variable
set.seed(1)
Salamanders$cover2 <- Salamanders$cover * runif(n = nrow(Salamanders), min = .7, max = 1.3)

# fit mixed model with zero-inflation
model <- glmmTMB(
count ~ spp + mined + cover + cover2 + (1 | site),
ziformula = ~ spp + mined,
family = truncated_poisson,
data = Salamanders
)

# now check for multicollinearity
check_collinearity(model)


The performance package offers check_collinearity function that handles ME models:

 library(performance)

check_collinearity(model)
# Check for Multicollinearity
#--------------------------------------------------------
* conditional component:

Low Correlation

Parameter  VIF Increased SE
spp 1.07         1.04
mined 1.17         1.08

High Correlation

Parameter   VIF Increased SE
cover 19.30         4.39
cover2 19.12         4.37

* zero inflated component:

Low Correlation

Parameter  VIF Increased SE
spp 1.08         1.04
mined 1.08         1.04

• Many thanks for the reply. But, I am looking for testing Multicollinearity in fixed effects model, where it is not working and giving me the below error: Error in R[subs, subs] : subscript out of bounds – Aru Bhardwaj Oct 29 '20 at 5:15
• I thought that "conditional components" was the "fixed effects". Perhaps you need to check with CrossValidated.com or post the the R-SIG-mixed-effects mailing list. – DWin Oct 29 '20 at 6:50