Lecture 26 - University of Pennsylvania

Download Report

Transcript Lecture 26 - University of Pennsylvania

Lecture 26
• Omitted Variable Bias formula revisited
• Specially constructed variables
– Interaction variables
– Polynomial terms for curvature
– Dummy variables for categorical variables
Omitted Variable Bias Formula
Revisited
• From paper “Re-examining Criminal Behavior:
The Importance of Omitted Variable Bias,” by
David Mustard, Review of Economics and
Statistics, 2003.
• To what extent do changes in the arrest rate alter
the willingness of individuals to engage in
criminal activity?
• Becker’s economic theory of crime: Those
involved in illegal activities respond to incentives
in much the same way as those who engage in
legal activities respond.
Regressions for economic theory
of crime
• Goal: Figure out the causal effect of an increase in
the arrest rate on the number of crimes committed.
• When Y=log number of crimes committed in a
city is regressed on X=log crime rate in a city, the
coefficient on X is -.0119 for murder rate, -.0020
for assault rate and -.0117 for burglary rate
(coefficient of -.0117 in log-log regression implies
that a 1% decrease in the arrest rate for burglaries
is associated with a 1.17% decrease in the number
of burglaries).
• Simple regression omits the confounding variable
of the conviction rate. What is the direction of the
omitted variables bias?
Omitted Variables Bias Formula
• x1 = the explanatory variable for which we want to
find its causal effect on y. x2 ,, x p =
confounding variables we control for by including
them in regression. x p1 = omitted confounding
variable. { y | x1,, x p1}  0  1x1     p1x p1
{ y | x1,, x p }  0*  1* x1     p* x p
{x p1 | x1 ,, x p }   0   1x1     p x p
*
*









• Then 1 1 1 p1 or equivalently 1 1  1 p1
• Formula tells us about direction and magnitude of
bias from omitting a variable in estimating a
causal effect.
• Formula also applies to least squares estimates,
i.e., ˆ1*  ˆ1  ˆ1ˆ p1
Application of OVB formula
• 1  1*  1 p1
•
y=crime rate
{ y | arrest _ rate,, x p1  conviction_ rate}  0  1arrest _ rate     p1conviction_ rate
{ y | arrest _ rate,, x p }  0*  1*arrest _ rate     p* x p
{conviction_ rate | arrest _ rate, x2 ,, x p }   0   1arrest _ rate     p x p
• Here  p1 is probably negative. Increase in conviction
rate should reduce crimes, holding other variables fixed.
• Mustard presents evidence that  1 is negative. As more
people are arrested for a given offense level, amount of
evidence against each arrestee decreases.
*
*









1
1 p1 . 1 The
• If p1 and  1 both negative, then 1
estimate that a 1% increase would reduce the burglary rate
by 1.17% is an underestimate of the impact of increase in
arrest rate on reducing burglary rate (i.e., coefficient in loglog regression is <-.0117, reduction is greater than 1.17%).
Specially Constructed
Explanatory Variables
• Interaction variables
• Squared and higher polynomial terms for
curvature
• Dummy variables for categorical variables.
Interaction
• Interaction is a three-variable concept. One of
these is the response variable (Y) and the other
two are explanatory variables (X1 and X2).
• There is an interaction between X1 and X2 if the
impact of an increase in X2 on Y depends on the
level of X1.
• To incorporate interaction in multiple regression
model, we add the explanatory variable X1 * X 2 .
There is evidence of an interaction if the
coefficient on X1 * X 2 is significant (t-test has pvalue < .05).
An experiment to study how noise affects the performance of children tested second
grade hyperactive children and a control group of second graders who were not
hyperactive. One of the tasks involved solving math problems. The children solved
problems under both high-noise and low-noise conditions. Here are the mean scores:
Mean Mathematics Score
250
200
150
High Noise
Low Noise
100
50
0
Control
Hyperactive
Let Y=Mean Mathematics Score, X 1  Type of Child (0= Control, 1 = Hyperactive),
X 2 =Type of Noise (0= Low Noise, 1= High Noise). There is an interaction between
type of child and type of noise: Impact of increasing noise from low to high depends on
the type of child.
Interaction Model for Pollution
Data
{Y | precip, educ, nonwhit, log HC} 
0  1 precip   2educ 3nonwhit 4 log HC  5 * log HC * precip
{Y | precip  x1, educ  x2 , nonwhit x3 , log HC  x4  1)} 
{Y | precip  x1, educ  x2 , nonwhit x3 , log HC  x4 )} 
 4  5 * x1
Response MORTALITY
Summary of Fit
RSquare
RSquare Adj
Root Mean Square Error
0.703313
0.675842
35.41441
Parameter Estimates
Term
Intercept
PRECIP
EDUC
NONWHITE
Log HC
Log HC*Precip
Estimate
1118.6838
-1.728878
-18.72354
2.3882226
-21.47471
1.2550598
Std Error
88.82142
1.202121
6.393312
0.633573
10.85506
0.334228
t Ratio
12.59
-1.44
-2.93
3.77
-1.98
3.76
Prob>|t|
<.0001
0.1562
0.0050
0.0004
0.0530
0.0004
There is strong evidence (p-value =.0004) that there is an
interaction between hydrocarbons and precipitation.
The impact of an increase in hydrocarbons on mean
mortality, holding fixed education, nonwhite and
precipitation is greater for higher precipitation levels.
Polynomials and Interactions
Example
• An analyst working for a fast food chain is
asked to construct a multiple regression
model to identify new locations that are
likely to be profitable. The analyst has for a
sample of 25 locations the annual gross
revenue of the restaurant (y), the mean
annual household income and the mean age
of children in the area. Data in
fastfoodchain.jmp
Scatterplot Matrix
1300
1200
1100
Revenue
1000
900
35
30
Income
25
20
15.0
12.5
10.0
Age
7.5
5.0
900 1000 1100 12001300
20
25
30
35
5.0
7.5 10.0 12.5 15.0
Relationship between revenue and income and between
revenue and age is quadratic. Members of relatively
poor or relatively affluent households are less likely to
eat at this chain’s restaurants, since the restaurants
attract mostly middle-income customers.
The quadratic relationship cannot be easily captured by a
transformation. Curvature between y and x falls into two
quadrants of circle in Tukey’s Bulging Rule.
Polynomial Terms for Curvature
• To model a curved relationship between y and x,
we can add squared (and cubic or higher order)
terms as explanatory variables.
{Y | X }  0  1 X  2 X 2
• Fit as a multiple regression with two explanatory
variables X and X 2
• To draw a plot of the estimated mean of Y|X, after
Fit Model, click red triangle next to Response,
Save Columns, Predicted Values. Then click
Graph, Overlay Plot and Put Predicted Revenue
and Revenue into Y, Columns and Income into X.
Left Click on the Box next to Predicted Revenue
in the legend and select Connect Points.
Response Revenue
Parameter Estimates
Term
Intercept
Income
Income sq
Estimate
-1454.521
209.81481
-4.170503
Std Error
279.9928
24.0841
0.504009
t Ratio
-5.19
8.71
-8.27
Prob>|t|
<.0001
<.0001
<.0001
Strong evidence that using income and income squared
term provides better predictions than just using income
term (p-value < .0001).
Overlay Plot
B ivari ate Fit of Resi dual Revenue By Income
1400
150
1300
100
Residual Rev enue
1200
Y
1100
1000
900
0
-50
800
-100
700
-150
15
10
15
20
25
Income
Y
50
Revenue
Predicted Revenue
30
35
40
20
25
Income
30
35
Interpreting Coefficients and
Tests for Polynomial Model
• Coefficients are not directly interpretable. Change in the
mean of Y that is associated with a one unit increase in X
depends on X.
2
{Y | X  1}  {Y | X }  [  0  1 ( X  1)   2 ( X  1) ] 
[  0  1 X   2 X 2 ] 
X2
1   2 [(2 * X )  1]
• To test whether the multiple regression model with X and
X2 as predictors provides better predictions than the
multiple regression model with just X, use the p-value of
the t-test on the X2 coefficient (null hypothesis is that X2
has a zero coefficient).
• Plot residuals vs. X to determine whether quadratic model
is appropriate. If there is still a pattern in the mean, can try
a cubic model with X, X2 and X3.
Regression Model for Fast Food
Chain Data
• Interactions and polynomial terms can be
combined in a multiple regression model
• For fast food chain data, we consider the model
{revenue| age, incom e}  0  1 * age  2 * incom e
 4 * age2  5 * incom e2  6 * age* incom e
• This is called a second-order model because it
includes all squares and interactions of original
explanatory variables.
fastfoodchain.jmp results
Parameter Estimates
Term
Intercept
Income
Age
Income sq
Age sq
(Income)( Age)
Estimate
Std Error
t Ratio
Prob>|t|
-1133.981
173.20317
23.549963
-3.726129
-3.868707
1.9672682
320.0193
28.20399
32.23447
0.542156
1.179054
0.944082
-3.54
6.14
0.73
-6.87
-3.28
2.08
0.0022
<.0001
0.4739
<.0001
0.0039
0.0509
• Strong evidence of a quadratic relationship
between revenue and age, revenue and
income. Moderate evidence of an
interaction between age and income.
Categorical variables
• Categorical (nominal) variables: Variables that
define group membership, e.g., sex (male/female),
color (blue/green/red), county (Bucks County,
Chester County, Delaware County, Philadelphia
County).
• Categorical variables can be incorporated into
regression through dummy variables.
• They can also be directly incorporated, as is done
in JMP.
Fedex data set
• Before it was a well-known company, FedEx undertook a campaign to
promote use of its Courier packages (now called Fedex Paks). Sales
representatives visited customers and worked to increase their use of
the packages. Some of the customers were already aware of the
Courier packaging before the promotion began, but it was unknown to
others.
• Response variable: Number of Courier package shipments per month.
Explanatory variables: (1) Number of contact hours customer had with
sales representative (hours of effort), (2) Categorical variable
indicating whether or not promotion was effective for customers who
were already aware of product (aware)
• Question: Was this promotion more effective for customers who were
already aware of the product, or was it more effective for those who
had been unaware.
Two sample analysis
Mailings
90
80
60
40
30
10
-10
NO
YES
Aware
Oneway Anova
Summary of Fit
Rsquare
Root Mean Square Error
Mean of Response
Observations (or Sum Wgts)
0.0703
22.094
34.616
125
t Test NO-YES
Assuming equal variances
Difference
Std Err Dif
Upper CL Dif
Lower CL Dif
-12.307
4.034
-4.322
-20.291
t Ratio
DF
Prob > |t|
Prob > t
-3.05084
123
0.0028
0.9986
Problem with two sample
analysis: Hours of effort may be
a confounding variable.
Dummy Variables
 Define dummy variables
Di = 1 if customer “aware”
Di = 0 if customer “not aware”
 Multiple regression model
 y hours ,D  0  1  hours  2 D
 Interpretation: 2 is the difference in the mean mailings
for two groups of customers who have the same hours
of contact but one group is aware and one group is not
aware.
 Note that  2  1   2  0   2
Parallel lines regression model
Response Mailings
Summary of Fit
RSquare
RSquare Adj
Root Mean Square Error
Mean of Response
Observations (or Sum Wgts)
0.753889
0.749854
11.41459
34.616
125
Analysis of Variance
Source
Model
Error
C. Total
DF
Sum of Squares
Mean Square
F Ratio
2
122
124
48691.845
15895.723
64587.568
24345.9
130.3
186.8554
Prob > F
<.0001
Parameter Estimates
Term
Intercept
Hours of Effort
D
Estimate
Std Error
t Ratio
Prob>|t|
-1.094183
15.621837
10.488285
2.129472
0.848664
2.086349
-0.51
18.41
5.03
0.6083
<.0001
<.0001
When hours of effort is controlled for, being aware has a substantial impact,
increasing the mean mailings by an estimated 10.5 with the p-value being <.0001
for the null hypothesis that the aware and not aware groups have the same mean
for a fixed hours of effort. Compare to the p-value of .60 for the two-sample
analysis. Hours of effort was a confounding variable in the two-sample analysis.
Predicted Mailings
Bivariate Fit of Predicted Mailings By Hours of Effort
Linear Fit Aware=="NO"
70
Predicted Mailings = -1.094183 +
15.621837 Hours of Effort
50
Linear Fit Aware=="YES"
Predicted Mailings = 9.3941021 +
15.621837 Hours of Effort
30
20
Response Mailings
Whole Model
Regression Plot
0
90
Linear Fit Aware=="NO"
Linear Fit Aware=="YES"
70
Mailings
0 .5 1 1.5 2 2.5 3 3.5 4 4.5
Hours of Effort
50
30
10
-10
0
.5
1
1.5 2
2.5 3
3.5 4
4.5
Hours of Effort
NO
YES
• Parallel Regression Lines Model:
 y|hours ,D   0 1hours  2 D
 y|hours ,D0  0  1hours
 y|hours ,D1   0  1hours  2  (  0   2 )  1hours