
Plot method for multicollinearity checks
Source:R/plot.check_collinearity.R
plot.see_check_collinearity.RdThe plot() method for the performance::check_collinearity() function.
Arguments
- x
An object.
- data
The original data used to create this object. Can be a statistical model.
- theme
A ggplot2-theme function, e.g.
theme = theme_lucid()ortheme = ggplot2::theme_dark().- colors
Character vector of length two, indicating the colors (in hex-format) for points and line.
- size_point
Numeric specifying size of point-geoms.
- size_line
Numeric value specifying size of line geoms.
linewidthis an alias forsize_line.- base_size, size_axis_title, size_title
Numeric value specifying size of axis and plot titles.
- ...
Arguments passed to or from other methods.
Details
If a term with a VIF below 2 has an upper confidence limit that is infinite or above the top of the plot, the plot has a caption. The caption says that the interval formula fails near VIF = 1, and that this is not high collinearity.
Examples
library(performance)
m <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars)
result <- check_collinearity(m)
result
#> # Check for Multicollinearity
#>
#> Low Correlation
#>
#> Term VIF VIF 95% CI adj. VIF Tolerance Tolerance 95% CI
#> gear 1.53 [1.04, 2.06] 1.24 0.65 [0.48, 0.96]
#>
#> Moderate Correlation
#>
#> Term VIF VIF 95% CI adj. VIF Tolerance Tolerance 95% CI
#> wt 5.05 [2.57, 7.07] 2.25 0.20 [0.14, 0.39]
#> cyl 5.41 [2.74, 7.58] 2.33 0.18 [0.13, 0.36]
#> disp 9.97 [4.90, 13.93] 3.16 0.10 [0.07, 0.20]
plot(result)