library(tidyverse)
library(readxl)
rocket <- read_excel("RocketFuel.xlsx")
0. Please provide a short “executive summary” of the case. Briefly summarize the contents of the case and then summarize the results of your analysis (i.e., the answers to the 12 questions). Please limit this to two paragraphs. [4 points]
Rocket fuel, an online advertising company runs an ad campaign for their client TaskaBella, a hand bag manufacturer. Rocket Fuel needs to prove the effectiveness of their campaign and show proof of a positive ROI. They ran a controlled experiment in which the control group does not see the ad but the experimental group does. This allows Rocket fuel to see which users make a purchase from TaskaBella and whether that can be credited to the ad campaign.
1. Was the advertising campaign effective? What were the conversion rates for the campaign group and the control group? Was there a significant difference? (You should include a statistical test here, such as the chi-square test.) [8 points]
control_conversion<-(sum(rocket$test==0&rocket$converted==1)/sum(rocket$test==0))*100
print(control_conversion)
[1] 1.785411
campaign_conversion<-(sum(rocket$test==1&rocket$converted==1)/sum(rocket$test==1))*100
print(campaign_conversion)
[1] 2.554656
chi_test_table <- table(rocket$test, rocket$converted)
chi_square_test <- chisq.test(chi_test_table)
chi_square_test
Pearson's Chi-squared test with Yates' continuity correction
data: chi_test_table
X-squared = 54.006, df = 1, p-value = 1.999e-13
2. How much more money (i.e., revenue) did TaskaBella make by running the campaign, excluding advertising costs? (Hint: start with what a converted user is thought to be worth.) [15 points]
campaign_users <- sum(rocket$test == 1)
conversions <- (campaign_conversion - control_conversion) / 100 * campaign_users
campaign_revenue <- conversions * 40
campaign_revenue
[1] 173719.3
3. What was the total cost of the campaign? (Hint: Look for what the case said about approximate costs.) [8 points]
totalimpressions<-sum(rocket$tot_impr)
costs<-(totalimpressions*9/1000)
costs
[1] 131374.6
4. Calculate the return on investment (ROI) of the campaign. You can report ROI as a percentage. Was the campaign profitable? You can use the numbers from previous questions to help calculate ROI. [10 points]
campaign_earnings<-conversions*40
total_profit<-campaign_earnings-costs
total_profit
[1] 42344.65
total_roi<-(total_profit/costs)*100
total_roi
[1] 32.23198
5. What was the opportunity cost of including a control group? In other words, how much more could have TaskBella made not having a control group at all? [15 points]
total_users <- sum(rocket$test == 1) + sum(rocket$test == 0)
total_conversions <- (campaign_conversion - control_conversion) / 100 * total_users
total_revenue <- total_conversions * 40
total_revenue
[1] 180957.6
total_profits<-(total_revenue-costs)
total_return<-(total_profits/costs)*100
total_return
[1] 37.74164
campaign_impressions <- sum(rocket$tot_impr[rocket$test == 1])
campaign_costs <- (campaign_impressions/1000)*9
campaign_costs
[1] 126132.3
campaign_profit <- campaign_earnings - campaign_costs
campaign_roi <- (campaign_profit/campaign_costs)
campaign_roi
[1] 0.3772783
opportunity_cost <- (campaign_roi-total_return)
opportunity_cost
[1] -37.36436
6. Create a new dataframe (a tibble) of conversion rates as a
function of the test condition and the number of ads displayed to users.
For impressions, you can use the pre-calculated bins variable for
impressions, tot_impr_bins. Conversion rate means the
percentage of unique users who made a purchase. You can use
group_by() and summarize() to construct the
new tibble. You also will probably want to convert test and
tot_impr_bins to factor variables. Save your new tibble as
rocket.plot to use for the next question. (Hint: it should
have 22 rows.) [18 points]
7. Plot conversion rates in your rocket.plot
tibble. Use ggplot() and the geom_col() geom
option, making sure your plot employs both the
tot_impr_bins and test variables. You will
probably also want to use position="dodge" in building your
plot. Update the names of the axes to be clearer. [15
points]
1 + 1
[1] 2
8. What can you infer from the chart created for the previous question? In what region does it look like advertising is most effective? [5 points]
1 + 1
[1] 2
9. What does your answer to the previous question imply for the design of the next campaign assuming that consumer response would be similiar? (Note: this is a fairly open-ended question. A few sentences of discussion, with justification, is sufficient.) [5 points]
1 + 1
[1] 2
10. Create a chart with the conversion rate for the control
group and the “treated” group as a function of the day of week when they
were shown the most impressions. The group_by() logic you
used earlier can be applied here to day and
test. You might also want to convert day to a
factor variable and reorder it. What do you observe? [15
points]
1 + 1
[1] 2
11. Create the same chart for hours within a day, excluding
the period between midnight and 8 am. (Hint: you will likely find the
filter() and group_by() functions helpful
here.) [12 points]
1 + 1
[1] 2
12. During what hours is advertising most/least effective? Defend your answer. (Note: this is a fairly open-ended question. A few sentences of discussion, with justification, is sufficient.) [10 points]
1 + 1
[1] 2