{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

7406_Solution2

# 7406_Solution2 - ISyE 7406 Spring-2007 Instructor...

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

ISyE 7406, Spring-2007 Instructor: Kwok-Leung Tsui Assignment # 2 (Solution) Question 1: Sample commands in R: Best Subset: regsubset, leaps Ridge Regression: lm.ridge Best Subset R Output: Call: lm(formula = y.train ., data = x.train[, best1\$which[9, ]]) Residuals: Min 1Q Median 3Q Max -1.58852 -0.44174 0.01304 0.52613 1.93127 Coefficients: Estimate Std. Error t value Pr( > | t | ) (Intercept) 2.49489 0.09316 26.780 < 2e-16 *** lcavol 0.73971 0.09318 7.938 4.14e-11 *** lweight 0.36670 0.10237 3.582 0.000658 *** Signif. codes: 0 ’***’ 0.001 ’**’ 0.01 ’*’ 0.05 ’.’ 0.1 ’ ’ 1 Residual standard error: 0.7613 on 64 degrees of freedom Multiple R-Squared: 0.6148, Adjusted R-squared: 0.6027 F-statistic: 51.06 on 2 and 64 DF, p-value: 5.54e-14 Cross Validation Results: (may different from the book) Subset size 1 2 3 4 Average Prediction Error 0.7094301 0.6172499 0.6082169 0.5888468 Standard Error 0.1446 0.1564 0.1425 0.1208 Subset size 5 6 7 8 Average Prediction Error 0.6148808 0.5841840 0.5939956 0.6188241 Standard Error 0.1151 0.1033 0.1355 0.1351 Ridge Regression R Output:(may different from the book) Intercept lcavol lweight age lbph svi lcp gleason pgg45 2.47 0.356 0.243 -0.023 0.151 0.212 0.0420 0.049 0.116 For cross-validation, you can refer to the following picture.(may different from the book) 1

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

View Full Document
10 20 30 40 0.3 0.4 0.5
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}