stat_420_hw7.pdf - Problem 1(a P=sum hii = 2 2p/n=0.4 thus...

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

Problem 1(a)P=sum hii = 22p/n=0.4thus, the second observation (0.44) and the 8thobservation (0.51) has the higherleverage(b)Since it only depends on x, so it is 0.44(c)sigma2=sum(ei*ei)/8= 201.3686γ=ei/sqrt(sigma2*(1-h))[1] -0.1068182 2.0971540 -0.2166243 -0.5154164 1.6885815 -1.2623966 -0.1156867[8] 0.1187922 0.0183445 -1.2978941standardized residuals :1st: 0.10681822nd: 2.09715408th: 0.118792210th: -1.2978941(d)Di=1/P*γ^2*(hii/(1-hii))[1] 0.0007051199 1.7278073224 0.0028999260 0.0164168227 0.21302871890.0984836951[7] 0.0009125057 0.0073437906 0.0000296930 0.22389310784/n=0.4since 1.727 is unnormale, thus the 2ndis influential pointproblem 2:(a)>x=c(10.1,6.5,6.9,11.2,11.4,8.2,12.7,12.8,11.7,13.6,12.4,10.7,8.4,6.4,11.7,6.0,8.7,10.6,12.7,10.1)> y=c(160,37,24,195,365,89,1486,415,721,1362,1120,553,144,20,255,12,110,267,999,188)> fitted=lm(y~x)> summary(fitted)Call:lm(formula = y ~ x)Residuals:Min1Q Median3QMax-410.89 -236.6811.07 165.52 675.14Coefficients:Estimate Std. Error t value Pr(>|t|)(Intercept) -1097.9299.7 -3.663 0.00178 **x150.328.85.218 5.81e-05 ***---Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 300.9 on 18 degrees of freedomMultiple R-squared: 0.602,Adjusted R-squared: 0.5799F-statistic: 27.23 on 1 and 18 DF, p-value: 5.808e-05Thus, beta_0=-1097.9, beta_1=150.3, R-squared: 0.602> plot(resid(fitted)~ fitted(fitted))> abline(h = 0, col = "green", lwd = 2)the linear assumption is violated, since the residual is large, and the r-square is small.

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture