Dummy variables, missing data, and interactions

Apprendimento supervisionato in R: Classificazione

Brett Lantz

Instructor

Dummy coding categorical data

# create gender factor
my_data$gender <- factor(my_data$gender,
                         levels = c(0, 1, 2),
                         labels = c("Male", "Female", "Other"))
Apprendimento supervisionato in R: Classificazione

Imputing missing data

Same AUC, Different ROC

Same AUC, Different ROC

Apprendimento supervisionato in R: Classificazione

Interaction effects

Same AUC, Different ROC

Same AUC, Different ROC

# interaction of obesity and smoking
glm(disease ~ obesity * smoking,
      data = health,
      family = "binomial")
Apprendimento supervisionato in R: Classificazione

Let's practice!

Apprendimento supervisionato in R: Classificazione

Preparing Video For Download...