如何在 R 中测试二元 Logistic 回归的多重共线性?
我尝试了相关表,但我不知道该怎么做。
以下是如何在 R 中测试多重共线性:
library(car)
# Begin by calculating the correlation matrix for your independent variables
correlation_matrix <- cor(your_data[, c("var1", "var2", "var3")])
# Calculate VIF for your logistic model
vif_values <- vif(your_logistic_model)
# Examine the VIF values. VIF values greater than 5 are often considered indicative of high multicollinearity.