Hi Frederic,
if you want to assess multicollinearity among different predictors with the variance inflation factor (VIF), you can just run a classic linear regression with any random response variable as a function of the predictors of interest. Specifically, to estimate the VIF of a given variable, you 1) regress the variable against the remaining predictors, 2) extract the R^2 of the regression, and then, 3) VIF = 1/(1 - R^2).
If you're using the vif( ) function in the car package, you can see this using the cement data set:
library(car)
data(cement, package = "AICcmodavg")
head(cement)
##run model with y as response
m1 <- lm(y ~ x1 + x2 + x3 + x4, data = cement)
##extract VIF
vif(m1)
##create bogus variable
cement$bogus <- lm(bogus ~ x1 + x2 + x3 + x4, data = cement)
vif(m2)
It is straightforward to do this for predictors on occupancy. For predictors on detection probability, you'll need to "unfold" the data so that each predictor is in its own column, before estimating VIF.
Hope it helps,
Marc
To unsubscribe from this group and stop receiving emails from it, send an email to unmarked+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "unmarked" group.
To unsubscribe from this group and stop receiving emails from it, send an email to unmarked+unsubscribe@googlegroups.com.
Frederic,
in order for it to get the VIF, you need to run the regressions with lm( ), not occu( ). For instance, to determine the VIF for the predictors div_pente, Surf_AO, and altitude, which are fit on occupancy in your case, then just do:
m1 <- lm(bogusResponse ~
div_pente + Surf_AO + altitude,
data = aClassicDataFrame)
vif(m1)
Here, bogusResponse is a (random) numeric variable that must appear somewhere in your classic R data.frame, not UMF.
Marc