Constant leverage residuals vs factor levels 5 9 4

This preview shows page 5 - 9 out of 10 pages.

Constant Leverage: Residuals vs Factor Levels 5 9 4 The disgnostic plots are shown above. The increasing spread in the Residual vs Fitted plot and the increasing trend in the Scale-Location plot suggest a problem of heteroscedasticity of the model. (d) library (MASS) par ( mfrow= c ( 1 , 1 )) boxcox (model) 5
-2 -1 0 1 2 -80 -75 -70 -65 -60 -55 λ log-Likelihood 95% Based on the above plot, choosing λ = 0 corresponding to the logarithm transformation is appropriate. (e) model2 = lm ( log (breaks) ~ wool * tension, data = warpbreaks) summary (model2) ## ## Call: ## lm(formula = log(breaks) ~ wool * tension, data = warpbreaks) ## ## Residuals: ## Min 1Q Median 3Q Max ## -0.81504 -0.27885 0.04042 0.27319 0.64358 ## ## Coefficients: ## Estimate Std. Error t value Pr(>|t|) ## (Intercept) 3.7179 0.1247 29.824 < 2e-16 *** ## woolB -0.4356 0.1763 -2.471 0.01709 * ## tensionM -0.6012 0.1763 -3.410 0.00133 ** ## tensionH -0.6003 0.1763 -3.405 0.00134 ** ## woolB:tensionM 0.6281 0.2493 2.519 0.01514 * ## woolB:tensionH 0.2221 0.2493 0.891 0.37749 ## --- ## Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1 ## 6
## Residual standard error: 0.374 on 48 degrees of freedom ## Multiple R-squared: 0.3363, Adjusted R-squared: 0.2672 ## F-statistic: 4.864 on 5 and 48 DF, p-value: 0.001116 (f) interaction.plot (warpbreaks $ tension, warpbreaks $ wool, log (warpbreaks $ breaks)) 3.0 3.2 3.4 3.6 warpbreaks$tension mean of log(warpbreaks$breaks) L M H warpbreaks$wo A B (g) anova (model2) ## Analysis of Variance Table ## ## Response: log(breaks) ## Df Sum Sq Mean Sq F value Pr(>F) ## wool 1 0.3125 0.31253 2.2344 0.141511 ## tension 2 2.1762 1.08808 7.7792 0.001185 ** ## wool:tension 2 0.9131 0.45657 3.2642 0.046863 * ## Residuals 48 6.7138 0.13987 ## --- ## Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1 (h) From part (g), the p-value corresponding to the interaction effect is 0.0469 < 0.05. So, we conclude that the interaction effect is significant. (i) 7
Based on part (h), it is not appropriate to test for the main effects, since due to the hierarchy rule we test for the main effects only if the interaction is not significant.

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture