Linear Regression Problems

32
Linear Regression Problems Chapter 13 Solved Problem

description

Chapter 13. Linear Regression Problems. Solved Problem. Problem 13-1 (1 ) Note: this data applies to problems 13-1, 13-13, 13-21,13-27. Right Click here and select “open hyper link” for excel solution1. excel solution2. Problem 13-1 (2). Problem 13-1. - PowerPoint PPT Presentation

Transcript of Linear Regression Problems

Page 2: Linear Regression Problems

Problem 13-1 (1)Note: this data applies to problems 13-1, 13-13, 13-21,13-27

5

5.8 29Y

5

6.528 X

X Y XY

4 4 3

10 7

28 29

)X - (X

excel solution2

)Y - (Y 2)Y - (Y2)X - (X )Y -(Y )X - (X 2Y

X Y

65

5

76

0.6-

1.6-

10.60

0.2

0.8-

0.36

1.8-

19.36

2.56

1.440.16

6.76

3.24

0.64

0.04

6.80

1.44

1.2

0.12-

2.88

5.28

0.48

2.08

0.4

1616

1.2

15

30

4.4

42

70

2.6-

173

36

XY

25

49

49

2Y

17529.20

2)X-(X 2)Y-(Y )Y -(Y )X - (X

Right Click here and select “open hyper link” for excel solution1

Page 3: Linear Regression Problems

Problem 13-1 (2)

5655.2

0.752 )31)(721)(-(5

10.6

))(1)(-(n

)Y - )(YX - (X r

1.3 4

6.8

1

2)Y - (Y Sy

2.7 4

29.2

1n

2)X - (X Sx

n

8.529

5

n

6.528

r

..SySx

n

YY

XX

Page 4: Linear Regression Problems

Problem 13-1r = .75 , Is this statistically significant?

0Hrejecttofail:Decision5.

1.96.6614

1.299

.751

25.75

r1

2nrt4.

Hrejecttofail2.353 tIf:D.R3.

.05α2.

0ρ:H

0ρ:H1.

22

0

1

0

no relationshipNote: We should not proceed further with this regression model However the text does and it provides good examples of the calculators used in later problems.

Page 5: Linear Regression Problems

Problem 13-2 (1)Note: this data applies to problems 13-2, 13-14, 13-22,13-28

5

10.625 29

5

875.428

Y

X

XY

65

45

42

36

52

44

54

40

378

XY

X X Y Y 2X X 2

Y Y X X Y Y X Y

5 13 0.13 2.38 0.02 5.64 0.30

3 15 -1.88 4.38 3.52 19.14 -8.20

6 7 1.13 -3.63 1.27 13.14 -4.08

3 12 -1.88 1.38 3.52 1.89 -2.58

4 13 -0.88 2.38 0.77 5.64 -2.08

4 11 -0.88 0.38 0.77 0.14 -0.33

6 9 1.13 -1.63 1.27 2.64 -1.83

8 5 3.13 -5.63 9.77 31.64 -17.58

39 85 20.88 79.88 -36.38

X Y (X-X)2 (Y-Y)2

(X-X) (Y-Y)

Right click here and “Open hyper link” for the excel sol.

169

225

49

144

169

121

81

25

933

Click here for the excel sol2.

Page 6: Linear Regression Problems

Problem 13-2

7921.r

0.89- )38.3)(731)(1-(8

36.38-

))(S1)(-(n

)Y - )(YX - (X r

3.38 7

79.88

1

2)Y - (Y Sy

1.73 7

20.88

1

2)X - (X Sx

8

n

63.1085

8

n

88.439

2

y

.S

n

n

YY

XX

x

Page 7: Linear Regression Problems

Problem 13-2

.

:.5

784.489.1

2889.

1

2.4

943.1:..3

05..2

0:

0:.1

t?significanlly statistica thisIs .89r

0

22

0

1

0

iprelationshtsignifican

llystatisticaaisthereHrejectDecision

r

nrt

tifHrejecttofailRD

H

H

Page 8: Linear Regression Problems

Problems 13-2, 13-14,13-22, 13-28Excel Solution

88-0.854637152-2.630392788-0.854637152-2.630392750.0029939583-4.802215550.362856461.74251497- x

823.6795985814.5599223823.6795985814.559922305-5.00217E10.260094241.86350730819.1197604Intercept

95.0%Upper 95.0%Lower 95%Upper 95%Lower value-PStatt Error StandardtsCoefficien

79.875 7 Total

42.74850299616.49101796Residual

50.00299395123.0612745463.3839820463.38398201Regression

F ceSignificanF MSSS df

ANOVA

8 nsObservatio

91.65786096 Error Standard

80.75912962 Square R Adjusted

10.79353968 Square R

20.89080844* R Multiple

Statistics Regression

OUTPUT SUMMARY

58

96

114

134

123

76

153

135

yx

Note: this will be -.8908 since the sign of the correlation coefficient, r must agree with the slope of the

regression equation b.

Page 9: Linear Regression Problems

Problems 13-2, 13-14,13-22, 13-28Excel Solutions Cont’d

x Residual Plot

-5

0

5

0 2 4 6 8 10

x

Resid

ua

ls

x Line Fit Plot

0

10

20

0 2 4 6 8 10

x

y

y

Predicted y

RESIDUAL OUTPUT

Observation Predicted y Residuals Standard Residuals

1 10.40718563 2.592814371 1.689260834

2 13.89221557 1.107784431 0.721739617

3 8.664670659 -1.664670659 -1.084560073

4 13.89221557 -1.892215569 -1.232809292

5 12.1497006 0.850299401 0.553983922

6 12.1497006 -1.149700599 -0.749048684

7 8.664670659 0.335329341 0.218472533

8 5.179640719 -0.179640719 -0.117038857

Page 10: Linear Regression Problems

Problems 13-5, 19, 25a. Police is the independent variable and crime is the dependent variable

b. Scatter Diagram

c. Find r, the correlation coefficient Use for Syx

(not in text)

010

2030

10 15 20 25 30

Police

Cri

mes

X Y Y2 XY

15 17 -3.250 5.125 10.563 26.266 -16.656 289 255

17 13 -1.250 1.125 1.563 1.266 -1.406 169 221

25 5 6.750 -6.875 45.563 47.266 -46.406 25 125

27 7 8.750 -4.875 76.563 23.766 -42.656 49 189

17 7 -1.250 -4.875 1.563 23.766 6.094 49 119

12 21 -6.250 9.125 39.063 83.266 -57.031 441 252

11 19 -7.250 7.125 52.563 50.766 -51.656 361 209

22 6 3.750 -5.875 14.063 34.516 -22.031 36 132

146 95 241.500 290.875 -231.750 1419 1502

X X Y Y 2X X 2

Y Y X X Y Y

Page 11: Linear Regression Problems

Problems 13-5, 19, 25 Cont’d

14618.25

8X 95

11.8758

Y

241.55.874

7xs

XY S1)S(n

)Y)(YX(X

r

290.8756.446

7ys

231.750.874

(8 1)(5.874)(6.446)r

a high association with an inverse relationship.Test for statistical significance – see problems 13-7 and 13-8 for examples1. H0 : ρ ≥ 0

2. H1 : ρ < 0

3. Test Statistics – r – t4. α = .055. Decision Rule: Fail to reject H0 if t > -1.943

6.

7. Statistical Decisions : Reject H0

8. Management Conclusion: There is a statistically significant relationship between number of crimes and number of police.

405.4486.

141.2

)874.(1

28874.

1

222

r

nrt

1

2

n

YYS y 1

)( 2

n

XXS y

Page 12: Linear Regression Problems

Problems 13-5, 19, 25 Cont’d

d. Find r2, the coefficient of determination. r2 = (0.874)2 = 0.7638 76.38% of the number of crimes is explained by the number of police.

e. Strong inverse relationship. As the number of police increase, the crimes decrease.

9596.874.5

875.11874.

ss

x

yrb95 146

( 0.9596) 29.38778 8

a

19. Find the regression equation.

a.

b. = a + bx=29.3877-.9596x

= 29.3877 – 0.9596(20)

c. For each policeman added, crime goes down by approximately one unit.          

^

Y

25. Find the standard error of estimate SYX

procedurecorrect for 479 page

refer to-book ofback solution text379.328

4877.68

2-n

Y-Y = SYX

Computational formula (not in text) – see last two columns of original data.

2

2

n

XYbYaY

28

)1502(9596.)95(3877.291419

6

32.144183.27911419 6

4892.683786.34149.11

Syx = =

Syx = = =

^

Y

Page 13: Linear Regression Problems

Find the 95% prediction interval for Y when X = 20 police - I requested this

 

 P.I = ± t Syx

= 10.1957 ± (2.447) (3.3786)

= 10.1957 ± 8.267

= 10.1957 ± 8.267

= 10.1957 ± 8.8178

 

1.3779 < Y< 19.0135 - I am 95% sure that an estimate for an individual value of Y lies between 1.38 and 19.01 crimes, but only when X = 20 policemen.

Problems 13-5, 19, 25 Cont’d

Page 14: Linear Regression Problems

Excel solutionProblems 13-5, 19 and 25

SUMMARY OUTPUT

Regression Statistics - sign added because the co-efficient for b is negative

Multiple R -0.874395627 r, the correlation coefficient-measures association between X & Y

R Square 0.764567713 , the coefficient of determination - the amount of Y by XAdjusted R Square 0.725328999 , the standard error of the estimate-measures variation of data Standard Error 3.378396228 about the regression line.Observations 8

ANOVA df SS MS F Significance F

Regression 1 (SSR) 222.3936335 222.39363 19.4850347 0.004499023

Residual 6 (SSE) 68.48136646 11.413561Total 7 (SSyy) 290.875

Coefficients Standard Error t Stat P-value Lower 95% Upper 95%Intercept 29.38819876 4.143380593 7.092807 0.00039424 19.2497117 39.52668581X Variable 1 -0.959627329 0.217396234-4.414186 0.00449902 -1.491576749 -0.427677909

ab tvalue p-value-compare to alpha. If less than alpha

note: since b is negative R must also be negative. Excel will not do this.

reject H0 and conclude that there is a statistically significant relationship between X and Y.

Note: From the ANOVA Table regression equation : = 29.38819876-.9562739X

yxS2r

Y

3784.328

4814.68

2

76457.875.290

344.2222

n

SSES

SS

SSRR

yx

yy

Page 15: Linear Regression Problems

Problem 13-7

ip.relationsht significanlly statistica anot is There : Decision Mgt. .6

Hrejecttofail:Decision lStatistica.5

07.132.1

21232.

r1

2nrt.4

Hrejecttofail812.1t:R.D.3

05..2

0:H

0:H.1

0

22

0

1

0

Page 16: Linear Regression Problems

Problem 13-8

ip.relationsht significanlly statistica a is There :Decision Managerial .6

Hreject:Decision lStatistica.5

86.146.1

21546.

r1

2nrt.4

771.1tifHrejectFT:R.D.3

05..2

0:H

0:H.1

0

22

0

1

0

Page 17: Linear Regression Problems

Problem 13-13 (Data from #13-1)

X X Y Y 2

X X 2Y Y X X Y Y X Y Y² XY

4 4 -1.6 -1.8 2.56 3.24 2.88 16 16

5 6 -0.6 0.2 0.36 0.04 -0.12 36 30

3 5 -2.6 -0.8 6.76 0.64 2.08 25 15

6 7 0.4 1.2 0.16 1.44 0.48 49 42

10 7 4.4 1.2 19.36 1.44 5.28 49 70

X = 28

Y = 29

(X-X)2 =

29.2

(Y-Y)2

=6.8

(X-X) (Y-Y) =

10.6Y² = 175

YX = 173

Page 18: Linear Regression Problems

Problem 13-13 (13-1)

3631.702.2

304)(0.752)(1. xSySr b

76713 )(5.6)1(.36385y a

0.752 )31)(721)(-(5

10.6 1

r

1.3 4

6.8 1

2)Y - (Y Sy

2.7 4

29.2 1

2)X - (X Sx

8.55

29

6.55

28

. - .xb

..)(Sx)(Sy)(n-)Y)(Y - X(X -

n

n

n

XY

n

XX

b.

a.

ŷ = 3.7671 + .3631(7)ŷ = 6.308 when x = 7

Page 19: Linear Regression Problems

Problem 13-14 Note: this data applies to problems 13-2, 13-14, 13-22,13-28

5

10.625 29

5

875.428

Y

X

XY

65

45

42

36

52

44

54

40

378

XY

X X Y Y 2X X 2

Y Y X X Y Y X Y

5 13 0.13 2.38 0.02 5.64 0.30

3 15 -1.88 4.38 3.52 19.14 -8.20

6 7 1.13 -3.63 1.27 13.14 -4.08

3 12 -1.88 1.38 3.52 1.89 -2.58

4 13 -0.88 2.38 0.77 5.64 -2.08

4 11 -0.88 0.38 0.77 0.14 -0.33

6 9 1.13 -1.63 1.27 2.64 -1.83

8 5 3.13 -5.63 9.77 31.64 -17.58

39 85 20.88 79.88 -36.38

X Y (X-X)2 (Y-Y)2

(X-X) (Y-Y)

Right click here and “Open hyper link” for the excel sol.

169

225

49

144

169

121

81

25

933

Click here for the excel sol2.

Page 20: Linear Regression Problems

1197.19 )875.4)(7425.1(625.10y a

7425.17269.1

)37803(-0.8908)

xSyS

r b

0.8908- 780).7269)(3.311)(-(8

36.375-

1 r

3.3780 7

79.875 1

2)Y - (Y Sy

1.7269 7

20.875 1

2)X - (X Sx

625.108

85

875.4 8

39

n

X

- xb

.(

)(Sx)(Sy)-(n

)Y)(Y - X(X -

n

n

n

YY

X

b.

a.

ŷ = 19.1197 + 1.7425(7)ŷ = 6.922 when x = 7

Problem 13-14 (13-2)

Page 21: Linear Regression Problems

Problem 13-15 X X Y Y 2

X X 2Y Y X X Y Y • X Y

• 12 9 2.9 1.6 8.41 2.56 4.64• 9 7 -0.1 -0.4 0.01 0.16 0.04• 14 10 4.9 2.6 24.01 6.76 12.74• 6 5 -3.1 -2.4 9.61 5.76 7.44• 10 8 0.9 0.6 0.81 0.36 0.54• 8 6 -1.1 -1.4 1.21 1.96 1.54• 10 8 0.9 0.6 0.81 0.36 0.54• 10 10 0.9 2.6 0.81 6.76 2.34• 5 4.0 -4.1 -3.4 16.81 11.56 13.94• 7 7.0 -2.1 -0.4 4.41 0.16 0.84•• 91 74 66.90 36.40 44.60

b. = 1.33333 + 0.66667(6) = 5.335

Page 22: Linear Regression Problems

Problem 13-16

X Y

14 24 -19.4 -37.1 376.36 1376.41 719.74

12 14 -21.4 -47.1 457.96 2218.41 1007.94

20 28 -13.4 -33.1 179.56 1095.61 443.54

16 30 -17.4 -31.1 302.76 967.21 541.14

46 80 12.6 18.9 158.76 357.21 238.14

23 30 -10.4 -31.1 108.16 967.21 323.44

48 90 14.6 28.9 213.16 835.21 421.94

50 85 16.6 23.9 275.56 571.21 396.74

55 120.0 21.6 58.9 466.56 3469.21 1272.24

50 110.0 16.6 48.9 275.56 2391.21 811.74

334 611 2814.40 14248.90 6176.60

X X Y Y 2X X 2

Y Y X X Y Y

Page 23: Linear Regression Problems

Problem 13-16 cont’d..334

33.410

X 611

61.110

Y 2814.4

17.683649xs

14248.939.789585

9ys

6176.60.9753677

(10 1)(17.68364)(39.789585)r

0.9753677 39.7895852.1946542

17.68364b

61.1 (2.194654)(33.4) 12.20145a

Y = –12.20145 + 2.19465X

b. 75.5846, found by = -12.20145 + 2.19465(40)Y

Page 24: Linear Regression Problems

Problem 13-19

2

8(1502) (146)(95)0.9596

8(2906) (146)b

95 146( 0.9596) 29.3877

8 8a

19. a.

20. b. 10.1957 found by 29.3877 – 0.9596(20)

c. For each policeman added, crime goes down by one.

Page 25: Linear Regression Problems

Problem 13-21 (13-1 data)Data From 13-1

XY Y² XY

4 4 -1.6 -1.8 2.56 3.24 2.88 16 16

5 6 -0.6 0.2 0.36 0.04 -0.12 36 30

3 5 -2.6 -0.8 6.76 0.64 2.08 25 15

6 7 0.4 1.2 0.16 1.44 0.48 49 42

10 7 4.4 1.2 19.36 1.44 5.28 49 70

X = 28 Y=29(X-X)2 =

29.2 (Y-Y)2 =

6.8

(X-X) (Y-Y) =

10.6Y²=1

75XY=1

73

5

5.8 29

5

6.528

Y

X

X X Y Y 2X X 2

Y Y X X Y Y

Page 26: Linear Regression Problems

Problem 13-21(13-1)

993.ˆ

1ˆ.

993.25

173363.029767.3175

2.

2

.

y

SyCIb

n

XYbYaYSa

yx

xy

Page 27: Linear Regression Problems

Problem 13-22 (Data from 13-2)

5

10.625 29

5

875.428

Y

X

XY

65

45

42

36

52

44

54

40

XY 378

X X Y Y 2X X 2

Y Y X X Y Y X Y

5 13 0.13 2.38 0.02 5.64 0.30

3 15 -1.88 4.38 3.52 19.14 -8.20

6 7 1.13 -3.63 1.27 13.14 -4.08

3 12 -1.88 1.38 3.52 1.89 -2.58

4 13 -0.88 2.38 0.77 5.64 -2.08

4 11 -0.88 0.38 0.77 0.14 -0.33

6 9 1.13 -1.63 1.27 2.64 -1.83

8 5 3.13 -5.63 9.77 31.64 -17.58

X = 39

Y = 85

(X-X)2 =

20.88

(Y-Y)2

= 79.88

(X-X) (Y-Y) = -36.38

169

225

49

144

169

121

81

25

Y² = 983

Page 28: Linear Regression Problems

Problem 13-22(13-2)(13-2 data)

3156.3ˆ

6578.12ˆ

6578.128

3787425.1851197.19983

2

2

.

y

y

SyCI

n

XYbYaYS

yx

xy

Page 29: Linear Regression Problems

Problem 13-27 (13-1)

941.7ˆ675.4

633.1308.62.29

6.57

5

1993.182.3308.6

)(

1ˆ.

2

2

2

y

XX

XX

nStyCIa yx

Page 30: Linear Regression Problems

Problem 13-27 (13-1)

865.9ˆ751.22.29

6.57

5

11993.182.3308.6

2)(

11ˆ.

2

2

y

XX

XX

nStyPIb yx

Page 31: Linear Regression Problems

Problem 13-28 (13-2)

2923.9ˆ5522.4

37007.29222.688.20

875.47

8

16578.1447.29222.6

)(

1ˆ.

2

2

2

y

XX

XX

nStyCIa yx

Page 32: Linear Regression Problems

Problem 13-28 (13-2)

6208.11ˆ2238.2

6982.49222.688.20

875.47

8

116578.1447.29222.6

)(

11ˆ.

2

2

2

y

XX

XX

nStyPIb yx