Docsity

The Linear Model: Multiple Regression - Regression Analysis | ISYE 6414, Study notes of Systems Engineering

Toggle sidebar
bg1
ISYE 6414 - Spring 2009
Solution lecture 5
The Linear Model: Multiple Regression
Problem 6.1 Pag.248
1.
X= 1 X11 X11X12
1X21 X21X22
1X31 X31X32
1X41 X41X42
βT= (β0, β1, β2).
2.
X= 1 X11 X12
1X21 X22
1X31 X32
1X41 X42
βT= (β0, β1, β2).
Problem 6.2 Pag.248
1.
X= 1 X11 X12 X2
11
1X21 X22 X2
21
1X31 X32 X2
31
1X41 X42 X2
41
1X51 X52 X2
51
βT= (β0, β1, β2, β3).
2.
X= 1 X11 log10 X12
1X21 log10 X22
1X31 log10 X32
1X41 log10 X42
1X51 log10 X52
βT= (β0, β1, β2).
Problem 6.3 Pag.248 A good model should explain the response well with a small set of predic-
tors.
Problem 6.4 Pag.248 Because r12 measures the linear relation between Yand X, so its sign is
the same as the slope sign. However, in the multiple correlation R, there are several variables.
Problem 6.22 Pag.253
1. Yes
2. No. But making Y0= log Y, the model is linear. Y0
i=β0+β1Xi1+β2X2
i2+0
i. Where
0
i= log i.
1
pf3
pf4
pf5

Partial preview of the text

Download The Linear Model: Multiple Regression - Regression Analysis | ISYE 6414 and more Study notes Systems Engineering in PDF only on Docsity!

ISYE 6414 - Spring 2009

Solution lecture 5

The Linear Model: Multiple Regression

Problem 6.1 Pag.

X = 1 X 11 X 11 X 12

1 X 21 X 21 X 22

1 X 31 X 31 X 32

1 X 41 X 41 X 42

 β

T (^) = (β 0 , β 1 , β 2 ).

X = 1 X 11 X 12

1 X 21 X 22

1 X 31 X 32

1 X 41 X 42

 β

T (^) = (β 0 , β 1 , β 2 ).

Problem 6.2 Pag.

X = 1 X 11 X 12 X 112

1 X 21 X 22 X 212

1 X 31 X 32 X 312

1 X 41 X 42 X 412

1 X 51 X 52 X 512

βT^ = (β 0 , β 1 , β 2 , β 3 ).

X = 1 X 11 log 10 X 12 1 X 21 log 10 X 22 1 X 31 log 10 X 32 1 X 41 log 10 X 42 1 X 51 log 10 X 52

βT^ = (β 0 , β 1 , β 2 ).

Problem 6.3 Pag.248 A good model should explain the response well with a small set of predic- tors.

Problem 6.4 Pag.248 Because r 12 measures the linear relation between Y and X, so its sign is the same as the slope sign. However, in the multiple correlation R, there are several variables.

Problem 6.22 Pag.

  1. Yes
  2. No. But making Y ′^ = log Y , the model is linear. Y (^) i′ = β 0 + β 1 Xi 1 + β 2 X i^22 + ′ i. Where ′ i = log i.
  1. Yes. Y (^) i′ = β′ 1 + log 10 Xi 1 + β 2 Xi 2 + i.
  2. No. It cannot be transformed into a general linear regression model.
  3. No. Making Y ′^ = ln(Y (^) i− 1 − 1) = β 0 + β 1 Xi 1 + i

Problem 6.23 Pag.

  1. For the OLS estimation we have to minimize W w.r.t. β 1 and β 2 , where:

W =

∑^ n

i=

(Yi − β 1 Xi 1 − β 2 Xi 2 )^2

. That is:

(b 1 , b 2 ) = argmin(β 1 , β 2 )W (1)

Taking derivatives:

d W dβ 1

∑^ n

i=

Xi 1 (Yi − β 1 Xi 1 − β 2 Xi 2 ) = 0 (2)

d W dβ 2

∑^ n

i=

Xi 2 (Yi − β 1 Xi 1 − β 2 Xi 2 ) = 0 (3)

Then:

b 1 =

YiXi 2

Xi 1 Xi 2 −

YiXi 2

X i^22 (

Xi 1 Xi 2 )^2 −

X i^21

X i^22

b 2 =

YiXi 1

Xi 1 Xi 2 −

YiXi 1

X i^21 (

Xi 1 Xi 2 )^2 −

X i^21

X i^22

  1. The likelihood function can be written as:

L =

2 πσ^2

) n 2 exp

[

2 σ^2

∑^ n

i=

(Yi − β 1 Xi 1 − β 2 Xi 2 )^2

]

Then, the log-likelihood:

l = ln L = n 2

ln

2 πσ^2

2 σ^2

∑^ n

i=

(Yi − β 1 Xi 1 − β 2 Xi 2 )^2 (7)

And taking the derivatives:

d l dβ 1

σ^2

∑^ n

i=

Xi 1 (Yi − β 1 Xi 1 − β 2 Xi 2 ) = 0 (8)

d l dβ 2

σ^2

∑^ n

i=

Xi 2 (Yi − β 1 Xi 1 − β 2 Xi 2 ) = 0 (9)

And equating to zero, these are the same normal equations as in the OLS estimators.

Problem 6.26 Pag.253 Model (6.1): Yi = β 0 + β 1 Xi 1 + β 2 Xi 2 + i. The coefficient of multiple

determination is: R(^2 X 1 ,X 2 ) = 1 − SSE(X 1 ,X 2 ) SST O. If we construct the linear model Yi = β 0 ∗ + β 1 ∗ Yˆi + ∗ i , then the coefficient of simple determination is:

R^2 (Y,^ Yˆ^ )

SSE( Yˆ ) SST O. Notice that the total sum of squares (SSTO) is the same in both models. It remains to show that SSE(X 1 ,X 2 ) = SSE( Yˆ (^) ).

However,

b∗ 1 =

∑n i=

Yi − Y¯

) (^ ˆ

Yi − Y¯

∑n i=

Yˆi − Y¯

∑n i=

Yˆi − Y¯

ei +

Yˆi − Y¯

∑n i=

Yˆi − Y¯

∑n i=

Yˆi − Y¯

∑n i=

Yˆi − Y¯

And then, b∗ 0 = Y¯ − Y¯ = 0. this impliest that: Yˆ = Yˆ ∗, and:

SSE(X 1 ,X 2 ) =

∑^ n

i=

Yi − Yˆi

∑^ n

i=

Yi − Yˆ ∗i

= SSE( Yˆ ) ⇒ (20)

R^2 (X 1 ,X 2 ) = R^2 (Y, Yˆ ) (21)

Problem 6.27 Pag.254 Defining in R the matrix X and the vector Y:

one=as.matrix(one) x=as.matrix(one,x) x=matrix(x,ncol=3,nrow=6) y=data$y

  1. xtxi=solve(t(x)%%x) b=xtxi%%t(x)%*%y

    b [,1] [1,] 33. [2,] 2. [3,] -0.

  2. yhat=x%*%b e=y-yhat

    e [,1] [1,] -2. [2,] -1. [3,] -1. [4,] -1. [5,] -0. [6,] 6.

  3. H=x%%xtxi%%t(x)

    H

[,1] [,2] [,3] [,4] [,5] [,6]

[1,] 0.23143293 0.25167585 0.21178735 0.1488684 -0.05475543 0.

[2,] 0.25167585 0.31240459 0.09437844 0.2662773 -0.14787283 0.

[3,] 0.21178735 0.09437844 0.70442026 -0.3191744 0.10446672 0.

[4,] 0.14886839 0.26627729 -0.31917435 0.6142563 0.14143492 0.

[5,] -0.05475543 -0.14787283 0.10446672 0.1414349 0.94039955 0.

[6,] 0.21099091 0.22313666 0.20412159 0.1483374 0.01632707 0.

  1. SSR=t(yhat-ybar)%*%(yhat-ybar)

    SSR [,1] [1,] 3009.

  2. MSE=(5var(y)-SSR)/ s_b=MSExtxi

    s_b [,1] [,2] [,3] [1,] 715.47114 -34.1589166 -13. [2,] -34.15892 1.6616664 0. [3,] -13.59494 0.6440674 0.

  3. x_h=c(1,10,30) y_h=t(x_h)%*%b

    y_h [,1] [1,] 53.

  4. s_y_h=t(x_h)%%s_b%%x_h

    s_y_h [,1] [1,] 5.