Question 1

## 
## Call:
## lm(formula = total_riders ~ as.factor(mnth) + as.factor(Promotion) + 
##     as.factor(weekday) + poly(windspeed, 8, raw = T) + as.factor(weathersit), 
##     data = bk)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4925.2  -429.5    87.1   505.5  3521.3 
## 
## Coefficients:
##                                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                  -7.066e+02  2.986e+03  -0.237 0.813003    
## as.factor(mnth)2              3.707e+02  1.609e+02   2.304 0.021514 *  
## as.factor(mnth)3              1.520e+03  1.568e+02   9.692  < 2e-16 ***
## as.factor(mnth)4              2.316e+03  1.588e+02  14.585  < 2e-16 ***
## as.factor(mnth)5              3.015e+03  1.568e+02  19.226  < 2e-16 ***
## as.factor(mnth)6              3.330e+03  1.586e+02  20.997  < 2e-16 ***
## as.factor(mnth)7              3.100e+03  1.584e+02  19.570  < 2e-16 ***
## as.factor(mnth)8              3.224e+03  1.571e+02  20.517  < 2e-16 ***
## as.factor(mnth)9              3.508e+03  1.587e+02  22.098  < 2e-16 ***
## as.factor(mnth)10             3.051e+03  1.588e+02  19.218  < 2e-16 ***
## as.factor(mnth)11             1.900e+03  1.594e+02  11.922  < 2e-16 ***
## as.factor(mnth)12             1.187e+03  1.577e+02   7.529 1.57e-13 ***
## as.factor(Promotion)1         2.165e+03  6.500e+01  33.303  < 2e-16 ***
## as.factor(weekday)1           1.800e+02  1.203e+02   1.496 0.135215    
## as.factor(weekday)2           4.309e+02  1.207e+02   3.571 0.000380 ***
## as.factor(weekday)3           4.365e+02  1.212e+02   3.602 0.000338 ***
## as.factor(weekday)4           4.841e+02  1.209e+02   4.005 6.87e-05 ***
## as.factor(weekday)5           5.085e+02  1.209e+02   4.205 2.95e-05 ***
## as.factor(weekday)6           4.637e+02  1.204e+02   3.851 0.000128 ***
## poly(windspeed, 8, raw = T)1  2.009e+03  2.429e+03   0.827 0.408483    
## poly(windspeed, 8, raw = T)2 -6.731e+02  7.864e+02  -0.856 0.392342    
## poly(windspeed, 8, raw = T)3  1.192e+02  1.324e+02   0.900 0.368243    
## poly(windspeed, 8, raw = T)4 -1.267e+01  1.278e+01  -0.991 0.321980    
## poly(windspeed, 8, raw = T)5  8.185e-01  7.324e-01   1.118 0.264160    
## poly(windspeed, 8, raw = T)6 -3.094e-02  2.452e-02  -1.262 0.207426    
## poly(windspeed, 8, raw = T)7  6.221e-04  4.417e-04   1.408 0.159484    
## poly(windspeed, 8, raw = T)8 -5.102e-06  3.300e-06  -1.546 0.122536    
## as.factor(weathersit)2       -7.114e+02  6.992e+01 -10.175  < 2e-16 ***
## as.factor(weathersit)3       -2.439e+03  2.013e+02 -12.118  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 867.9 on 702 degrees of freedom
## Multiple R-squared:  0.807,  Adjusted R-squared:  0.7993 
## F-statistic: 104.8 on 28 and 702 DF,  p-value: < 2.2e-16

##                                 GVIF Df GVIF^(1/(2*Df))
## as.factor(mnth)             1.371372 11        1.014459
## as.factor(Promotion)        1.025013  1        1.012429
## as.factor(weekday)          1.094021  6        1.007516
## poly(windspeed, 8, raw = T) 1.451673  8        1.023568
## as.factor(weathersit)       1.125688  2        1.030041

Question 2

I did. I checked the variance inflation on the first iteration of my model and noticed that months and temps are colinear (which is logical). I solved this by removing temperature and just leaving months. I also found that windspeed wasn’t linear without transformations. However, by adding an 8th degree polynopmial of windspeed to the model, the relationship seems to be linear (or really close to it!)

Question 3�

September has highest ridership. If it became unreasonable cold and rainy then ridership should decrease and the coefficient should become smaller (but not as small as January)

Question 4

Promotions tend to increase the average total ridership by 2165 riders. The 30% discount seems to be working based on our observations and the model coefficient

Question 5

## 
## Call:
## lm(formula = I(log(casual)) ~ as.factor(mnth) + as.factor(Promotion) + 
##     as.factor(weekday) + poly(windspeed, 8, raw = T) + as.factor(weathersit), 
##     data = bk)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.0266 -0.1963  0.0226  0.2393  1.5585 
## 
## Coefficients:
##                                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                   5.949e+00  1.663e+00   3.577 0.000371 ***
## as.factor(mnth)2              3.710e-01  8.962e-02   4.140 3.90e-05 ***
## as.factor(mnth)3              1.412e+00  8.734e-02  16.169  < 2e-16 ***
## as.factor(mnth)4              1.810e+00  8.843e-02  20.467  < 2e-16 ***
## as.factor(mnth)5              2.023e+00  8.734e-02  23.166  < 2e-16 ***
## as.factor(mnth)6              2.017e+00  8.833e-02  22.839  < 2e-16 ***
## as.factor(mnth)7              2.025e+00  8.824e-02  22.952  < 2e-16 ***
## as.factor(mnth)8              2.031e+00  8.753e-02  23.200  < 2e-16 ***
## as.factor(mnth)9              1.971e+00  8.841e-02  22.290  < 2e-16 ***
## as.factor(mnth)10             1.731e+00  8.843e-02  19.575  < 2e-16 ***
## as.factor(mnth)11             1.264e+00  8.876e-02  14.240  < 2e-16 ***
## as.factor(mnth)12             7.913e-01  8.782e-02   9.011  < 2e-16 ***
## as.factor(Promotion)1         4.590e-01  3.620e-02  12.679  < 2e-16 ***
## as.factor(weekday)1          -6.898e-01  6.703e-02 -10.291  < 2e-16 ***
## as.factor(weekday)2          -8.139e-01  6.721e-02 -12.110  < 2e-16 ***
## as.factor(weekday)3          -8.749e-01  6.751e-02 -12.960  < 2e-16 ***
## as.factor(weekday)4          -8.142e-01  6.733e-02 -12.092  < 2e-16 ***
## as.factor(weekday)5          -5.647e-01  6.736e-02  -8.383 2.82e-16 ***
## as.factor(weekday)6           9.794e-02  6.706e-02   1.460 0.144615    
## poly(windspeed, 8, raw = T)1 -1.949e-01  1.353e+00  -0.144 0.885510    
## poly(windspeed, 8, raw = T)2  1.109e-02  4.380e-01   0.025 0.979802    
## poly(windspeed, 8, raw = T)3  6.473e-03  7.373e-02   0.088 0.930062    
## poly(windspeed, 8, raw = T)4 -1.512e-03  7.121e-03  -0.212 0.831956    
## poly(windspeed, 8, raw = T)5  1.412e-04  4.080e-04   0.346 0.729394    
## poly(windspeed, 8, raw = T)6 -6.589e-06  1.366e-05  -0.482 0.629616    
## poly(windspeed, 8, raw = T)7  1.510e-07  2.461e-07   0.614 0.539588    
## poly(windspeed, 8, raw = T)8 -1.349e-09  1.838e-09  -0.734 0.463384    
## as.factor(weathersit)2       -3.236e-01  3.894e-02  -8.308 5.01e-16 ***
## as.factor(weathersit)3       -1.572e+00  1.121e-01 -14.022  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.4834 on 702 degrees of freedom
## Multiple R-squared:  0.7833, Adjusted R-squared:  0.7747 
## F-statistic: 90.63 on 28 and 702 DF,  p-value: < 2.2e-16
## 
## Call:
## lm(formula = I(log(registered)) ~ as.factor(mnth) + as.factor(Promotion) + 
##     as.factor(weekday) + poly(windspeed, 8, raw = T) + as.factor(weathersit), 
##     data = bk)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.2262 -0.1064  0.0328  0.1557  0.9544 
## 
## Coefficients:
##                                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                   7.004e+00  1.120e+00   6.256 6.86e-10 ***
## as.factor(mnth)2              1.983e-01  6.033e-02   3.287  0.00106 ** 
## as.factor(mnth)3              4.036e-01  5.879e-02   6.864 1.47e-11 ***
## as.factor(mnth)4              6.273e-01  5.953e-02  10.538  < 2e-16 ***
## as.factor(mnth)5              7.914e-01  5.880e-02  13.460  < 2e-16 ***
## as.factor(mnth)6              8.786e-01  5.946e-02  14.778  < 2e-16 ***
## as.factor(mnth)7              8.152e-01  5.940e-02  13.723  < 2e-16 ***
## as.factor(mnth)8              8.315e-01  5.892e-02  14.112  < 2e-16 ***
## as.factor(mnth)9              9.171e-01  5.952e-02  15.409  < 2e-16 ***
## as.factor(mnth)10             7.763e-01  5.953e-02  13.042  < 2e-16 ***
## as.factor(mnth)11             6.599e-01  5.975e-02  11.044  < 2e-16 ***
## as.factor(mnth)12             4.265e-01  5.912e-02   7.215 1.41e-12 ***
## as.factor(Promotion)1         5.249e-01  2.437e-02  21.538  < 2e-16 ***
## as.factor(weekday)1           2.306e-01  4.512e-02   5.110 4.15e-07 ***
## as.factor(weekday)2           3.664e-01  4.524e-02   8.099 2.46e-15 ***
## as.factor(weekday)3           3.588e-01  4.544e-02   7.895 1.12e-14 ***
## as.factor(weekday)4           3.539e-01  4.533e-02   7.808 2.11e-14 ***
## as.factor(weekday)5           3.332e-01  4.534e-02   7.349 5.56e-13 ***
## as.factor(weekday)6           8.999e-02  4.514e-02   1.993  0.04662 *  
## poly(windspeed, 8, raw = T)1  1.074e-01  9.108e-01   0.118  0.90619    
## poly(windspeed, 8, raw = T)2 -4.088e-02  2.949e-01  -0.139  0.88976    
## poly(windspeed, 8, raw = T)3  9.577e-03  4.963e-02   0.193  0.84704    
## poly(windspeed, 8, raw = T)4 -1.399e-03  4.793e-03  -0.292  0.77041    
## poly(windspeed, 8, raw = T)5  1.169e-04  2.746e-04   0.426  0.67050    
## poly(windspeed, 8, raw = T)6 -5.332e-06  9.193e-06  -0.580  0.56207    
## poly(windspeed, 8, raw = T)7  1.229e-07  1.656e-07   0.742  0.45850    
## poly(windspeed, 8, raw = T)8 -1.114e-09  1.237e-09  -0.900  0.36833    
## as.factor(weathersit)2       -1.483e-01  2.622e-02  -5.658 2.24e-08 ***
## as.factor(weathersit)3       -9.972e-01  7.546e-02 -13.214  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.3254 on 702 degrees of freedom
## Multiple R-squared:  0.6814, Adjusted R-squared:  0.6687 
## F-statistic: 53.63 on 28 and 702 DF,  p-value: < 2.2e-16
## Warning in anova.lmlist(object, ...): models with response
## '"I(log(registered))"' removed because response differs from model 1
## Analysis of Variance Table
## 
## Response: I(log(casual))
##                              Df Sum Sq Mean Sq F value    Pr(>F)    
## as.factor(mnth)              11 361.04  32.822 140.459 < 2.2e-16 ***
## as.factor(Promotion)          1  42.80  42.803 183.170 < 2.2e-16 ***
## as.factor(weekday)            6 112.01  18.668  79.888 < 2.2e-16 ***
## poly(windspeed, 8, raw = T)   8  21.41   2.676  11.453 2.405e-15 ***
## as.factor(weathersit)         2  55.72  27.862 119.233 < 2.2e-16 ***
## Residuals                   702 164.04   0.234                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Promotions have a greater impact on registered riders than on casual riders. The t value for the promotion factor on the regression for casual riders is smaller than the t value of the same variable in the regression for registered riders. This means that promotions explain a larger portion of the variability for registered riders than for casual riders.

Qestion 6

The cost of developing and executing the promotion. Did it actually generated an economic profit or not? We would need the revenue that is due to the promotion and the cost of implementing it. The promotion was a financial success as long as it generated profits of some sort.