BaşlayınÜcretsiz Başlayın

Detecting multicollinearity

In this exercise, you will check for multicollinearity among all variables by using the Variance Inflation Factor (VIF). You can calculate the VIF using the vif() function from the car package.

The VIF values are available in the GVIF column of the output and are usually printed in the exponential format. If you are not familiar with this format, you can use the format() function:

sample_vif_value <- 2.213e+10
format(sample_vif_value, scientific = FALSE)

"22130000000"

Bu egzersiz

HR Analytics: Predicting Employee Churn in R

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Load the car package.
  • Check for multicollinearity in the model (multi_log) you built in a previous exercise.
  • Which variable has the highest VIF? Assign the variable name as a string to highest.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Load the car package
___

# Model you built in a previous exercise
multi_log <- glm(turnover ~ ., family = "binomial", data = train_set_multi)

# Check for multicollinearity
___

# Which variable has the highest VIF?
highest <- ___
Kodu Düzenle ve Çalıştır