Академический Документы
Профессиональный Документы
Культура Документы
Microsoft Excel
6th Edition
Chapter 13
Simple Linear Regression
13-1
Learning Objectives
In this chapter, you learn:
How to use regression analysis to predict the value of
a dependent variable based on an independent
variable
The meaning of the regression coefficients b0 and b1
How to evaluate the assumptions of regression
analysis and know what to do if the assumptions are
violated
To make inferences about the slope and correlation
coefficient
To estimate mean values and predict individual values
Copyright 2011 Pearson Education, Inc. publishing as Prentice Hall
13-2
13-3
Introduction to
Regression Analysis
DCOVA
13-4
13-5
Types of Relationships
DCOVA
Linear relationships
Y
Curvilinear relationships
Y
X
Y
X
Y
X
Copyright 2011 Pearson Education, Inc. publishing as Prentice Hall
X
13-6
Types of Relationships
DCOVA
(continued)
Strong relationships
Y
Weak relationships
Y
X
Y
X
Y
X
Copyright 2011 Pearson Education, Inc. publishing as Prentice Hall
X
13-7
Types of Relationships
DCOVA
(continued)
No relationship
Y
X
Y
X
Copyright 2011 Pearson Education, Inc. publishing as Prentice Hall
13-8
Population
Y intercept
Dependent
Variable
Population
Slope
Coefficient
Independent
Variable
Random
Error
term
Yi 0 1Xi i
Linear component
Random Error
component
13-9
DCOVA
(continued)
Yi 0 1Xi i
Observed Value
of Y for Xi
Predicted Value
of Y for Xi
Slope = 1
Random Error
for this Xi value
Intercept = 0
Xi
Copyright 2011 Pearson Education, Inc. publishing as Prentice Hall
13-10
DCOVA
Estimate of
the regression
Estimate of the
regression slope
intercept
Yi b0 b1Xi
Copyright 2011 Pearson Education, Inc. publishing as Prentice Hall
Value of X for
observation i
13-11
13-12
13-13
Interpretation of the
Slope and the Intercept
DCOVA
13-14
DCOVA
13-15
Square Feet
(X)
245
1400
312
1600
279
1700
308
1875
199
1100
219
1550
405
2350
324
2450
319
1425
255
1700
13-16
DCOVA
13-17
DCOVA
1. Choose Data
3. Choose Regression
13-18
DCOVA
13-19
13-20
Multiple R
0.76211
R Square
0.58082
Adjusted R Square
0.52842
Standard Error
41.33032
Observations
10
ANOVA
df
SS
MS
F
11.0848
Regression
18934.9348
18934.9348
Residual
13665.5652
1708.1957
Total
32600.5000
Significance F
0.01039
13-21
Slope
= 0.10977
Intercept
= 98.248
13-22
DCOVA
13-23
DCOVA
13-24
13-25
Do not try to
extrapolate
beyond the range
of observed Xs
Copyright 2011 Pearson Education, Inc. publishing as Prentice Hall
13-26
Measures of Variation
DCOVA
SST
SSR
Total Sum of
Squares
Regression Sum
of Squares
SST ( Yi Y )2
SSR ( Yi Y )2
SSE
Error Sum of
Squares
SSE ( Yi Yi )2
where:
=Y
Mean value of the dependent variable
Y
i
= Predicted
value of Y for the given Xi value
13-27
Measures of Variation
(continued)
DCOVA
(Total Variation)
13-28
Measures of Variation
(continued)
DCOVA
Y
Yi
_
SSE = (Yi - Yi )2
_
Y
Xi
Copyright 2011 Pearson Education, Inc. publishing as Prentice Hall
13-29
Coefficient of Determination, r2
DCOVA
SST
total sum of squares
2
note:
0 r 1
13-30
Examples of Approximate
r2 Values
DCOVA
Y
r2 = 1
r2 = 1
r =1
2
13-31
Examples of Approximate
r2 Values
DCOVA
Y
0 < r2 < 1
X
Copyright 2011 Pearson Education, Inc. publishing as Prentice Hall
13-32
Examples of Approximate
r2 Values
DCOVA
r2 = 0
No linear relationship
between X and Y:
r2 = 0
13-33
0.58082
SST 32600.5000
2
Regression Statistics
Multiple R
0.76211
R Square
0.58082
Adjusted R Square
0.52842
Standard Error
41.33032
Observations
10
ANOVA
df
SS
MS
F
11.0848
Regression
18934.9348
18934.9348
Residual
13665.5652
1708.1957
Total
32600.5000
Significance F
0.01039
13-34
SSE
S YX
n2
i 1
(Yi Yi ) 2
n2
Where
SSE = error sum of squares
n = sample size
Copyright 2011 Pearson Education, Inc. publishing as Prentice Hall
13-35
0.76211
R Square
0.58082
Adjusted R Square
0.52842
Standard Error
S YX 41.33032
41.33032
Observations
10
ANOVA
df
SS
MS
F
11.0848
Regression
18934.9348
18934.9348
Residual
13665.5652
1708.1957
Total
32600.5000
Significance F
0.01039
13-36
DCOVA
small SYX
large SYX
13-37
Assumptions of Regression
L.I.N.E
DCOVA
Linearity
The relationship between X and Y is linear
Independence of Errors
Error values are statistically independent
Normality of Error
Error values are normally distributed for any given
value of X
Equal Variance (also called homoscedasticity)
The probability distribution of the errors has constant
variance
13-38
Residual Analysis
DCOVA
ei Yi Yi
13-39
Not Linear
Copyright 2011 Pearson Education, Inc. publishing as Prentice Hall
residuals
residuals
Linear
13-40
residuals
residuals
residuals
Independent
X
DCOVA
13-41
13-42
100
0
-3
-2
-1
Residual
Copyright 2011 Pearson Education, Inc. publishing as Prentice Hall
13-43
x
Non-constant variance
residuals
residuals
Constant variance
13-44
Residuals
251.92316
-6.923162
273.87671
38.12329
284.85348
-5.853484
304.06284
3.937162
218.99284
-19.99284
268.38832
-49.38832
356.20251
48.79749
367.17929
-43.17929
254.6674
64.33264
10
284.85348
-29.85348
Measuring Autocorrelation:
The Durbin-Watson Statistic
DCOVA
13-46
Autocorrelation
DCOVA
13-47
(e e
i 2
i1
2
e
i
i1
DCOVA
table
(for sample size n and number of independent variables k)
Decision rule: reject H0 if D < dL
Reject H0
Inconclusive
dL
Do not reject H0
dU
2
13-49
(continued)
DCOVA
Is there autocorrelation?
13-50
(continued)
DCOVA
Excel/PHStat output:
Durbin-Watson Calculations
Sum of Squared
Difference of Residuals
3296.18
Sum of Squared
Residuals
3279.98
Durbin-Watson
Statistic
1.00494
n
(e e
i 2
ei
i1
)2
3296.18
1.00494
3279.98
i 1
13-51
(continued)
DCOVA
Here, n = 25 and there is k = 1 one independent variable
Inconclusive
dL=1.29
Do not reject H0
dU=1.45
2
13-52
S YX
Sb1
SSX
S YX
2
(X
X
)
i
where:
S=bEstimate
of the standard error of the slope
1
S YX
SSE
= Standard error of the estimate
n2
13-53
Test statistic
t STAT
b1 1
Sb
d.f. n 2
Copyright 2011 Pearson Education, Inc. publishing as Prentice Hall
where:
b1 = regression slope
coefficient
1 = hypothesized slope
Sb1 = standard
error of the slope
13-54
Square Feet
(x)
245
1400
312
1600
279
1700
308
1875
199
1100
219
1550
405
2350
324
2450
319
1425
255
1700
13-55
H0: 1 = 0
H1: 1 0
Standard Error
t Stat
P-value
98.24833
58.03348
1.69296
0.12892
0.10977
0.03297
3.32938
0.01039
b1
Sb1
t STAT
b1 1
Sb
0.10977 0
3.32938
0.03297
13-56
H0: 1 = 0
H1: 1 0
d.f. = 10- 2 = 8
/2=.025
Reject H0
/2=.025
Do not reject H0
-t/2
-2.3060
Reject H0
t/2
0
2.3060
3.329
Decision: Reject H0
There is sufficient evidence
that square footage affects
house price
13-57
H0: 1 = 0
From Excel output:
Coefficients
Intercept
Square Feet
H1: 1 0
Standard Error
t Stat
P-value
98.24833
58.03348
1.69296
0.12892
0.10977
0.03297
3.32938
0.01039
p-value
13-58
MSR
F Test statistic: F
STAT
MSE
where
MSR
SSR
k
MSE
SSE
n k 1
13-59
0.76211
R Square
0.58082
Adjusted R Square
0.52842
Standard Error
MSR 18934.9348
FSTAT
11.0848
MSE 1708.1957
With 1 and 8 degrees
of freedom
p-value for
the F-Test
41.33032
Observations
10
ANOVA
df
SS
MS
F
11.0848
Regression
18934.9348
18934.9348
Residual
13665.5652
1708.1957
Significance F
0.01039
13-60
DCOVA
Test Statistic:
H0: 1 = 0
H1: 1 0
= .05
df1= 1
FSTAT
df2 = 8
Decision:
Reject H0 at = 0.05
Critical
Value:
F = 5.32
Conclusion:
= .05
Do not
reject H0
MSR
11.08
MSE
Reject H0
F.05 = 5.32
13-61
b1 t / 2 S b
d.f. = n - 2
Standard Error
t Stat
P-value
Lower 95%
Upper 95%
98.24833
58.03348
1.69296
0.12892
-35.57720
232.07386
0.10977
0.03297
3.32938
0.01039
0.03374
0.18580
13-62
Standard Error
t Stat
P-value
Lower 95%
Upper 95%
98.24833
58.03348
1.69296
0.12892
-35.57720
232.07386
0.10977
0.03297
3.32938
0.01039
0.03374
0.18580
13-63
Hypotheses
H0: = 0 (no correlation between X and Y)
H1: 0
(correlation exists)
Test statistic
t STAT
r -
(with n 2 degrees of freedom)
1 r
n2
where
r r 2 if b1 0
r r 2 if b1 0
13-64
(No correlation)
H 1: 0
(correlation exists)
=.05 , df = 10 - 2 = 8
t STAT
r
1 r2
n2
.762 0
1 .762 2
10 2
3.329
13-65
DCOVA
DCOVA
t STAT
r
1 r2
n2
.762 0
1 .762 2
10 2
3.329
Conclusion:
There is
evidence of a
linear association
at the 5% level of
significance
d.f. = 10-2 = 8
/2=.025
Reject H0
-t/2
-2.3060
/2=.025
Do not reject H0
Decision:
Reject H0
Reject H0
t/2
2.3060
3.329
13-66
Y = b0+b1Xi
Prediction Interval
for an individual Y,
given Xi
Copyright 2011 Pearson Education, Inc. publishing as Prentice Hall
Xi
13-67
DCOVA
Y t / 2 S YX hi
Size of interval varies according
to distance away from mean, X
1 (Xi X)2 1
(Xi X)2
hi
n
SSX
n (Xi X)2
Copyright 2011 Pearson Education, Inc. publishing as Prentice Hall
13-68
DCOVA
Y t / 2 S YX 1 hi
13-69
DCOVA
Y t 0.025S YX
(X i X) 2
(X i X) 2
317.85 37.12
13-70
Y t 0.025S YX 1
n
(X i X) 2
(X i X) 2
317.85 102.28
13-71
Check the
confidence and prediction interval for X=
box and enter the X-value and confidence level
desired
13-72
(continued)
DCOVA
Input values
Y
Confidence Interval Estimate for Y|X=Xi
Prediction Interval Estimate for YX=Xi
Copyright 2011 Pearson Education, Inc. publishing as Prentice Hall
13-73
13-74
13-75
(continued)
13-76
Chapter Summary
13-77
Chapter Summary
(continued)
13-78
All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means, electronic, mechanical, photocopying,
recording, or otherwise, without the prior written permission of the publisher.
Printed in the United States of America.
13-79