• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 3 out of 21 pages
Exam (elaborations)

ISYE 6414 Midterm Exam 2 – Part 2 Data Analysis | Complete Questions, Solutions & R Code | 2026/2027 Updated | 100% Correct - Georgia Institute Of Technology.

Document preview thumbnail
Preview 3 out of 21 pages

ISYE 6414 Midterm Exam 2 – Part 2 Data Analysis | Complete Questions, Solutions & R Code | 2026/2027 Updated | 100% Correct - Georgia Institute Of Technology.

Content preview

7/2/25, 9:05 PM Midterm Exam 2




Midterm Exam 2
Part 2: Data Analysis
You will use two datasets for this exam.

For Questions 1-4, use the dataset “Customer churn”. See description below.

For Question 5-7, use the dataset “ShipAccidents”. See description below.

Customer Churn Dataset

This dataset is part of a data science project focused on customer churn prediction for a subscription-based
service. Customer churn, the rate at which customers cancel their subscriptions, is a vital metric for businesses
offering subscription services. Predictive analytics techniques are employed to anticipate which customers are
likely to churn, enabling companies to take proactive measures for customer retention.

SubscriptionType: Type of subscription plan chosen by the customer (e.g., Basic, Premium, Deluxe)

PaymentMethod: Method used for payment (e.g., Credit Card, Electronic Check, PayPal)

PaperlessBilling: Whether the customer uses paperless billing (Yes/No)

ContentType: Type of content accessed by the customer (e.g., Movies, TV Shows, Documentaries)

MultiDeviceAccess: Whether the customer has access on multiple devices (Yes/No)

DeviceRegistered: Device registered by the customer (e.g., Smartphone, Smart TV, Laptop)

GenrePreference: Genre preference of the customer (e.g., Action, Drama, Comedy)

Gender: Gender of the customer (Male/Female)

ParentalControl: Whether parental control is enabled (Yes/No)

SubtitlesEnabled: Whether subtitles are enabled (Yes/No)

AccountAge: Age of the customer’s subscription account (in months)

MonthlyCharges: Monthly subscription charges

TotalCharges: Total charges incurred by the customer

ViewingHoursPerWeek: Average number of viewing hours per week

SupportTicketsPerMonth: Number of customer support tickets raised per month

AverageViewingDuration: Average duration of each viewing session

ContentDownloadsPerMonth: Number of content downloads per month

UserRating: Customer satisfaction rating (1 to 5)

WatchlistSize: Size of the customer’s content watchlist

Churn (response variable): 1 if the customer has cancelled the subscription, 0 if not.

Read the data and answer the questions below:


file:///C:/Users/shani/Downloads/Spring2024_midterm_2_R_solutions.html 1/21

,7/2/25, 9:05 PM Midterm Exam 2

NOTE: The categorical variables have already been converted into factors in the code below. The dataset has
been divided into train and test datasets.

# Loading of the data

churn= read.csv("Customer churn.csv", header=TRUE, sep=",")

churn$SubscriptionType=as.factor(churn$SubscriptionType)
churn$PaymentMethod=as.factor(churn$PaymentMethod)
churn$PaperlessBilling=as.factor(churn$PaperlessBilling)
churn$ContentType=as.factor(churn$ContentType)
churn$MultiDeviceAccess=as.factor(churn$MultiDeviceAccess)
churn$DeviceRegistered=as.factor(churn$DeviceRegistered)
churn$GenrePreference=as.factor(churn$GenrePreference)
churn$Gender=as.factor(churn$Gender)
churn$ParentalControl=as.factor(churn$ParentalControl)
churn$SubtitlesEnabled=as.factor(churn$SubtitlesEnabled)
churn$Churn=as.factor(churn$Churn)

set.seed(123) # Setting seed for reproducibility

nrows <- nrow(churn)
train_indices <- sample(1:nrows, 0.8 * nrows) # 80% of data for training

# Split the data into train and test sets
train_churn <- churn[train_indices, ]
test_churn <- churn[-train_indices, ]


#resetting the indices
rownames(train_churn) <- NULL
rownames(test_churn) <- NULL

head(train_churn)




file:///C:/Users/shani/Downloads/Spring2024_midterm_2_R_solutions.html 2/21

, 7/2/25, 9:05 PM Midterm Exam 2


## AccountAge MonthlyCharges TotalCharges SubscriptionType PaymentMethod
## 1 79 12.940000 1021.9544 Standard Credit card
## 2 52 7.400856 384.8445 Basic Bank transfer
## 3 57 13.907165 792.7084 Basic Bank transfer
## 4 69 9.990000 689.2958 Basic Mailed check
## 5 52 13.011418 676.5937 Standard Credit card
## 6 14 18.886117 264.4056 Basic Mailed check
## PaperlessBilling ContentType MultiDeviceAccess DeviceRegistered
## 1 No Both Yes Tablet
## 2 Yes Both Yes Computer
## 3 No Movies No TV
## 4 No TV Shows No Mobile
## 5 Yes TV Shows No Tablet
## 6 No Both Yes TV
## ViewingHoursPerWeek AverageViewingDuration ContentDownloadsPerMonth
## 1 35.281760 57.02602 16
## 2 23.196542 30.24825 26
## 3 28.992753 36.39316 11
## 4 13.294368 23.04048 28
## 5 27.749768 152.69022 47
## 6 3.718285 71.87396 2
## GenrePreference UserRating SupportTicketsPerMonth Gender WatchlistSize
## 1 Drama 4.785032 5 Female 18
## 2 Drama 1.374711 4 Male 24
## 3 Drama 4.080789 6 Male 8
## 4 Drama 3.972756 9 Female 23
## 5 Drama 4.305154 6 Female 19
## 6 Drama 1.355945 3 Female 7
## ParentalControl SubtitlesEnabled Churn
## 1 No Yes 0
## 2 Yes Yes 0
## 3 No No 1
## 4 Yes No 1
## 5 Yes Yes 0
## 6 No No 1


Use “train_churn” for the following questions, unless stated otherwise.


Q1 EXPLORATORY DATA ANALYSIS (12 points)
A. (6points) Create the boxplots of the response variable Churn against the following predictors:

i. AverageViewingDuration; ii) ContentDownloadsPerMonth; and iii) MonthlyCharges.

Interpret each plot.

## Your code here...
boxplot(AverageViewingDuration~Churn, data=train_churn, ylab="AverageViewingDuration", xlab ="Ch
urn")




file:///C:/Users/shani/Downloads/Spring2024_midterm_2_R_solutions.html 3/21

Document information

Uploaded on
October 7, 2026
Number of pages
21
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$18.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
wisenurse
5.0
(1)
Sold
48
Followers
2
Items
1272
Last sold
21 hours ago




Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions