I'm runnning a Fama Macbeth Cross Sectional Regression as in the picture attached.

The problem is that ESG score is correlated with Firm Size, and when I include firm size the alpha(1) changes a lot (turns from stat sign. negative to stat.sign. positive). I therefore fear that I have multicollinearity in the model.

I therefore want to run a VIF test, but as I am not to good in R I have problems implementing the code in R.

I tried to use the vif function in the car package, but just got error (I assume it is wrong coded):

Code:

```
vif(Y~X)
Error in vcov.default(mod) :
there is no vcov() method for models of class formula
In addition: Warning message:
In is.na(coef(mod)) :
is.na() applied to non-(list or vector) of type 'NULL'
```

Here is the code that I use to run the regression, after I average and run t tests:

Code:

```
for (t in 1:T){
Y=ZRet[t,]
X=cbind(matrix(1,N,1),ESG[t,],Beta[t,],MarketCap[t,],PriceToBook[t,],Momentum[t,],BasicMaterialsDummy[t,],ConsumerGoodsDummy[t,],ConsumerServicesDummy[t,],HealthCareDummy[t,],IndustrialsDummy[t,],OilAndGasDummy[t,],TechnologyDummy[t,],TelecommunicationsDummy[t,],UtilitiesDummy[t,])
Theta=solve(t(X)%*%X)%*%t(X)%*%Y
gamma0[t,]=Theta[1,]
gamma1[t,]=Theta[2,]
gamma2[t,]=Theta[3,]
gamma3[t,]=Theta[4,]
gamma4[t,]=Theta[5,]
gamma5[t,]=Theta[6,]
gamma6[t,]=Theta[7,]
gamma7[t,]=Theta[8,]
gamma8[t,]=Theta[9,]
gamma9[t,]=Theta[10,]
gamma10[t,]=Theta[11,]
gamma11[t,]=Theta[12,]
gamma12[t,]=Theta[13,]
gamma13[t,]=Theta[14,]
gamma14[t,]=Theta[15,]
}
```

Thanks,

Anders