New User Special Price Expires in

Let's log you in.

Sign in with Facebook


Don't have a StudySoup account? Create one here!


Create a StudySoup account

Be part of our community, it's free to join!

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here


by: ? ?


Marketplace > 200 > ECON > ECON484HW4
? ?

GPA 3.3

Almost Ready


These notes were just uploaded, and will be ready to view shortly.

Purchase these notes here, or revisit this page.

Either way, we'll remind you when they're ready :)

Preview These Notes for FREE

Get a free preview of these Notes, just enter your email below.

Unlock Preview
Unlock Preview

Preview these materials now for free

Why put in your email? Get access to more of this material and other relevant free materials for your school

View Preview

About this Document

Test Prep (MCAT, SAT...)
75 ?




Popular in micro

Popular in 200

This 8 page Test Prep (MCAT, SAT...) was uploaded by ? ? on Monday May 4, 2015. The Test Prep (MCAT, SAT...) belongs to ECON at a university taught by knox in . Since its upload, it has received 22 views.


Reviews for ECON484HW4


Report this Material


What is Karma?


Karma is the currency of StudySoup.

You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 05/04/15
Xiling Shen 1238124 Econ 484 HW 4 Chapter 6 Exercise 2 a iii is correct Because Lasso is a more constrained model than least squares it has potential of reducing overfitting and variance in predictions As long as the increase in bias does is less than the decrease in variance it will outperform the least squares method which could include many irrelevant predictors b iii is correct Although ridge regression is not as restrictive as Lasso it still more restrictive than least squares and thus reduce the possibility of overfitting and variance in predictions c ii is correct Nonlinear method is more flexible than the linear method Besides it is more sensitive to the data Thus in order to perform well its accuracy of bias will drop a little accordingly Chapter 7 Exercise 3 gt x 22 gt y 1 x 2 x1quot2 lxgt1 gt p0tX y 53 m F 53 F i 39l 33quot E E Egi C E n l 2 TI 8 gt ibrarySLR gt attachAuto gt setseed10 gt pairsAuto 31 E H ll gt fit lmwagepolyage4 data Wage gt fit1 lmmpgpolydisplacement2 data Auto gt fit1 mmpghorsepower data Auto gt fit2 lmmpgpolyhorsepower2 data Auto gt fit2 mmpgpolyhorsepower3 data Auto gt fit3 lmmpgpolyhorsepower4 data Auto gt fit4 mmpgpolyhorsepower5 data Auto gt fit5 lmmpgpolyhorsepower6 data Auto gt anovafit1fit2fit3fit4fit5 Analysis of Variance Table Model 1 mpg horsepower Model 2 mpg polyhorsepower 3 Model 3 mpg polyhorsepower 4 Model 4 mpg polyhorsepower 5 Model 5 mpg polyhorsepower 6 ResDf RSS Df Sum of Sq F PrgtF 390 93859 388 74264 2 195948 527528 lt 22e18 387 73995 1 2891 14491 0229410 388 72234 1 17815 94848 0002221 385 71503 1 7304 39326 0048068 ChbQJNA Signif codes 0 0001 001 005 01 quot 1 The p value comparing the linear Model 1 to the quadratic Model 2 is essentially zero indicating that a linear t is not sufficient Similarly the p value comparing the quadratic Mode2 to the cubic Model 3 is very low so the quadratic t is also insufficient Hence either degree4 polynomial and degree5 polynomial appear to provide reasonable fit to the data but higherorder models are not justified here 9 agt mfit lmnox polydis 3 data Boston gt summarymfit Call lmformula nox polydis 3 data Boston Residuals Min 10 Median 30 Max 0121130 0040619 0009738 0023385 0194904 Coefficients Estimate Std Error t value Prgtt Intercept 0554695 0002759 201021 lt 2e16 polydis 31 2003096 0062071 32271 lt 2e16 polydis 32 0856330 0062071 13796 lt 2e16 polydis 33 0318049 0062071 5124 427e07 Signif codes 0 0001 001 005 01 quot 1 Residual standard error 006207 on 502 degrees of freedom Multiple Rsquared 07148Adjusted Rsquared 07131 Fstatistic 4193 on 3 and 502 DF pvalue lt 22e16 gt dislim rangedis gt disgrid seqfrom dislim1 to dislim2 gt mpred predictlmfit listdis disgrid gt plotnox dis data Boston col quotdarkgreyquot gt inesdisgrid mpred col quotbluequot de 3 4 E I m E ta IE L t ID a PE 4 E a m 12 die b gt residuals repNA 10 gt for i in 110 mfit mnox polydis i data Boston residualsi sumlmfitresidualsquot2 gt residuals 1 2768563 2035262 1934107 1932981 1915290 1878257 1849484 1835630 1833331 1832171 C gt ibraryspines gt ibraryboot gt adetas repNA 8 gt for i in 18 glmfit gmnox polydis i data Boston adetasi cvgmBoston glmfit K 8deta2 gt plot1 8 adetas xlab quotDegreequot ylab quotCV errorquot type pch 10 de 2 eeee 39ll EH errir ill H335 Degree I use 8fold cross validation From the graph we can tell that the CV error is lowest at 3 and 4 I would choose 4 as my degree for the polynomial d gt librarysplines gt splinefit lmnox bsdis df 4 knots c4 7 11 data Boston gt summarysplinefit Call lmformula nox bsdis df 4 knots c4 7 11 data Boston Residuals Min 10 Median 30 Max 0124567 0040355 0008702 0024740 0192920 Coefficients Estimate Std Error t value Prgtt Intercept 073926 001331 55537 lt 2e16 bsdis df 4 knots c4 7 111 008861 002504 3539 000044 bsdis df 4 knots c4 7 112 031341 001680 18658 lt 2e16 bsdis df 4 knots c4 7 113 026618 003147 8459 300e16 bsdis df 4 knots c4 7 114 039802 004647 8565 lt 2e16 bsdis df 4 knots c4 7 115 025681 009001 2853 000451 bsdis df 4 knots c4 7 116 032926 006327 5204 285e07 Signif codes 0 0001 001 005 01 quot 1 Residual standard error 006185 on 499 degrees of freedom Multiple Rsquared O7185Adjusted Rsquared 07151 Fstatistic 2123 on 6 and 499 DF pvalue lt 22e16 gt sppred predictspfit listdis disgrid gt plotnox dis data Boston col quotdarkgreyquot gt linesdisgrid sppred col quotbluequot lwd 2 00 0 nitc 00 l 05 041 1le split the range into 4 intervals The three knots are 4 7 11 e gt crossvalidation repNA 15 gt for i in 315 lmfit lmnox bsdis df i data Boston crossvalidationi sumlmfitresidualsquot2 gt crossvalidationc1 2 1 1934107 1922775 1840173 1833966 1829884 1816995 1825653 1792535 1796992 1788999 11 1782350 1781838 1782798 RSS decreases until the df 8and then slightly increases for df 9 Finally it decreases util df 15 f gt plot315 cvc1 2 de 2 type xlab quotdfquot ylab quotCV errorquot gt cv repNA 15 gt for i in 315 mfit gmnox bsdis df i data Boston cvi cvgmBoston mfit K 8deta2 There were 50 or more warnings use warnings to see the first 50 gt plot315 cvc1 2 de 2 type xlab quotdfquot ylab quotCV errorquot 3 L E 5 L L 5 i1 7 E rah E CE E if CV error is minimum at df 10


Buy Material

Are you sure you want to buy this material for

75 Karma

Buy Material

BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.


You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

Why people love StudySoup

Steve Martinelli UC Los Angeles

"There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

Jennifer McGill UCSF Med School

"Selling my MCAT study guides and notes has been a great source of side revenue while I'm in school. Some months I'm making over $500! Plus, it makes me happy knowing that I'm helping future med students with their MCAT."

Jim McGreen Ohio University

"Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."


"Their 'Elite Notetakers' are making over $1,200/month in sales by creating high quality content that helps their classmates in a time of need."

Become an Elite Notetaker and start selling your notes online!

Refund Policy


All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email


StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here:

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.