r logistic regression code example
Example 1: how to do logistic regression in r
glm(response ~ ., data = your_train_data, family = "binomial")
Example 2: how to code binary response in r
data$response <- ifelse(response == "yes", 1, 0)
glm(response ~ ., data = your_train_data, family = "binomial")
data$response <- ifelse(response == "yes", 1, 0)