Need R program expert

profilebyorv20n7
teleco_0.docx

I. Introduction

A.

The software used for this analysis is R studio. For starters, it is easier to use than Python and is fully dedicated to statistical analysis. Besides, it is a free software unlike SAS, and it is much easier to find tutorials on the internet.

B.

The goal of this analysis is to find out customers who are more likely to leave the business for the cable competitors. Thus, the company will be able to prevent the loss of these customers and retain them for the long-term. The variable that will be used to determine whether a customer will leave or not is “Churn”. Churn rate, also referred as customer attrition is the proportion of subscribers who are likely to terminate their subscription after a certain period of time.

In this case, churn is a binomial variable, with yes and no as the responses. (Investopedia, 2017).

C.

The descriptive statistic that can be used is the frequency distribution, that will involve graphing the yes responses and the no responses. Using descriptive statistics to determine how the responses are spread and thus be used to plan the amount of work to be done.

II. Data exploration and preparation

D.

The target variable in the data collected is churn. Also referred to as customer attrition, churn determines whether a customer will leave in the near future or not. Churn is a qualitative variable and has only two responses, yes and no. When coming up with a regression model, churn would form a dependent variable.

E.

The independent variables would be tenure, monthly charges, and total charges. These variables are all quantitative variables and can be used seamlessly in coming up with the regression model. The other variables are qualitative in nature, and they would model a log-linear regression model instead.

F.

Thus, using the dependent variables, we can predict whether a customer will churn or not. Manipulating the data will assist in identifying the reasons of churning.

G.

As earlier stated predicting whether a customer will terminate their subscription is an important part of the analysis. This can either be a yes or a no, and will be denoted by 0 or 1.

H.

During the manipulation process, there are records that had missing values, and these records were omitted for the sake of accuracy (extrapolation of data is not 100% accurate).

III. Data analysis

I.

The distribution of the churn variable is skewed. A large number of the customers are likely to stay, 5174 customers to be exact, while 1869 customers are likely to terminate their subscription after a certain period of time.

##READING IN THE DATA

> teleco = read.csv("teleco.csv",header=TRUE)

>

> ##Get Churn Data

> churned = teleco$Churn

>

> ##Descriptive Statistics

> plot(churned, ylab = "Entries", xlab = "Churn", main = "Churn Proportion", col = c("red","blue"))

The graph indicates that there is a low churn rate. It would be impossible to find the other descriptive statistics such as mean, median, mode etc., since the data is qualitative in nature.

J.

The bi variate statistical method to be used is regression analysis. We shall use monthly charges, total charges, and tenure as the independent variables, while churn as the dependent variable.

Monthly charges, total charges, and tenure are used for the regression model since they are continuous variables, and are statistically significant in the regression model. As for the dependent variable, the responses need to be coded numerically (0 and 1) for regression modeling.

K.

The regression analysis will assist in analyzing which of the independent variables are significant in determining if a customer will terminate their subscription or not.

L.

Since the responses are categorical in nature, it is justifiable to use a simple bar chart since it clearly distinguishes between the two responses.

M.

The code below shows the results from the regression analysis:

##Univariate statistics

> fit = lm(churned~ten+monthly+total)

> summary(fit)

Call:

lm(formula = churned ~ ten + monthly + total)

Residuals:

Min 1Q Median 3Q Max

-0.80134 -0.25874 -0.09134 0.31778 1.05221

Coefficients:

Estimate Std. Error t value Pr(>|t|)

(Intercept) 6.863e-02 1.795e-02 3.823 0.000133 ***

ten -2.774e-03 4.570e-04 -6.070 1.34e-09 ***

monthly 7.083e-03 2.770e-04 25.572 < 2e-16 ***

total -7.528e-05 6.318e-06 -11.914 < 2e-16 ***

---

Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.3891 on 7028 degrees of freedom

(11 observations deleted due to missingness)

Multiple R-squared: 0.2247, Adjusted R-squared: 0.2243

F-statistic: 678.8 on 3 and 7028 DF, p-value: < 2.2e-16

The regression equation will thus become:

Churn = 6.863e-02 - 2.774e-03(ten) + 7.083e-03(monthly) - 7.528e-05(total)

Even though the variables prove to be statistically significant, 22.43% of the variation in the dependent variable(churn) can be explained by the independent variables. It shows there is a high probability of observing residual errors.

IV. Summary

N.

Using the variable churn, we are able to see the proportion of people that are likely to terminate their subscription. Nearly 2,000 people will terminate their subscription; which is a huge number. To predict whether a new client will terminate their subscription in the near future (or not), we shall use this equation:

Churn = 6.863e-02 - 2.774e-03(ten) + 7.083e-03(monthly) - 7.528e-05(total)

O.

The analysis of variance is one other way to determine if there are interactions between the dependent and independent variables. The one way analysis of variance provides results of the significant variables as well. All the independent variables are significant in this case.

V. Appendix

P.

##READING IN THE DATA

> teleco = read.csv("teleco.csv",header=TRUE)

>

> ##Get Churn Data

> churned = teleco$Churn.fig

> ten = teleco$tenure

> monthly = teleco$MonthlyCharges

> total = teleco$TotalCharges

> con = teleco$Contract

> part = teleco$Partner

>

> ##Descriptive Statistics

> plot(churn, ylab = "Entries", xlab = "Churn", main = "Churn Proportion", col = c("red","blue"))

>

> ##Univariate statistics

> fit = lm(churned~ten+monthly+total)

> summary(fit)

Call:

lm(formula = churned ~ ten + monthly + total)

Residuals:

Min 1Q Median 3Q Max

-0.80134 -0.25874 -0.09134 0.31778 1.05221

Coefficients:

Estimate Std. Error t value Pr(>|t|)

(Intercept) 6.863e-02 1.795e-02 3.823 0.000133 ***

ten -2.774e-03 4.570e-04 -6.070 1.34e-09 ***

monthly 7.083e-03 2.770e-04 25.572 < 2e-16 ***

total -7.528e-05 6.318e-06 -11.914 < 2e-16 ***

---

Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.3891 on 7028 degrees of freedom

(11 observations deleted due to missingness)

Multiple R-squared: 0.2247, Adjusted R-squared: 0.2243

F-statistic: 678.8 on 3 and 7028 DF, p-value: < 2.2e-16

> anova(fit)

Analysis of Variance Table

Response: churned

Df Sum Sq Mean Sq F value Pr(>F)

ten 1 172.01 172.013 1136.22 < 2.2e-16 ***

monthly 1 114.78 114.778 758.16 < 2.2e-16 ***

total 1 21.49 21.489 141.94 < 2.2e-16 ***

Residuals 7028 1063.97 0.151

---

Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

References

(Investopedia, 2017). Churn Rate. Retrieved on July 29, 2017, from, http://www.investopedia.com/terms/c/churnrate.asp