Chapter 15
Chapter 15
and Economics
Anderson Sweeney Williams
Slides by
John Loucks
St. Edward’s University
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
1
or duplicated, or posted to a publicly accessible website, in whole or in part.
Chapter 15
Multiple Regression
Multiple Regression Model
Least Squares Method
Multiple Coefficient of Determination
Model Assumptions
Testing for Significance
Using the Estimated Regression Equation
for Estimation and Prediction
Categorical Independent Variables
Residual Analysis
Logistic Regression
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
2
or duplicated, or posted to a publicly accessible website, in whole or in part.
Multiple Regression Model
where:
b0, b1, b2, . . . , bp are the parameters, and
e is a random variable called the error term
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
3
or duplicated, or posted to a publicly accessible website, in whole or in part.
Multiple Regression Equation
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
4
or duplicated, or posted to a publicly accessible website, in whole or in part.
Estimated Multiple Regression Equation
^
y = b0 + b1x1 + b2x2 + . . . + bpxp
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
5
or duplicated, or posted to a publicly accessible website, in whole or in part.
Estimation Process
Estimated Multiple
b 0, b 1, b 2, . . . , b p Regression Equation
provide estimates of yˆ b0 b1 x1 b2 x2 ... bp x p
b 0, b 1, b 2, . . . , b p Sample statistics are
b 0, b 1, b 2, . . . , b p
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
6
or duplicated, or posted to a publicly accessible website, in whole or in part.
Least Squares Method
min ( yi yˆ i )2
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
7
or duplicated, or posted to a publicly accessible website, in whole or in part.
Multiple Regression Model
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
8
or duplicated, or posted to a publicly accessible website, in whole or in part.
Multiple Regression Model
y = 0 + 1x1 + 2x2 +
where
y = annual salary ($000)
x1 = years of experience
x2 = score on programmer aptitude test
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
10
or duplicated, or posted to a publicly accessible website, in whole or in part.
Solving for the Estimates of 0, 1, 2
Least Squares
Input Data Output
x1 x2 y Computer b0 =
Package b1 =
4 78 24 for Solving
7 100 43 b2 =
Multiple
. . .
Regression R2 =
. . .
3 89 30 Problems etc.
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
11
or duplicated, or posted to a publicly accessible website, in whole or in part.
Solving for the Estimates of 0, 1, 2
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
12
or duplicated, or posted to a publicly accessible website, in whole or in part.
Estimated Regression Equation
SALARY
SALARY == 3.174
3.174 ++ 1.404(EXPER)
1.404(EXPER) ++ 0.251(SCORE)
0.251(SCORE)
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
13
or duplicated, or posted to a publicly accessible website, in whole or in part.
Interpreting the Coefficients
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
14
or duplicated, or posted to a publicly accessible website, in whole or in part.
Interpreting the Coefficients
bb11 == 1.404
1.404
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
15
or duplicated, or posted to a publicly accessible website, in whole or in part.
Interpreting the Coefficients
bb22 == 0.251
0.251
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
16
or duplicated, or posted to a publicly accessible website, in whole or in part.
Multiple Coefficient of Determination
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
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
17
or duplicated, or posted to a publicly accessible website, in whole or in part.
Multiple Coefficient of Determination
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
18
or duplicated, or posted to a publicly accessible website, in whole or in part.
Multiple Coefficient of Determination
R2 = SSR/SST
R2 = 500.3285/599.7855 = .83418
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
19
or duplicated, or posted to a publicly accessible website, in whole or in part.
Adjusted Multiple Coefficient
of Determination
n1
Ra2 1 (1 R ) 2
np1
20 1
R 1 (1 .834179)
2
a .814671
20 2 1
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
20
or duplicated, or posted to a publicly accessible website, in whole or in part.
Assumptions About the Error Term
The error is
The error is aa random
random variable
variable with
with mean
mean of
of zero.
zero.
The
The variance
variance ofof ,, denoted by
denoted by 22,, is
is the
the same
same for
for all
all
values
values of
of the
the independent
independent variables.
variables.
The
The values of are
values of are independent.
independent.
The error is
The error is aa normally
normally distributed
distributed random random variable variable
reflecting
reflecting the
the deviation
deviation between
between the the yy value
value and and the the
expected
expected value
value of of yy given by 00 ++ 11xx11++ 22xx22++ .. .. ++ ppxxpp..
given by
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
21
or duplicated, or posted to a publicly accessible website, in whole or in part.
Testing for Significance
In
In simple
simple linear
linear regression,
regression, the
the FF and
and tt tests
tests provide
provide
the
the same
same conclusion.
conclusion.
In
In multiple
multiple regression,
regression, the
the FF and
and tt tests
tests have
have different
different
purposes.
purposes.
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
22
or duplicated, or posted to a publicly accessible website, in whole or in part.
Testing for Significance: F Test
The
The FF test
test is
is used
used toto determine
determine whether
whether aa significant
significant
relationship
relationship exists
exists between
between the
the dependent
dependent variable
variable
and
and the
the set
set of
of all
all the
the independent
independent variables.
variables.
The
The FF test
test is
is referred
referred to
to as
as the
the test
test for
for overall
overall
significance.
significance.
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
23
or duplicated, or posted to a publicly accessible website, in whole or in part.
Testing for Significance: t Test
If
If the
the FF test
test shows
shows an
an overall
overall significance,
significance, the
the tt test
test is
is
used
used toto determine
determine whether
whether each
each of
of the
the individual
individual
independent
independent variables
variables is
is significant.
significant.
A
A separate
separate tt test
test is
is conducted
conducted for
for each
each of
of the
the
independent
independent variables
variables in
in the
the model.
model.
We
We refer
refer to
to each
each of
of these
these tt tests
tests as
as aa test
test for
for individual
individual
significance.
significance.
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
24
or duplicated, or posted to a publicly accessible website, in whole or in part.
Testing for Significance: F Test
Hypotheses H 0: 1 = 2 = . . . = p = 0
Ha: One or more of the parameters
is not equal to zero.
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
25
or duplicated, or posted to a publicly accessible website, in whole or in part.
F Test for Overall Significance
Hypotheses H 0: 1 = 2 = 0
Ha: One or both of the parameters
is not equal to zero.
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
26
or duplicated, or posted to a publicly accessible website, in whole or in part.
F Test for Overall Significance
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
27
or duplicated, or posted to a publicly accessible website, in whole or in part.
F Test for Overall Significance
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
28
or duplicated, or posted to a publicly accessible website, in whole or in part.
Testing for Significance: t Test
Hypotheses H0 : i 0
H a : i 0
bi
Test Statistics t
sbi
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
29
or duplicated, or posted to a publicly accessible website, in whole or in part.
t Test for Significance
of Individual Parameters
Hypotheses H0 : i 0
H a : i 0
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
30
or duplicated, or posted to a publicly accessible website, in whole or in part.
t Test for Significance
of Individual Parameters
Excel’s Regression Equation Output
A B C D E
38
39 Coeffic. Std. Err. t Stat P-value
40 Intercept 3.17394 6.15607 0.5156 0.61279
41 Experience 1.4039 0.19857 7.0702 1.9E-06
42 Test Score 0.25089 0.07735 3.2433 0.00478
43
Note: Columns F-I are not shown.
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
31
or duplicated, or posted to a publicly accessible website, in whole or in part.
t Test for Significance
of Individual Parameters
Excel’s Regression Equation Output
A B C D E
38
39 Coeffic. Std. Err. t Stat P-value
40 Intercept 3.17394 6.15607 0.5156 0.61279
41 Experience 1.4039 0.19857 7.0702 1.9E-06
42 Test Score 0.25089 0.07735 3.2433 0.00478
43
Note: Columns F-I are not shown.
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
32
or duplicated, or posted to a publicly accessible website, in whole or in part.
t Test for Significance
of Individual Parameters
Test Statistics b1 1. 4039
7 . 07
sb1 . 1986
b2 . 25089
3. 24
sb2 . 07735
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
33
or duplicated, or posted to a publicly accessible website, in whole or in part.
Testing for Significance: Multicollinearity
The
The term
term multicollinearity
multicollinearity refers
refers to
to the
the correlation
correlation
among
among the
the independent
independent variables.
variables.
When
When the
the independent
independent variables
variables are
are highly
highly correlated
correlated
(say,
(say, |r
|r || >> .7),
.7), itit is
is not
not possible
possible to
to determine
determine the
the
separate
separate effect
effect ofof anyany particular
particular independent
independent variable
variable
on
on the
the dependent
dependent variable.variable.
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
34
or duplicated, or posted to a publicly accessible website, in whole or in part.
Testing for Significance: Multicollinearity
If
If the
the estimated
estimated regression
regression equation
equation is
is to
to be
be used
used only
only
for
for predictive
predictive purposes,
purposes, multicollinearity
multicollinearity is
is usually
usually
not
not aa serious
serious problem.
problem.
Every
Every attempt
attempt should
should be
be made
made to
to avoid
avoid including
including
independent
independent variables
variables that
that are
are highly
highly correlated.
correlated.
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
35
or duplicated, or posted to a publicly accessible website, in whole or in part.
Using the Estimated Regression Equation
for Estimation and Prediction
The
The procedures
procedures for
for estimating
estimating the
the mean
mean value
value of
of yy
and
and predicting
predicting an
an individual
individual value
value of
of yy in
in multiple
multiple
regression
regression are
are similar
similar to
to those
those in
in simple
simple regression.
regression.
We
We substitute
substitute the
the given
given values
values ofof xx11,, xx22,, .. .. .. ,, xxpp into
into
the
the estimated
estimated regression
regression equation
equation and and use use the the
corresponding
corresponding value
value of
of yy as
as the
the point
point estimate.
estimate.
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
36
or duplicated, or posted to a publicly accessible website, in whole or in part.
Using the Estimated Regression Equation
for Estimation and Prediction
The
The formulas
formulas required
required toto develop
develop interval
interval estimates
estimates
for ^
for the
the mean
mean value
value of
of yy and
and for
for an
an individual
individual value
value
of
of yy are
are beyond
beyond the
the scope
scope ofof the
the textbook.
textbook.
Software
Software packages
packages for
for multiple
multiple regression
regression will
will often
often
provide
provide these
these interval
interval estimates.
estimates.
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
37
or duplicated, or posted to a publicly accessible website, in whole or in part.
Categorical Independent Variables
In
In many
many situations
situations we
we must
must work
work with
with categorical
categorical
independent
independent variables
variables such
such as
as gender
gender (male,
(male, female),
female),
method
method of
of payment
payment (cash,
(cash, check,
check, credit
credit card),
card), etc.
etc.
For
For example,
example, xx22 might
might represent
represent gender
gender where
where xx22 == 00
indicates
indicates male
male and
and xx22 == 11 indicates
indicates female.
female.
In
In this
this case,
case, xx22 is
is called
called aa dummy
dummy or
or indicator
indicator variable.
variable.
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
38
or duplicated, or posted to a publicly accessible website, in whole or in part.
Categorical Independent Variables
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
39
or duplicated, or posted to a publicly accessible website, in whole or in part.
Categorical Independent Variables
^
y = b0 + b1x1 + b2x2 + b3x3
where:
y^ = annual salary ($1000)
x1 = years of experience
x2 = score on programmer aptitude test
x3 = 0 if individual does not have a graduate degree
1 if individual does have a graduate degree
x3 is a dummy variable
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
41
or duplicated, or posted to a publicly accessible website, in whole or in part.
Categorical Independent Variables
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
42
or duplicated, or posted to a publicly accessible website, in whole or in part.
Categorical Independent Variables
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
43
or duplicated, or posted to a publicly accessible website, in whole or in part.
Categorical Independent Variables
Not significant
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
44
or duplicated, or posted to a publicly accessible website, in whole or in part.
Categorical Independent Variables
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
45
or duplicated, or posted to a publicly accessible website, in whole or in part.
More Complex Categorical Variables
If
If aa categorical
categorical variable
variable has
has kk levels,
levels, kk -- 11 dummy
dummy
variables
variables are
are required,
required, with
with each
each dummy
dummy variablevariable
being
being coded
coded as
as 00 or
or 1.
1.
For
For example,
example, aa variable
variable with
with levels
levels A,
A, B,
B, and
and CC could
could
be
be represented
represented byby xx11 and
and xx22 values
values of
of (0,
(0, 0)
0) for
for A,
A, (1,
(1, 0)
0)
for
for B,
B, and
and (0,1)
(0,1) for
for C.
C.
Care
Care must
must be
be taken
taken in
in defining
defining and
and interpreting
interpreting the
the
dummy
dummy variables.
variables.
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
46
or duplicated, or posted to a publicly accessible website, in whole or in part.
More Complex Categorical Variables
Highest
Degree x1 x2
Bachelor’s 0 0
Master’s 1 0
Ph.D. 0 1
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
47
or duplicated, or posted to a publicly accessible website, in whole or in part.
Residual Analysis
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
48
or duplicated, or posted to a publicly accessible website, in whole or in part.
Standardized Residual Plot Against ŷ
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
49
or duplicated, or posted to a publicly accessible website, in whole or in part.
Standardized Residual Plot Against ŷ
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
50
or duplicated, or posted to a publicly accessible website, in whole or in part.
Standardized Residual Plot Against ŷ
Outlier
Standardized Residual Plot
3
2
Residuals
Standard
0
0 10 20 30 40 50
-1
-2
-3
Predicted Salary
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
51
or duplicated, or posted to a publicly accessible website, in whole or in part.
Logistic Regression
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
52
or duplicated, or posted to a publicly accessible website, in whole or in part.
Logistic Regression
0 1x1 2 x2 p x p
e
E( y ) 0 1x1 2 x2 p x p
1 e
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
53
or duplicated, or posted to a publicly accessible website, in whole or in part.
Logistic Regression
Interpretation of E(y) as a
Probability in Logistic Regression
If the two values of y are coded as 0 or 1, the value
of E(y) provides the probability that y = 1 given a
particular set of values for x1, x2, . . . , xp.
E( y ) estimate of P( y 1|x1 , x2 , , x p )
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
54
or duplicated, or posted to a publicly accessible website, in whole or in part.
Logistic Regression
b0 b1x1 b2 x2 bp x p
e
yˆ b0 b1x1 b2 x2 bp x p
1 e
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
55
or duplicated, or posted to a publicly accessible website, in whole or in part.
Logistic Regression
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
56
or duplicated, or posted to a publicly accessible website, in whole or in part.
Logistic Regression
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
57
or duplicated, or posted to a publicly accessible website, in whole or in part.
Logistic Regression
x1 x2 y
Simmons Test Data (partial)
Annual Spending Simmons $200
Customer ($1000) Credit Card Purchase
1 2.291 1 0
2 3.215 1 0
3 2.135 1 0
4 3.924 0 0
5 2.528 1 0
6 2.473 0 1
7 2.384 0 0
8 7.076 0 0
9 1.182 1 1
10 3.345 0 0
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
58
or duplicated, or posted to a publicly accessible website, in whole or in part.
Logistic Regression
Odds 95% CI
Predictor Coef SE Coef Z p Ratio Lower Upper
Log-Likelihood = -60.487
Test that all slopes are zero: G = 13.628, DF = 2, P-Value = 0.001
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
59
or duplicated, or posted to a publicly accessible website, in whole or in part.
Logistic Regression
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
60
or duplicated, or posted to a publicly accessible website, in whole or in part.
Logistic Regression
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
61
or duplicated, or posted to a publicly accessible website, in whole or in part.
Logistic Regression
Hypotheses H 0: 1 = 2 = 0
Ha: One or both of the parameters
is not equal to zero.
Test Statistics z = bi/sb
i
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
62
or duplicated, or posted to a publicly accessible website, in whole or in part.
Logistic Regression
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
63
or duplicated, or posted to a publicly accessible website, in whole or in part.
Logistic Regression
P( y 1|x1 , x2 , , x p ) P( y 1|x1 , x 2 , , x p )
odds
P( y 0|x1 , x2 , , x p ) 1 P( y 1|x1 , x 2 , , x p )
Odds Ratio
odds 1
Odds Ratio
odds 0
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
64
or duplicated, or posted to a publicly accessible website, in whole or in part.
Logistic Regression
Estimated Probabilities
Annual Spending
$1000 $2000 $3000 $4000 $5000 $6000 $7000
Computed
earlier
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
65
or duplicated, or posted to a publicly accessible website, in whole or in part.
Logistic Regression
Comparing Odds
Suppose we want to compare the odds of making a
$200 purchase for customers who spend $2000 annually
and have a Simmons credit card to the odds of making a
$200 purchase for customers who spend $2000 annually
and do not have a Simmons credit card.
.4099
estimate of odds 1 .6946
1 - .4099
.1880
estimate of odds 0 .2315
1 - .1880
.6946
Estimate of odds ratio 3.00
.2315
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
66
or duplicated, or posted to a publicly accessible website, in whole or in part.
End of Chapter 15
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied
Slide
67
or duplicated, or posted to a publicly accessible website, in whole or in part.