420Hw08ans - STAT 420 Spring 2009 Homework#8(10 points(due...

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

View Full Document Right Arrow Icon
STAT 420 Spring 2009 Homework #8 (10 points) (due Monday, April 6, by 4:30 p.m.) 1. 6.12 E ( Y | X ) = β 1 X + β 2 X 2 V ( Y | X ) = I σ 2 , σ 2 > 0 a) Y = - 44 38 11 1 12 8 , X = - - 2 2 1 0 1 1 , X 2 = 4 4 1 0 1 1 . X = - - 4 4 1 0 1 1 2 2 1 0 1 1 , X T X = = 35 1 1 11 4 3 3 2 x x x x , ( X T X ) 1 = - - 11 1 1 35 384 1 , X T Y = = 359 27 2 y x y x . β ˆ = ( X T X ) 1 X T Y = 3922 586 384 1 . 1 β ˆ = 586 / 384 1.526042 , 2 β ˆ = 3922 / 384 10.213542 . OR > x <- c(-1,1,0,1,-2,2) > y <- c(8,12,-1,11,38,44) > x2 <- x*x > x2 [1] 1 1 0 1 4 4 > Xmatr <- cbind(x,x2) > Xmatr x x2 [1,] -1 1 [2,] 1 1 [3,] 0 0 [4,] 1 1 [5,] -2 4 [6,] 2 4
Background image of page 1

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

View Full DocumentRight Arrow Icon
> solve(t(Xmatr)%*%Xmatr) %*% t(Xmatr) %*% y [,1] x 1.526042 x2 10.213542 OR To fit the model without β 0 use > fit <- lm(y ~ x + x2 - 1 ) or > fit <- lm(y ~ x + x2 + 0 ) > summary(fit) Call: lm(formula = y ~ x + x2 - 1) Residuals: 1 2 3 4 5 6 -0.68750 0.26042 -1.00000 -0.73958 0.19792 0.09375 Coefficients: Estimate Std. Error t value Pr(>|t|) x 1.5260 0.2206 6.918 0.00229 ** x2 10.2135 0.1237 82.591 1.29e-07 *** --- Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 Residual standard error: 0.7307 on 4 degrees of freedom Multiple R-Squared: 0.9994, Adjusted R-squared: 0.9991 F-statistic: 3473 on 2 and 4 DF, p-value: 3.313e-07 > fit$coefficients x x2 1.526042 10.213542 b) > sum(fit$residuals^2) [1] 2.135417 #SSE Without β 0 in the model, SSTotal = Y T Y = Σ y 2 . > sum(y^2) [1] 3710 #SSTotal
Background image of page 2
Without β 0 in the model, dfTotal = n = 6. Without β 0 in the model, SSRegr = Y Y ˆ ˆ T = 2 ˆ y . > sum(fit$fitted.values^2) [1] 3707.865 Source SS df MS F Regression 3707.864583 2 1853.9323 3472.73 Error (Residual) 2.135417 4 0.533854 Total 3710 6 c) F 0.05 ( 2 , 4 ) = 6.94 . Reject H 0 : β 1 = β 2 = 0 at α = 0.05. d) Construct a 95% prediction interval for Y. X 0 = – 0.5. Y ˆ = 586 / 384 ( 0.5 ) + 3922 / 384 ( 0.5 ) 2 1.7903646 . > fit$coefficients %*% c(-0.5,(-0.5)^2) [,1] [1,] 1.790365 > predict.lm(fit,data.frame(x=-0.5,x2=0.25),interval=c("prediction"),level=0.95) fit lwr upr 1 1.790365 -0.2636835 3.844413 OR > fit2 = lm(y ~ x + I(x^2) + 0) > > predict.lm(fit2,data.frame(x=-0.5),interval=c("prediction"),level=0.95) fit lwr upr 1 1.790365 -0.2636835 3.844413
Background image of page 3

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

View Full DocumentRight Arrow Icon
2. The data in the table below came from a recent time study of a sample of 15 employees performing a particular task on an automobile assembly line. Time to Assemble,
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/27/2009 for the course STAT 420 taught by Professor Stepanov during the Spring '08 term at University of Illinois at Urbana–Champaign.

Page1 / 15

420Hw08ans - STAT 420 Spring 2009 Homework#8(10 points(due...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online