hw5 soln.pdf - THE UNIVERSITY OF ILLINOIS Department of...

This preview shows page 1 - 3 out of 8 pages.

THE UNIVERSITY OF ILLINOIS Department of Statistics STAT 425 - S1U Applied Regression and Design Homework 5 Solutions Fall 2014 Problem 1 (a) > mydata=read.table("destroyers.dat",header=T) > model1=lm(log(Displacement)~Length+Beam,data=mydata) > summary(model1) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 4.6504403 0.1299365 35.790 < 2e-16 *** Length 0.0039436 0.0009044 4.361 0.000141 *** Beam 0.0352421 0.0066055 5.335 9.04e-06 *** --- Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1 Residual standard error: 0.1487 on 30 degrees of freedom Multiple R-squared: 0.967,Adjusted R-squared: 0.9648 F-statistic: 439 on 2 and 30 DF, p-value: < 2.2e-16 (b) > model2=lm(log(Displacement)~Length+Beam+I(Length^2)+I(Beam^2)+Length*Beam,data=mydata) > summary(model2) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 2.919e+00 4.639e-01 6.292 9.84e-07 *** Length 6.895e-04 5.723e-03 0.120 0.90500 Beam 1.569e-01 4.459e-02 3.520 0.00155 ** I(Length^2) 4.801e-05 2.683e-05 1.789 0.08481 . I(Beam^2) 2.844e-03 1.524e-03 1.866 0.07290 . Length:Beam -8.733e-04 4.175e-04 -2.092 0.04601 * --- Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1 Residual standard error: 0.08167 on 27 degrees of freedom Multiple R-squared: 0.991,Adjusted R-squared: 0.9894 1
F-statistic: 596.5 on 5 and 27 DF, p-value: < 2.2e-16 (c) Based on the summary in part (b), Beam and Length*Beam turns out to be significant at the 5% significant level. We can remove the insignificant terms Length^2 and Beam^2 . However, although Length is not significant, we can’t remove it because of hierarchy. Since the higher- degree term Length*Beam is significant, we have to keep Length in our model. (d) > anova(model1,model2) Analysis of Variance Table Model 1: log(Displacement) ~ Length + Beam Model 2: log(Displacement) ~ Length + Beam + I(Length^2) + I(Beam^2) + Length * Beam Res.Df RSS Df Sum of Sq F Pr(>F) 1 30 0.66311 2 27 0.18009 3 0.48303 24.14 8.388e-08 *** Based on the above result, we should reject the reduced model and use the full model.

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture