STAT 333 Discussion 9 Apr 3, 2013Practice Problems1. Using only the following summary, compute the F-value correspinding to H0: (b1= b2= b4= 0|b0).Call:lm(formula = y ~ x2 + x1 + x3 + x4)Coefficients:Estimate Std. Error t value Pr(>|t|)(Intercept) 3.22524 3.58603 0.899 0.3983x2 26.60084 11.83804 2.247 0.0595x1 -0.35808 0.11470 -3.122 0.0168x3 0.97461 0.39952 2.439 0.0448x4 0.13434 0.05863 2.291 0.0557Residual standard error: 1.898 on 7 degrees of freedomMultiple R-squared: 0.771, Adjusted R-squared: 0.6402F-statistic: 5.893 on 4 and 7 DF, p-value: 0.02125You will need to use the following formulaF =(SSEreduced− SSEfull)/(dfreduced− dffull)SSEfull/dffull.To verify your result, use the following codes.> out_full= lm(y~x1+x2+x4)> out_reduced= lm(y~1)> anova(out_reduced, out_full)Analysis of Variance TableModel 1: y ~ 1Model 2: y ~ x1 + x2 + x4Res.Df RSS Df Sum of Sq F Pr(>F)1 11 110.1492 8 46.664 3 63.485 3.628 0.06437> summary(out_full)Call:lm(formula = y ~ x1 + x2 + x4)Coefficients:Estimate Std. Error t value Pr(>|t|)(Intercept) 4.16034 4.53655 0.917 0.3859x1 -0.30904 0.14368 -2.151 0.0637x2 35.93192 14.25424 2.521 0.0358x4 0.12948 0.07455 1.737 0.1206Residual standard error: 2.415 on 8 degrees of freedomMultiple R-squared: 0.5764, Adjusted R-squared: 0.4175F-statistic: 3.628 on 3 and 8 DF, p-value: 0.0643712. Suppose the simple linear model yi= b0+ b1xi+ i, for {i}ni=1iid∼ N (0, 1).(a) Find the covariance betweenˆb0andˆb1. What about the variance ofˆb0andˆb1?(b) Instead of fitting yi= b0+ b1xi+ i, suppose you fit the modelYi= b0+ b∗1(xi− ¯x) + i,where xi− ¯x are the centered variables. Find the covariance betweenˆb0andˆb∗1.(c) What do you find based on part (a) and (b)?2Solution1. > t_b3=2.439> F_b3=t_b3^2> MSE=1.898^2 # 3.602> SSE_all=MSE*7> SSE_all[1] 25.21683> MSE_b3=MSE*F_b3 # 21.430> SS_b3=MSE_b3*1> SS_b3[1] 21.4297> SSE_full=SSE_all+SS_b3 # SSE for y~x1+x2+x4> SSE_full[1] 46.64652> F_all=5.893> MSR_all=MSE*F_all # 21.229> SSR_all=MSR_all*4> SSR_all[1] 84.91587> SSE_reduce=SSE_all+SSR_all # SSE for y~1> SSE_reduce[1] 110.1327> R2=0.771> SSE_reduce=SSE_all/(1-R2) # another way to compute SSE for y~1> SSE_reduce[1] 110.1172> # Finaly use the formula for F> Fvalue=((SSE_reduce-SSE_full)/3)/(SSE_full/8)> Fvalue[1]
View Full Document