check_collinearity()
checks regression models for
multicollinearity by calculating the variance inflation factor (VIF).
check_collinearity(x, ...)# S3 method for glmmTMB
check_collinearity(x, component = c("all",
"conditional", "count", "zi", "zero_inflated"), ...)
A model object (that should at least respond to vcov()
,
and if possible, also to model.matrix()
- however, it also should
work without model.matrix()
).
Currently not used.
For models with zero-inflation component, multicollinearity
can be checked for the conditional model (count component,
component = "conditional"
or component = "count"
),
zero-inflation component (component = "zero_inflated"
or
component = "zi"
) or both components (component = "all"
).
Following model-classes are currently supported: hurdle
,
zeroinfl
, zerocount
, MixMod
and glmmTMB
.
A data frame with three columns: The name of the model term, the variance inflation factor and the factor by which the standard error is increased due to possible correlation with other predictors.
The variance inflation factor is a measure to analyze the magnitude of multicollinearity of model predictors. A VIF less than 5 indicates a low correlation of that predictor with other predictors. A value between 5 and 10 indicates a moderate correlation, while VIF values larger than 10 are a sign for high, not tolerable correlation of model predictors. The Increased SE column in the output indicates how much larger the standard error is due to the correlation with other predictors.
James, G., Witten, D., Hastie, T., & Tibshirani, R. (Hrsg.). (2013). An introduction to statistical learning: with applications in R. New York: Springer.
# NOT RUN {
m <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars)
check_collinearity(m)
# }
Run the code above in your browser using DataLab