Logistic regression with glm()
Linear regression and logistic regression are special cases of a broader type of models called generalized linear models ("GLMs"). A linear regression makes the assumption that the residuals follow a Gaussian (normal) distribution. By contrast, a logistic regression assumes that residuals follow a binomial distribution.
Here, you'll model how the length of relationship with a customer affects churn.
churn is available.
Deze oefening maakt deel uit van de cursus
Introduction to Regression in R
Oefeninstructies
- Fit a logistic regression of
has_churnedversustime_since_first_purchaseusing thechurndataset. Assign tomdl_churn_vs_relationship.
Praktische interactieve oefening
Probeer deze oefening eens door deze voorbeeldcode in te vullen.
# Fit a logistic regression of churn vs. length of relationship using the churn dataset
mdl_churn_vs_relationship <- ___
# See the result
mdl_churn_vs_relationship