Database Reference
In-Depth Information
for an older customer. On the other hand, based on the positive sign of the
Churned_Contacts coefficient, the value of y and subsequently the probability of
churning increases as the number of churned contacts increases.
6.2.3 Diagnostics
The churn example illustrates how to interpret a fitted logistic regression model.
Using R, this section examines the steps to develop a logistic regression model and
evaluate the model's effectiveness. For this example, the churn_input data frame
is structured as follows:
head(churn_input)
ID Churned Age Married Cust_years Churned_contacts
1 1 0 61 1 3 1
2 2 0 50 1 3 2
3 3 0 47 1 2 0
4 4 0 50 1 3 3
5 5 0 29 1 1 3
6 6 0 43 1 4 3
A Churned value of 1 indicates that the customer churned. A Churned value of 0
indicates that the customer remained as a subscriber. Out of the 8,000 customer
records in this dataset, 1,743 customers (˜22%) churned.
sum(churn_input$Churned)
[1] 1743
Using the Generalized Linear Model function, glm() , in R and the specified
family/link, a logistic regression model can be applied to the variables in the
dataset and examined as follows:
Churn_logistic1 <- glm (Churned˜Age + Married + Cust_years +
Churned_contacts, data=churn_input,
family=binomial(link="logit"))
summary(Churn_logistic1)
Coefficients:
Estimate Std. Error z value Pr(>|z|)
Search WWH ::




Custom Search