I am running a panel data regression using the plm
package in R
and want to control for multicollinearity between the explanatory variables.
I know there is the vif()
function in the car
-package, however as far as I know, it cannot deal with panel data output.
The plm
can do other diagnostics such as a unit root test but I found no method to calculate for multicollinearity.
Is there a way to calculate a similar test to vif
, or can I just regard each variable as a time-series, leaving out the panel information and run tests using the car
package?
I cannot disclose the data, but the problem should be relevant to all panel data models.
The dimension is roughly 1,000 observations, over 50 time-periods.
The code I use looks like this:
pdata <- pdata.frame(RegData, index=c("id","time"))
fixed <- plm(Y~X, data=pdata, model="within")
and then
vif(fixed)
returns an error.