Assignment M10
Name: Aiza K
The owners of the LA Dodgers would like an estimate of the benefit (to attendance) of any kind of promotion (including fireworks) after adjusting for day of the week and month. Please provide this estimate.
lad <- read.csv("~/datascience/lad.CSV")
View(lad)
lad$pro <- rep("yes", 81)
lad$pro[lad$Cap == "NO" & lad$Shirt == "NO" & lad$Fireworks == "NO" & lad$Bobblehead == "NO"] <- "no"
lad$typeday <- rep("weekday", 81)
lad$typeday[lad$Day_of_week == "Saturday" | lad$Day_of_week == "Sunday"] <- "weekend"
model <- lm(Attend ~ typeday + Month + pro, lad)
model
##
## Call:
## lm(formula = Attend ~ typeday + Month + pro, data = lad)
##
## Coefficients:
## (Intercept) typedayweekend MonthAug MonthJul
## 35774.0 4709.0 2574.3 4122.7
## MonthJun MonthMay MonthOct MonthSep
## 5627.5 -1871.5 929.6 -859.6
## proyes
## 6744.6
After adjusting for day of the week and the month, having any kind of promotion results in a predicted attendance 6744 people higher than when there is no promotion.