Simple Linear Regression: Slide 1
Simple Linear Regression: Slide 1
Simple Linear
Regression
analysis.
X X
Y Y
Y
Curvilinear
Relationships
X X X
Y Y
No
Relationship
X X
A L WAY S L E A R N I N G Copyright © 2020 Pearson Education Ltd. Slide 10
Simple Linear Regression DCOVA
Model
Population Random
Population Independent Error
Slope
Y intercept Variable term
Coefficient
Dependent
Variable
Y
Observed Value
of Y for Xi
εi Slope = β1
Predicted Value
Random Error
of Y for Xi
for this Xi value
Intercept = β0
Xi X
A L WAY S L E A R N I N G Copyright © 2020 Pearson Education Ltd. Slide 13
Simple Linear Regression
Equation (Prediction Line) DCOVA
Estimated
(or predicted) Estimate of Estimate of the
Y value for the regression regression slope
observation i
intercept
Value of X for
observation i
ANOVA
df SS MS F Significance F
Regression 1 18934.9348 18934.9348 11.0848 0.01039
Residual 8 13665.5652 1708.1957
Total 9 32600.5000
Slope
= 0.10977
Intercept
= 98.248
Do not try to
extrapolate
beyond the range
of observed X’s
A L WAY S L E A R N I N G Copyright © 2020 Pearson Education Ltd. Slide 26
Computing b0 & b1
DCOVA
For small data sets, b0 & b1 can be calculated using a hand calculator
Where:
where:
= Mean value of the dependent variable
Yi = Observed value of the dependent variable
= Predicted value of Y for the given Xi value
A L WAY S L E A R N I N G Copyright © 2020 Pearson Education Ltd. Slide 30
Measures of Variation
(continued)
DCOVA
SST = total sum of squares (Total Variation.)
Measures the variation of the Yi values around their
mean Y.
SSR = regression sum of squares (Explained Variation.)
Variation attributable to the relationship between X
and Y.
SSE = error sum of squares (Unexplained Variation.)
Variation in Y attributable to factors other than X.
Y DCOVA
Yi
SSE = (Yi - Yi )2 Y
_
SST = (Yi - Y)2
Y _
_ SSR = (Yi - Y)2 _
Y Y
Xi X
A L WAY S L E A R N I N G Copyright © 2020 Pearson Education Ltd. Slide 32
Excel Output Of The Measures
Of Variation DCOVA
note:
To Ch13 XL
A L WAY S L E A R N I N G Copyright © 2020 Pearson Education Ltd. Slide 34
Examples of Approximate
r2 Values
DCOVA
Y
X
r =1
2
X
A L WAY S L E A R N I N G Copyright © 2020 Pearson Education Ltd. Slide 36
Examples of Approximate
r2 Values
DCOVA
r2 = 0
Y
No linear relationship
between X and Y.
ANOVA
df SS MS F Significance F
Regression 1 18934.9348 18934.9348 11.0848 0.01039
Residual 8 13665.5652 1708.1957
Total 9 32600.5000
Actual
Mean
Predicted
Where
SSE = error sum of squares
n = sample size
ANOVA
df SS MS F Significance F
Regression 1 18934.9348 18934.9348 11.0848 0.01039
To Ch13 XL
A L WAY S L E A R N I N G Copyright © 2020 Pearson Education Ltd. Slide 42
Comparing Standard Errors
DCOVA
SYX is a measure of the variation of observed
Y values from the regression line.
Y Y
X X
Independence of Errors:
Error values are statistically independent.
period of time.
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.
A L WAY S L E A R N I N G Copyright © 2020 Pearson Education Ltd. Slide 45
Residual Analysis
DCOVA
x x
residuals
x residuals x
Not Linear
Copyright © 2020 Pearson Education Ltd.
Linear
Slide 47
A L WAY S L E A R N I N G
Residual Analysis for
Independence
DCOVA
Cyclical Pattern:
Not Independent
No Cyclical Pattern
Independent
residuals
residuals
X
residuals
Percent
100
0
-3 -2 -1 0 1 2 3
Residual
A L WAY S L E A R N I N G Copyright © 2020 Pearson Education Ltd. Slide 50
Residual Analysis for
Equal Variance
DCOVA
Y Y
x x
residuals
x residuals x
Non-constant variance
Constant variance
To Ch13 XL
A L WAY S L E A R N I N G Copyright © 2020 Pearson Education Ltd. Slide 51
Residual Analysis: Checking For
Linearity
DCOVA
RESIDUAL OUTPUT
Predicted
House Price Residuals
1 251.9232 -6.9232
2 273.8767 38.1233
3 284.8535 -5.8535
4 304.0628 3.9371
5 218.9928 -19.9928
6 268.3883 -49.3883
7 356.2025 48.7975
8 367.1793 -43.1793
9 254.6674 64.3326
10 284.8535 -29.8535
2 273.8767 38.1233
40
3 284.8535 -5.8535
4 304.0628 3.9371 20
5 218.9928 -19.9928
0
6 268.3883 -49.3883 0 2 4 6 8 10 12
8 367.1793 -43.1793
-40
9 254.6674 64.3326
10 284.8535 -29.8535 -60
Residuals
4 304.0628 3.9371 20
5 218.9928 -19.9928 0
RESIDUAL OUTPUT
Predicted Residuals vs Predicted Value
80
House Price Residuals
1 251.9232 -6.9232 60
2 273.8767 38.1233 40
3 284.8535 -5.8535
20
4 304.0628 3.9371
5 218.9928 -19.9928 0
7 356.2025 48.7975
-40
8 367.1793 -43.1793
9 254.6674 64.3326 -60
200 220 240 260 280 300 320 340 360 380
10 284.8535 -29.8535
0 dL dU 2
A L WAY S L E A R N I N G Copyright © 2020 Pearson Education Ltd. Slide 59
Testing for Positive
Autocorrelation (continued)
DCOVA
Suppose we have the following time series
data:
Is there autocorrelation?
A L WAY S L E A R N I N G Copyright © 2020 Pearson Education Ltd. Slide 60
Testing for Positive Autocorrelation (continued)
DCOVA
Example with n = 25:
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
DCOVA
Here, n = 25 and there is k = 1 one independent variable
ANOVA
df SS MS F Significance F
Regression 1 18934.9348 18934.9348 11.0848 0.01039
Residual 8 13665.5652 1708.1957
Total 9 32600.5000
where:
= Estimate of the standard error of the slope.
b1
d.f. = 10- 2 = 8
a/2=.025 a/2=.025
Decision: Reject H0.
p-value
Decision: Reject H0, since p-value < α.
There is sufficient evidence that
square footage affects house price.
F Test statistic:
where
Regression Statistics
Multiple R 0.76211
R Square 0.58082
Adjusted R
Square 0.52842
Standard Error 41.33032
With 1 and 8 degrees p-value for
Observations 10 of freedom the F-Test
ANOVA
df SS MS F Significance F
Regression 1 18934.9348 18934.9348 11.0848 0.01039
Residual 8 13665.5652 1708.1957
Total 9 32600.5000
DCOVA
Prediction Interval
for an individual Y,
given Xi.
Xi X
A L WAY S L E A R N I N G Copyright © 2020 Pearson Education Ltd. Slide 81
Confidence Interval for
the Mean of Y, Given X
DCOVA
Confidence interval estimate for the
mean value of Y given a particular Xi.
Predicted Price Yi = 317.85 ($1,000s)
Predicted Price Yi = 317.85 ($1,000s)