This is the R file of Case I - Timeless. In this file, we will first overview the data, and then run regressions for cannibalization effects.
First, please download and load data Timeless.Rdata from Canvas. The data include the following variables:
load("Timeless.Rdata")
head(timeless)
## Time Year Month Week Simplicity Classic Hipster
## 1 1 2011 1 1 3091 0 0
## 2 2 2011 1 2 3449 0 0
## 3 3 2011 1 3 3370 0 0
## 4 4 2011 1 4 3479 0 0
## 5 5 2011 1 5 3569 0 0
## 6 6 2011 2 6 3557 0 0
Next, letโs get an overview of the sales of Simplicity before and after the introduction of the Classic.
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 4.0.5
ggplot(timeless, aes(x = Time, y = Simplicity)) +
geom_line() +
geom_vline(xintercept = 100, color = "red", linetype = "dashed") +
geom_text(aes(x = 100, y = 1000,
label = "the introduction of Classic"),color = "red")
We first run a simple with the sales of Simplicity as DV and the sales of Class as IV.
mdl_1 <- lm(Simplicity ~ 1 + Classic, data = timeless)
summary(mdl_1)
##
## Call:
## lm(formula = Simplicity ~ 1 + Classic, data = timeless)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2245.5 -1338.2 -522.2 697.2 5628.8
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 4.166e+03 1.736e+02 23.995 < 2e-16 ***
## Classic 3.421e-01 4.067e-02 8.413 1.27e-14 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1832 on 178 degrees of freedom
## Multiple R-squared: 0.2845, Adjusted R-squared: 0.2805
## F-statistic: 70.78 on 1 and 178 DF, p-value: 1.268e-14
Then, we control for the week-of-the-year effects by adding Week as an IV.
mdl_2 <- lm(Simplicity ~ 1 + Classic + Week, data = timeless)
summary(mdl_2)
##
## Call:
## lm(formula = Simplicity ~ 1 + Classic + Week, data = timeless)
##
## Residuals:
## Min 1Q Median 3Q Max
## -901.10 -252.44 -4.26 194.68 1159.05
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 3181.82594 230.88917 13.781 < 2e-16 ***
## Classic 0.23432 0.01056 22.185 < 2e-16 ***
## Week2 369.79073 325.05410 1.138 0.257434
## Week3 246.37062 325.05019 0.758 0.449898
## Week4 302.56231 325.05835 0.931 0.353740
## Week5 339.76968 325.06864 1.045 0.297920
## Week6 274.08566 325.06751 0.843 0.400734
## Week7 152.80579 325.06127 0.470 0.639108
## Week8 208.53950 325.06941 0.642 0.522348
## Week9 327.91196 325.08517 1.009 0.315054
## Week10 422.51371 325.09958 1.300 0.196096
## Week11 685.31720 325.14527 2.108 0.037036 *
## Week12 26.01676 325.05310 0.080 0.936334
## Week13 -155.53645 325.04337 -0.479 0.633117
## Week14 40.82799 325.05847 0.126 0.900247
## Week15 -261.35094 325.04126 -0.804 0.422880
## Week16 -268.96545 325.04421 -0.827 0.409533
## Week17 205.58797 325.09974 0.632 0.528282
## Week18 683.75441 325.20906 2.103 0.037499 *
## Week19 1201.25576 325.36365 3.692 0.000330 ***
## Week20 1372.52259 325.40899 4.218 4.67e-05 ***
## Week21 1758.71897 325.53515 5.403 3.16e-07 ***
## Week22 2309.83158 325.75483 7.091 8.47e-11 ***
## Week23 2756.05194 351.23577 7.847 1.58e-12 ***
## Week24 2903.64168 351.24265 8.267 1.64e-13 ***
## Week25 3204.17775 351.27190 9.122 1.49e-15 ***
## Week26 3809.88179 351.39080 10.842 < 2e-16 ***
## Week27 5799.69923 351.94763 16.479 < 2e-16 ***
## Week28 6717.27349 352.19054 19.073 < 2e-16 ***
## Week29 5864.44763 351.79358 16.670 < 2e-16 ***
## Week30 4874.55470 351.48981 13.868 < 2e-16 ***
## Week31 3088.61652 351.16816 8.795 9.09e-15 ***
## Week32 1391.37696 351.08213 3.963 0.000123 ***
## Week33 -303.53878 351.19372 -0.864 0.389062
## Week34 -192.34944 351.18496 -0.548 0.584856
## Week35 27.12943 351.16327 0.077 0.938543
## Week36 154.18346 351.15536 0.439 0.661359
## Week37 108.58820 351.16144 0.309 0.757660
## Week38 236.73138 351.15127 0.674 0.501446
## Week39 278.43000 351.14860 0.793 0.429320
## Week40 569.53055 351.12534 1.622 0.107300
## Week41 884.45950 351.10625 2.519 0.013018 *
## Week42 1032.85356 351.09887 2.942 0.003885 **
## Week43 1714.52131 351.08058 4.884 3.10e-06 ***
## Week44 1952.27197 351.08107 5.561 1.53e-07 ***
## Week45 3099.79410 351.13079 8.828 7.58e-15 ***
## Week46 4788.80450 351.35658 13.629 < 2e-16 ***
## Week47 6156.93192 352.06891 17.488 < 2e-16 ***
## Week48 2389.58058 351.76387 6.793 3.89e-10 ***
## Week49 -523.03883 351.08164 -1.490 0.138778
## Week50 -735.63997 351.08833 -2.095 0.038145 *
## Week51 -576.12879 351.08042 -1.641 0.103288
## Week52 771.17974 351.25209 2.196 0.029958 *
## Week53 328.99769 398.09241 0.826 0.410119
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 459.7 on 126 degrees of freedom
## Multiple R-squared: 0.9681, Adjusted R-squared: 0.9547
## F-statistic: 72.18 on 53 and 126 DF, p-value: < 2.2e-16