Aan de slagGa gratis aan de slag

Logistic regression with 2 explanatory variables

To include multiple explanatory variables in logistic regression models, the syntax is the same as for linear regressions. The only change is the same as in the simple case: you run a generalized linear model with a binomial error family.

Here you'll fit a model of churn status with both of the explanatory variables from the dataset: the length of customer relationship and the recency of purchase.

churn is available.

Deze oefening maakt deel uit van de cursus

Intermediate Regression in R

Cursus bekijken

Oefeninstructies

  • Fit a logistic regression of churn status, has_churned versus length of customer relationship, time_since_first_purchase and recency of purchase, time_since_last_purchase, and an interaction between the explanatory variables.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Fit a logistic regression of churn status vs. length of relationship, recency, and an interaction
mdl_churn_vs_both_inter <- ___





# See the result
mdl_churn_vs_both_inter
Code bewerken en uitvoeren