Professional Documents
Culture Documents
Name: Mariano
Question 1: Prepare a dashboard (minimum of two and maximum four charts; you can do this in tableau/R).
library(plyr)
library(corrplot)
library(ggplot2)
library(gridExtra)
library(ggthemes)
library(caret)
library(MASS)
library(randomForest)
library(party)
str(churn)
#Changing "No internet service" to "No" for six columns, they are: "OnlineSecurity", "OnlineBackup",
"DeviceProtection", "TechSupport", "streamingTV", "streamingMovies"#
for(i in 1:ncol(churn[,cols_recode1])) {
to=c("No")))
min(churn$tenure); max(churn$tenure)
return('0-12 Month')
return('12-24 Month')
return('24-48 Month')
return('48-60 Month')
return('> 60 Month')
from=c("0","1"),
to=c("No", "Yes")))
#The Monthly Charges and Total Charges are correlated. So one of them will be removed from the
model. We remove Total Charges.
Question 2: Perform a simple logistic regression with any one of the variables (one independent variable) and
discuss the results.
table(tdat$resp)
head(tdat)
head(tdat$Churn)
is.na(tdat$Churn)
summary(model1)
##interpretation
exp(coef(model1))
##Output