Predictive Analytics Group Assignment.docx - Predictive Modeling Group Assignment Nandini Ramakumar Sankaran Narayanan Karthik G Kaviarasu Markandeyan

Predictive Analytics Group Assignment.docx - Predictive...

This preview shows page 1 - 3 out of 7 pages.

Nandini Ramakumar Sankaran Narayanan Karthik G Kaviarasu Markandeyan Predictive Modeling Group Assignment
Image of page 1
OBJECTIVE You will have to build a logistic regression model and interpret the result. Make sure you partition the data set by allocating 70% -for training data and 30% -for validating the results. ANSWER Reading the dataset mydata = read.csv("Dataset_Cellphone.csv", header =TRUE) > str(mydata) 'data.frame': 3333 obs. of 11 variables: $ Churn : int 0 0 0 0 0 0 0 0 0 0 ... $ AccountWeeks : int 128 107 137 84 75 118 121 147 117 141 ... $ ContractRenewal: int 1 1 1 0 0 0 1 0 1 0 ... $ DataPlan : int 1 1 0 0 0 0 1 0 0 1 ... $ DataUsage : num 2.7 3.7 0 0 0 0 2.03 0 0.19 3.02 ... $ CustServCalls : int 1 1 0 2 3 0 3 0 1 0 ... $ DayMins : num 265 162 243 299 167 ... $ DayCalls : int 110 123 114 71 113 98 88 79 97 84 ... $ MonthlyCharge : num 89 82 52 57 41 57 87.3 36 63.9 93.2 ... $ OverageFee : num 9.87 9.78 6.06 3.1 7.42 ... $ RoamMins : num 10 13.7 12.2 6.6 10.1 6.3 7.5 7.1 8.7 11.2 ... We need to convert the dependent variable (Churn) and the independent variables (ContractRenewal and DataPlan) to factor datatype. > mydata$Churn = factor(mydata$Churn) > mydata$ContractRenewal= factor(mydata$ContractRenewal) > mydata$DataPlan = factor(mydata$DataPlan) > str(mydata) 'data.frame': 3333 obs. of 11 variables: $ Churn : Factor w/ 2 levels "0","1": 1 1 1 1 1 1 1 1 1 1 ... $ AccountWeeks : int 128 107 137 84 75 118 121 147 117 141 ... $ ContractRenewal: Factor w/ 2 levels "0","1": 2 2 2 1 1 1 2 1 2 1 ... $ DataPlan : Factor w/ 2 levels "0","1": 2 2 1 1 1 1 2 1 1 2 ... $ DataUsage : num 2.7 3.7 0 0 0 0 2.03 0 0.19 3.02 ... $ CustServCalls : int 1 1 0 2 3 0 3 0 1 0 ... $ DayMins : num 265 162 243 299 167 ... $ DayCalls : int 110 123 114 71 113 98 88 79 97 84 ... $ MonthlyCharge : num 89 82 52 57 41 57 87.3 36 63.9 93.2 ... $ OverageFee : num 9.87 9.78 6.06 3.1 7.42 ... $ RoamMins : num 10 13.7 12.2 6.6 10.1 6.3 7.5 7.1 8.7 11.2 ...
Image of page 2
Image of page 3

You've reached the end of your free preview.

Want to read all 7 pages?

  • Winter '18
  • Narayan
  • Type I and type II errors, McNemar

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture