HW5 Solution.docx - Solution to HW#5 HW 4 Exercises 3.15...

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

Solution to HW #5HW 4: Exercises 3.15, 3.16 (b), 3.23, 4.14, 4.15, 4.223.15 (a) Use R to fit the linear regression.> cc <- read.table('CH03PR15.txt')> colnames(cc) <- c("Y","X")> lm.cc <- lm(Y~X,data=cc)> summary(lm.cc)Call:lm(formula = Y ~ X, data = cc)Residuals:Min 1Q Median 3Q Max -0.5333 -0.4043 -0.1373 0.4157 0.8487 Coefficients:Estimate Std. Error t value Pr(>|t|) (Intercept) 2.5753 0.2487 10.354 1.20e-07 ***X -0.3240 0.0433 -7.483 4.61e-06 ***---Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1Residual standard error: 0.4743 on 13 degrees of freedomMultiple R-squared: 0.8116,Adjusted R-squared: 0.7971 F-statistic: 55.99 on 1 and 13 DF, p-value: 4.611e-06(b) > require(alr3)> pureErrorAnova(lm.cc)Analysis of Variance TableResponse: YDf Sum Sq Mean Sq F value Pr(>F) X 1 12.5971 12.5971 800.325 7.080e-11 ***Residuals 13 2.9247 0.2250 Lack of fit 3 2.7673 0.9224 58.603 1.194e-06 ***Pure Error 10 0.1574 0.0157 ---Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1H_0: E[Y] = a + bX; H_a: E[Y] a + bX.
F statistics is 58.603. F(.975, 3, 10) = 4.825621. The null hypothesis is rejected.(c) Part(b) is not enough to tell us what regression function is appropriate. It only tells us that linear regression is not a good choice. (To obtain a good model, we may

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture