R 中二元逻辑回归的多重共线性测试?

问题描述 投票:0回答:1

如何在 R 中测试二元 Logistic 回归的多重共线性?

我尝试了相关表,但我不知道该怎么做。

binary logistic-regression correlation multicollinearity
1个回答
0
投票

以下是如何在 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. 

© www.soinside.com 2019 - 2024. All rights reserved.