Linear Regression
Linear Regression
3
?
m l m
21
m̂ a bl
1.0 15.0 20
1.5 17.0 19
18
a? b?
2.0 18.0 17 a=-4
2.5 19.5 16
15
b = + 0.33
3.0 21.0 1 2 3 l
-4 0.33 20.7
mˆ a b l
l = 20.7
mˆ 2.9
Simple Linear Regression
E(y)
Positive Linear Relationship
Slope β1 is positive
Intercept
β0
x
Simple Linear Regression
Intercept
β0
Slope β1 is Negative
x
Simple Linear Regression
E(y)
No Relationship
x
Simple Linear Regression
Estimated
Regression Equation
b0 and b1
provide estimates of yˆ b0 b1 x
β0 and β1
Sample Statistics
b0, b1
Simple Linear Regression
where:
yi = observed value of the dependent variable for the ith
observation
ŷi = estimated value of the dependent variable for the ith
observation
Simple Linear Regression
b
( x x )( y y )
i i
(x x)
1 2
i
b
( x x )( y y ) 20
i i
5
(x x)
1 2
i 4
30
25
20
Cars Sold
y = 5x + 10
15
10
5
0
0 1 2 3 4
TV Ads
Simple Linear Regression
i
( y y ) 2
i
( ˆ
y y ) 2
i i
( y ˆ
y ) 2
where:
SST = Total Sum of Squares
SSR = Sum of Squares due to Regression
SSE = Sum of Squares due to Error
Simple Linear Regression
An Estimate of σ
The mean square error (MSE) provides the estimate
of σ2, and the notation s2 is also used.
s2 = MSE = SSE/(n - 2)
where: SSE ( yi yˆi )2 ( yi b0 b1xi )2
Simple Linear Regression
An Estimate of σ
To estimate σ we take the square root of s2.
SSE
s MSE
n2
Simple Linear Regression
Hypotheses
H0: β1 = 0
H1: β1 ≠ 0
Test Statistic is
b1
t
sb1
Simple Linear Regression
Rejection Rule
where:
tα/2 is based on a t distribution
with n - 2 degrees of freedom
Simple Linear Regression
1. Determine the hypotheses.
H0: β1 = 0
H1: β1 ≠ 0
Hypotheses
H0: β1 = 0
H1: β1 ≠ 0
Test Statistic
F = MSR/MSE
Simple Linear Regression
Rejection Rule
Reject H0 if p-value < α or F > Fα
where:
Fα is based on an F distribution with 1 degree of
freedom in the numerator and n-2 degrees of freedom
in the denominator
Simple Linear Regression
y yˆ Good Pattern
Residual
x
Simple Linear Regression
y yˆ Non-constant Variance
Residual
x
Simple Linear Regression
x
Simple Linear Regression
Residuals
Observation Predicted Cars Sold Residuals
1 15 -1
2 25 -1
3 20 -2
4 15 2
5 25 2
Simple Linear Regression
1
0
-1
-2
-3
0 1 2 3 4
TV Ads
Multiple Regression…
The simple linear regression model was used to analyze how one
variable (the dependent variable y) is related to one other
variable (the independent variable x).
Multiple regression allows for any number of independent
variables.
We expect to develop models that fit the data better than would
a simple linear regression model.
Simple regression considers the relation
between a single explanatory variable and
response variable
Multiple regression simultaneously considers the influence of
multiple explanatory variables on a response variable Y
error variable
coefficients
In the one variable, two dimensional case we drew a regression
line; here we imagine a response surface.
Regression Modeling