Part ii 5 pts write down the theoretical linear model

• Test Prep
• 19
• 100% (11) 11 out of 11 people found this document helpful

This preview shows page 13 - 19 out of 19 pages.

Part II (5 pts)Write down the theoretical linear model relating the number of cases of the product soldduring the promotional period versus the promotion type, store index, and the sale of theproduct in the preceding period.Part IV (5 pts)Run a testing procedure to see if average sales dier per promotion group after controllingfor the variation in other covariates in the model. To receive full credit, show all relevantsteps of the testing procedure.13Note:Donotincludeaninteractionteamonlyincludemaneffects.
.
Part V (5 pts)Run a testing procedure to see if promotion type 2 has the same impact as promotion type 3on sales. Run this test after controlling for the variation of all other covariates in the model.To receive full credit, show all relevant steps of the testing procedure including computingthe correct test statistic and degrees of freedom. Note the correct P-value for this test is1-pf(f.calc,?,?)=0.0003.14Ho:p↳=PtHA:Butf7SSE,==24.60,dfp=Is-8=7SSER=177.645,dfr=15-7=8fcan=(SSER-SSEF)/(dfr-dff)SSEFldff=f77.6us,-2hb0_)/24Y÷=43.ssRvalw=I-pf(43.55,1,7)=0003Rejecttoat2=-05.Concludethatpromotiontype2hasastatisticallydefend'impactthanpromotertype3onsales.
Rcode#-------------------------- Model 1model.1 <- lm(Y~Promotion)summary(model.1)anova(model.1)#-------------------------- Model 2model.2 <- lm(Y~Store+X+Promotion)summary(model.2)anova(model.2)#-------------------------- Model 3Int1 <- P1*XInt2 <- P2*Xmodel.3 <- lm(Y~Store+X+Promotion+Int1+Int2)summary(model.3)anova(model.3)#-------------------------- Model 4Prom.combine <- I(Promotion=="Prom 2")+I(Promotion=="Prom 3")model.4 <- lm(Y~Store+X+Prom.combine)summary(model.4)anova(model.4)15
Routput#-------------------------- Model 1> model.1 <- lm(Y~Promotion)> summary(model.1)Call:lm(formula = Y ~ Promotion)Coefficients:Estimate Std. Error t value Pr(>|t|)(Intercept)38.2002.26416.871 1.01e-09 ***PromotionProm 2-2.2003.202-0.6870.50511PromotionProm 3-11.0003.202-3.4350.00494 **Residual standard error: 5.063 on 12 degrees of freedomMultiple R-squared:0.5241,Adjusted R-squared:0.4448F-statistic: 6.609 on 2 and 12 DF,p-value: 0.01161> anova(model.1)Analysis of Variance TableResponse: YDf Sum Sq Mean Sq F valuePr(>F)Promotion2338.8 169.4006.6086 0.01161 *Residuals 12307.625.63316
#-------------------------- Model 2> model.2 <- lm(Y~Store+X+Promotion)> summary(model.2)Call:lm(formula = Y ~ Store + X + Promotion)Coefficients:Estimate Std. Error t value Pr(>|t|)(Intercept)16.73853.14955.315 0.001106 **StoreStore 20.39691.53510.259 0.803419StoreStore 3-0.93641.5351-0.610 0.561130StoreStore 40.99431.65670.600 0.567310StoreStore 5-1.77261.5433-1.149 0.288448X0.93640.11897.876 0.000101 ***PromotionProm 2-5.19661.2451-4.174 0.004170 **PromotionProm 3 -13.06011.2140 -10.758 1.32e-05 ***Residual standard error: 1.874 on 7 degrees of freedomMultiple R-squared:0.9619,Adjusted R-squared:0.9239F-statistic: 25.28 on 7 and 7 DF,p-value: 0.0001857> anova(model.2)Analysis of Variance TableResponse: YDf Sum Sq Mean Sq F valuePr(>F)Store465.0716.2674.6296 0.038270 *X1 138.58 138.578 39.4399 0.000412 ***Promotion2 418.16 209.080 59.5051 4.04e-05 ***Residuals724.603.51417
#-------------------------- Model 3> model.3 <- lm(Y~Store+X+Promotion+Int1+Int2)> summary(model.3)Call:lm(formula = Y ~ Store + X + Promotion + Int1 + Int2)Coefficients:Estimate Std. Error t value Pr(>|t|)(Intercept)22.41168.31872.6940.04309 *StoreStore 21.48091.85260.7990.46034StoreStore 3-0.45331.6874-0.2690.79892StoreStore 42.86672.61971.0940.32372StoreStore 5-1.26191.7408-0.7250.50103X0.93370.22644.1250.00913 **PromotionProm 2 -17.741512.5649-1.4120.21705PromotionProm 3 -19.455012.1809-1.5970.17112Int1-0.27590.5063-0.5450.60922Int20.23310.25890.9000.40922Residual standard error: 1.961 on 5 degrees of freedomMultiple R-squared:0.9703,Adjusted R-squared:0.9167F-statistic: 18.13 on 9 and 5 DF,p-value: 0.002635> anova(model.3)Analysis of Variance TableResponse: YDf Sum Sq Mean Sq F valuePr(>F)Store465.0716.2674.2310 0.072772 .