# HW5.Solutions.4051.Fall.2018.pdf -...

• Homework Help
• 16
• 100% (5) 5 out of 5 people found this document helpful

This preview shows page 1 - 4 out of 16 pages.

#### Call:## lm(formula = buy ~ adjusted.feel * show.type)#### Residuals:##Min1QMedian3QMax## -1.7400 -0.5593 -0.43420.48522.6400#### Coefficients:##Estimate Std. Error t value Pr(>|t|)## (Intercept)3.18180.82023.8790.0011 **## adjusted.feel0.21460.68090.3150.7563## show.type-0.54550.5187-1.0510.3069## adjusted.feel:show.type-0.59460.4684-1.2690.2204## ---## Signif. codes:0***0.001**0.01*0.05.0.11#### Residual standard error: 1.217 on 18 degrees of freedom## Multiple R-squared:0.3517, Adjusted R-squared:0.2436## F-statistic: 3.255 on 3 and 18 DF,p-value: 0.04592Since there is no statistically significant interaction between the adjusted covariate and the treatment, wewill go with a parallel lines model.#Step 4 - Create the parallel lines model.model.2<-lm(buy~adjusted.feel+show.type)summary(model.2)#### Call:## lm(formula = buy ~ adjusted.feel + show.type)#### Residuals:##Min1QMedian3QMax## -1.8002 -0.7633 -0.18110.62692.8005#### Coefficients:##Estimate Std. Error t value Pr(>|t|)## (Intercept)3.18180.83333.8180.00116 **## adjusted.feel-0.60060.2299-2.6130.01711 *## show.type-0.54550.5270-1.0350.31368## ---## Signif. codes:0***0.001**0.01*0.05.0.11#### Residual standard error: 1.236 on 19 degrees of freedom## Multiple R-squared:0.2936, Adjusted R-squared:0.2193## F-statistic: 3.949 on 2 and 19 DF,p-value: 0.0368Show.type does not influence buying. Show.type influenced feelings (model.0) and once we corrected forfeelings, there was no difference due to show.type.2
Productivityproductivity <-read.csv("~/Documents/STAT 4051 Fall 2018/Data/productivity.csv")attach(productivity)a.#Check to see if the treatment affects the covariatemodel.0<-lm(Prior.Year.Productivity~Expenditures,data=productivity)anova(model.0)## Analysis of Variance Table#### Response: Prior.Year.Productivity##Df Sum Sq Mean Sq F valuePr(>F)## Expenditures2 91.00645.50396.525 3.341e-12 ***## Residuals24 11.3140.471## ---## Signif. codes:0***0.001**0.01*0.05.0.11#The treatment affects the covariate, therefore we will need to adjustadjusted.Productivity<-residuals(model.0)#We test the treatment by covariate interaction#Model with covariate, treatment and covariate:treatment to see if parallel lines or separate lines is tmodel.1<-lm(Productivity~adjusted.Productivity*Expenditures,data=productivity)anova(model.1)## Analysis of Variance Table#### Response: Productivity##DfSum Sq Mean Sq F valuePr(>F)## adjusted.Productivity1 14.0447 14.0447 308.132 5.007e-14## Expenditures2 20.1252 10.0626 220.767 7.930e-15## adjusted.Productivity:Expenditures20.36040.18023.9530.03491## Residuals210.95720.0456#### adjusted.Productivity