Professional Documents
Culture Documents
Microsoft Excel
6th Global Edition
Chapter 14
regression model
Yi β 0 β1X1i β 2 X 2i β k X ki ε i
ˆ b b X b X b X
Yi 0 1 1i 2 2i k ki
In this chapter we will use Excel or Minitab to obtain the
regression slope coefficients and other regression
summary measures.
Copyright ©2011 Pearson Education 14-4
Multiple Regression Equation
(continued)
Two variable model DCOVA
Y
Ŷ b0 b1X1 b 2 X 2
X1
e
abl
ri
r va
fo
o pe X2
Sl
f o r v a riable X 2
Slope
X1
Copyright ©2011 Pearson Education 14-5
Example:
2 Independent Variables
DCOVA
A distributor of frozen dessert pies wants to
evaluate factors thought to influence demand
Dependent variable: Pie sales (units per week)
Independent variables: Price (in $)
Advertising ($100’s)
ANOVA df SS MS F Significance F
Regression 2 29460.027 14730.013 6.53861 0.01201
Residual 12 27033.306 2252.776
Total 14 56493.333
Check the
“confidence and
prediction interval
estimates” box
Input values
<
Predicted Y value
Confidence interval for the
mean value of Y, given
these X values
models
What is the net effect of adding a new variable?
We lose a degree of freedom when a new X
variable is added
Did the new X variable add enough
ANOVA df SS MS F Significance F
Regression 2 29460.027 14730.013 6.53861 0.01201
Residual 12 27033.306 2252.776
Total 14 56493.333
ei = (Yi – Yi)
<
Yi
x2i
X2
x1i
The best fit equation is found
X1 by minimizing the sum of
squared errors, e2
Copyright ©2011 Pearson Education 14-22
Multiple Regression Assumptions
DCOVA
Errors (residuals) from the regression model:
<
ei = (Yi – Yi)
Assumptions:
The errors are normally distributed
<
Residuals vs. Yi
Residuals vs. X1i
Residuals vs. X2i
Residuals vs. time (if time series data)
Use the residual plots to check for
violations of regression assumptions
Copyright ©2011 Pearson Education 14-24
Are Individual Variables
Significant?
DCOVA
Use t tests of individual variable slopes
Shows if there is a linear relationship between
the variable Xj and Y holding constant the effects
of other X variables
Hypotheses:
H0: βj = 0 (no linear relationship)
H1: βj ≠ 0 (linear relationship does exist
between Xj and Y)
DCOVA
H0: βj = 0 (no linear relationship)
H1: βj ≠ 0 (linear relationship does exist
between Xj and Y)
Test Statistic:
bj 0
t STAT (df = n – k – 1)
Sb
j
ANOVA df SS MS F Significance F
Regression 2 29460.027 14730.013 6.53861 0.01201
Residual 12 27033.306 2252.776
Total 14 56493.333
b j tα / 2 Sb where t has
(n – k – 1) d.f.
j
Example: Form a 95% confidence interval for the effect of changes in price (X1) on
pie sales:
-24.975 ± (2.1788)(10.832)
So the interval is (-48.576 , -1.374)
(This interval does not contain zero, so price has a significant effect on sales holding constant
the effect of advertising)
SSR(X1 | X2)
= SSR (all variables) – SSR(X2)
= .05, df = 1 and 12
F0.05 = 4.75
(For X1 and X2) (For X2 only)
ANOVA ANOVA
df SS MS df SS
Regression 2 29460.02687 14730.01343 Regression 1 17484.22249
Residual 12 27033.30647 2252.775539 Residual 13 39009.11085
Total 14 56493.33333 Total 14 56493.33333
DCOVA
(For X1 and X2) (For X2 only)
ANOVA ANOVA
df SS MS df SS
Regression 2 29460.02687 14730.01343 Regression 1 17484.22249
Residual 12 27033.30647 2252.775539 Residual 13 39009.11085
Total 14 56493.33333 Total 14 56493.33333
2
ta F1,a
Where a = degrees of freedom
Intermediate Calculations
SSR(X1,X2) 29460.02687
SST 56493.33333
SSR(X2) 17484.22249 SSR(X1 | X2) 11975.80438
SSR(X1) 11100.43803 SSR(X2 | X1) 18359.58884
Coefficients
r2 Y1.2 0.307000188
r2 Y2.1 0.404459524
Ŷ b0 b1 X1 b 2 X 2
Let:
Y = pie sales
X1 = price
X2 = holiday (X2 = 1 if a holiday occurred during the week)
(X2 = 0 if there was no holiday that week)
Ŷ b0 b1 X1 b 2 (0) b0 b1 X1 No Holiday
Different Same
intercept slope
Y (sales)
If H0: β2 = 0 is
b0 + b2
Holi rejected, then
day
b0 (X = “Holiday” has a
No H 2 1)
oli da significant effect
y (X on pie sales
2 = 0
)
Y = house price
X1 = square feet
X2 = 1 if ranch, 0 otherwise
X3 = 1 if split level, 0 otherwise
Ŷ b0 b1X1 b 2 X 2 b3 X3
b0 b1X1 b 2 X 2 b3 (X1X 2 )
Copyright ©2011 Pearson Education 14-47
Effect of Interaction
DCOVA
Given: Y β0 β1X1 β 2 X2 β3 X1X 2 ε
4 X2 = 0:
Y = 1 + 2X1 + 3(0) + 4X1(0) = 1 + 2X1
0
X1
0 0.5 1 1.5
Slopes are different if the effect of X1 on Y depends on X2 value
Copyright ©2011 Pearson Education 14-49
Significance of Interaction Term
DCOVA
Can perform a partial F test for the contribution
of a variable to see if the addition of an
interaction term improves the model