{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

420Hw08ans - STAT 420(10 points(due Friday March 28 by 4:00...

This preview shows pages 1–5. Sign up to view the full content.

STAT 420 Spring 2008 Homework #8 (10 points) (due Friday, March 28, by 4:00 p.m.) 1. For the prostate data, fit a model with lpsa as the response and the other variables as predictors. a) Implement the Backward Elimination variable selection method to determine the “best” model. Use α crit = 0.05. ( 8.1 (a) ) > library(faraway) > data(prostate) > attach(prostate) > fit = lm(lpsa~lcavol+lweight+age+lbph+svi+lcp+gleason+pgg45) > summary(fit) Call: lm(formula = lpsa ~ lcavol + lweight + age + lbph + svi + lcp + gleason + pgg45) Residuals: Min 1Q Median 3Q Max -1.7331 -0.3713 -0.0170 0.4141 1.6381 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.669337 1.296387 0.516 0.60693 lcavol 0.587022 0.087920 6.677 2.11e-09 *** lweight 0.454467 0.170012 2.673 0.00896 ** age -0.019637 0.011173 -1.758 0.08229 . lbph 0.107054 0.058449 1.832 0.07040 . svi 0.766157 0.244309 3.136 0.00233 ** lcp -0.105474 0.091013 -1.159 0.24964 gleason 0.045142 0.157465 0.287 0.77503 pgg45 0.004525 0.004421 1.024 0.30886 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 0.7084 on 88 degrees of freedom Multiple R-squared: 0.6548, Adjusted R-squared: 0.6234 F-statistic: 20.86 on 8 and 88 DF, p-value: < 2.2e-16 gleason is the least significant variable, p-value = 0.77503. > fit1 = update(fit, .~. - gleason)

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
> summary(fit1) Call: lm(formula = lpsa ~ lcavol + lweight + age + lbph + svi + lcp + pgg45) Residuals: Min 1Q Median 3Q Max -1.73117 -0.38137 -0.01728 0.43364 1.63513 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.953926 0.829439 1.150 0.25319 lcavol 0.591615 0.086001 6.879 8.07e-10 *** lweight 0.448292 0.167771 2.672 0.00897 ** age -0.019336 0.011066 -1.747 0.08402 . lbph 0.107671 0.058108 1.853 0.06720 . svi 0.757734 0.241282 3.140 0.00229 ** lcp -0.104482 0.090478 -1.155 0.25127 pgg45 0.005318 0.003433 1.549 0.12488 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 0.7048 on 89 degrees of freedom Multiple R-squared: 0.6544, Adjusted R-squared: 0.6273 F-statistic: 24.08 on 7 and 89 DF, p-value: < 2.2e-16 lcp is the least significant variable, p-value = 0.25127. > fit1 = update(fit1, .~. - lcp) > summary(fit1) Call: lm(formula = lpsa ~ lcavol + lweight + age + lbph + svi + pgg45) Residuals: Min 1Q Median 3Q Max -1.777e+00 -4.171e-01 1.733e-05 4.068e-01 1.597e+00 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.980085 0.830665 1.180 0.24116 lcavol 0.545770 0.076431 7.141 2.31e-10 *** lweight 0.449450 0.168078 2.674 0.00890 ** age -0.017470 0.010967 -1.593 0.11469 lbph 0.105755 0.058191 1.817 0.07249 . svi 0.641666 0.219757 2.920 0.00442 ** pgg45 0.003528 0.003068 1.150 0.25331 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.7061 on 90 degrees of freedom Multiple R-squared: 0.6493, Adjusted R-squared: 0.6259 F-statistic: 27.77 on 6 and 90 DF, p-value: < 2.2e-16 pgg45 is the least significant variable, p-value = 0.25331. > fit1 = update(fit1, .~. - pgg45) > summary(fit1) Call: lm(formula = lpsa ~ lcavol + lweight + age + lbph + svi) Residuals: Min 1Q Median 3Q Max -1.835049 -0.393961 0.004139 0.463365 1.578879 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.95100 0.83175 1.143 0.255882 lcavol 0.56561 0.07459 7.583 2.77e-11 *** lweight 0.42369 0.16687 2.539 0.012814 * age -0.01489 0.01075 -1.385 0.169528 lbph 0.11184 0.05805 1.927 0.057160 . svi 0.72095 0.20902 3.449 0.000854 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 0.7073 on 91 degrees of freedom Multiple R-squared: 0.6441, Adjusted R-squared: 0.6245 F-statistic: 32.94 on 5 and 91 DF, p-value: < 2.2e-16 age is the least significant variable, p-value = 0.169528. > fit1 = update(fit1, .~. - age) > summary(fit1) Call: lm(formula = lpsa ~ lcavol + lweight + lbph + svi) Residuals: Min 1Q Median 3Q Max -1.82653 -0.42270 0.04362 0.47041 1.48530 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.14554 0.59747 0.244 0.80809 lcavol 0.54960 0.07406 7.422 5.64e-11 *** lweight 0.39088 0.16600 2.355 0.02067 * lbph 0.09009 0.05617 1.604 0.11213 svi 0.71174 0.20996 3.390 0.00103 **

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
--- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 0.7108 on 92 degrees of freedom Multiple R-squared: 0.6366, Adjusted R-squared: 0.6208 F-statistic: 40.29 on 4 and 92 DF, p-value: < 2.2e-16 lbph is the least significant variable, p-value = 0.11213.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern