• Verkeerd document? Gratis ruilen
  • Geschreven door studenten die geslaagd zijn
  • Direct beschikbaar na je betaling
  • Online lezen of als PDF
Verkopen
Kies je studieland
Kies je taal
Document preview thumbnail
Voorbeeld 3 van de 21 pagina's
Tentamen (uitwerkingen)

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
Voorbeeld 3 van de 21 pagina's

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

Voorbeeld van de inhoud

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

Documentinformatie

Geüpload op
7 oktober 2026
Aantal pagina's
21
Geschreven in
2026/2027
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden
$18.99

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
wisenurse
5.0
(1)
Verkocht
48
Volgers
2
Items
1278
Laatst verkocht
22 uur geleden




Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen