You are on page 1of 33

Quantitative

Methods II
Dummy Variables &
Interaction Effects

1
The Homogeneity Assumption
 OLS assumes all cases in your data are
comparable
 x’s are a sample drawn from a single
population
 But we may analyze distinct groups of
cases together in one analysis
 Mean value of y may differ by group

2
Qualitative Variables
 These group effects remain as part of the
error term
 If groups differ in their distribution of x’s,
then we get a correlation between the X
variables and the error term
 Violates assumption: cov(Xi, ui)=E(u)=0

 Omitted Variable Bias!

3
Testing for Differences Across
Groups (p. 249-252)
The Chow Test:
 The Chow Test 2. Is only valid under homoskedasticity (the
error variance for the two groups must be
 i.e. Testing for difference between equal).males and females on
academic performance.
3. The null hypothesis is that there is no
[ SSR p  ( SSR  SSR )] [n  2(k  1)]
difference at all; either in the intercept or
1 slope between
2
F the
* the two groups.

SSR4.1  This
SSRmay k in1these
2 be two restrictive
 SSR1=Males only;cases,
SSRwe 2
should allow dummy variables
=Females only
and dummy interactions to allow us to
 SSRur=SSR1+SSR predict
2 different slopes and intercepts for
the two groups.
 SSRP=SSRr=Pooling across both groups

4
Example: Democracy
But if Democracies are more & Tariffs
likely to be in RTA’s, then
pooling RTA and 40
35
non-RTA
 Here westates
see that
biases the
30 coefficient

Percent Tariffs
democracies have 25

lower tariffs 20
15
Pooled Data

10
5
0
 Here we see that Dictator Oligarch Anocracy Democracy

states in Regional 50

Trading 45
40
Percent Tariffs

Arrangements 35
30 RTA
(RTA’s) have lower 25
20
No RTA
Pooled Data
tariffs 15
10
5
0
Dictator Oligarch Anocracy Democracy
5
Solution: The Qualitative
Variable
 Measure this group difference (RTA vs.
Non-RTA) and specify it as an x
 This eliminates bias
 But we have no numerical scale to
measure RTA’s
 Create a categorical variable that captures
this group difference

6
The Qualitative “Dummy”
 Create a variable that equals 1 when a case is
part of a group, 0 otherwise
 This variable creates a new intercept for the
cases in the group marked by the dummy
 Specifically, how would we interpret:

TARIFF   0  1 DEM   2 RTA  u

7
Democracy and Tariff Barriers
50
45
40
35
Percent Tariffs

30
RTA
25
No RTA
20
15
10
5
0
Dictator Oligarch Anocracy Democracy

TARIFF  ˆ0  ˆ1 DEM  ˆ2 RTA  uˆ


ˆ  50K and K ˆ  5K and K ˆ  10
0 1 2
8
Graphical Depiction of a Dummy
y
yˆ  ˆ0  ˆ1 x1  ˆ2 x2 if x2  1
ŷ  ˆ0  ˆ1 x1

̂1

̂1

ˆ0  ˆ2
̂1
̂ 0 yˆ  ˆ0  ˆ1 x1  ˆ2 x2 if x2  0
̂ 0

x1 (could be continuous, categorical, or 9


dichotomous)
Multiple Category Dummies
 Dummy variables are a very flexible way
to assess categorical differences in the
mean of y
 We can use dummies even for concepts
with multiple categories
 Imagine we want to capture the impact of
global region on tariffs
 Regions: Americas, Europe, Asia, Africa
10
Warning!
 Do not fall into the dummy variable trap!
When you have entered both values of a
dummy variable in the same regression.
These two variables are linearly
dependent. One will drop out.

11
Multiple Category Dummies
 Create 4 separate dummy variables - 1 for
each region
 Include all except one of these dummies in
the equation
 If you include all 4 dummies you get
perfect collinearity with the constant. The
fourth dummy will drop out.
 Americas+Europe+Asia+Africa=1
12
Interpreting Multi-Category
Dummies
 Each coefficient compares the mean for that group to the
mean in the excluded category

 Thus if:
 βhat2-βhat4 compare the mean tariff in each region to the
mean in the Americas
TARIFF  ˆ0  ˆ1 DEM  ˆ2 EUR  ˆ3 ASIA  ˆ4 AFR  uˆ
 Mean in Americas is βhat0
 An alternative strategy is to drop the constant and run all
dummies, as discussed last week.
13
Dumb Dummies
 Dummy variables are easy, flexible ways
to measure categorical concepts
 They CAN be just labels for ignorance
 Try to use dummies to capture theoretical
constructs not empirical observations
 If possible, measure the theoretical
construct more directly

14
Interaction Effects
 Dummy variables specify new intercepts
 Other slope coefficients in the equation do
not change
 OLS assumes that the slopes of
continuous variables are constant across
all cases
 What if slopes are different for different
groups in our sample?
15
Interaction Effects: An Example
 What if the effect of democracy on tariffs
depends on whether the state is in an RTA?

TARIFF  ˆ0  ˆ1DEM  ˆ2 RTA  uˆ


ˆ1  ˆ 0 ˆ1 RTA

16
Interaction Effects: An Illustration
(Notice that democracy has been converted to a dummy as
well for illustration purposes)
35
30
Percent Tariffs

25
20 RTA
15 No RTA

10
5
0
Non-Dem Democracy

TARIFF  ˆ0  ˆ1 DEM  ˆ2 RTA  u


ˆ  5K if K RTA  0
1

ˆ1  6K if K RTA  1


17
How Do We Estimate This Set
of Relationships?
 We begin with:
TARIFF  ˆ0  ˆ1 DEM  ˆ2 RTA  uˆ
ˆ1  ˆ 0  ˆ1 RTA
 Substituting for Βhat1, hat In STATA,Βthey
Β 1 hat will
2 Βhat3
we get: appear as regular
coefficients
TARIFF  ˆ0  (ˆ 0  ˆ1 RTA) DEM  ˆ2 RTA  uˆ
TARIFF  ˆ ˆ DEM ˆ RTA * DEM  ˆ RTA  uˆ
0 0 1 2
18
What Do These Coefficients
Mean?
TARIFF  ˆ0 ˆ 0 DEM ˆ1RTA * DEM  ˆ2 RTA  uˆ
ˆ0 is the intercept for DEM when RTA=0
ˆ0  ˆ2 is the new intercept for DEM when RTA=1
 0 is the slope of DEM when RTA=0
 1 is the impact of RTA on the coefficient for DEM
So if RTA=1, the slope of DEM is  0 + 1
19
Interpreting the Interaction
 Recall that: TARIFF  ˆ0  ˆ1 DEM  ˆ2 RTA  uˆ
ˆ1  ˆ 0  ˆ1 RTA

TARIFF  ˆ0  (ˆ 0  ˆ1 RTA) DEM  ˆ2 RTA  uˆ


TARIFF  ˆ  ˆ DEM  ˆ RTA * DEM  ˆ RTA  uˆ
0 0 1 2

 RTA is a dummy variable taking on the values 0


or 1
Thus if RTA=0, then ˆ1 =ˆ 0
But if RTA=1, then ˆ1 =ˆ 0 +ˆ1 20
An Illustration of the Coefficients
 Imagine we estimate:
TARIFF  30  5( DEM )  1( RTA * DEM )  10( RTA)
35
30
Percent Tariffs

25
20 RTA
15 No RTA

10
5
0
Non-Dem Democracy

21
Substantive Effects of Dummy
Interactions
No RTA RTA

Non- Βhat0 = Βhat0 + Βhat3 =


Democracy 30 20
Democracy Βhat0 + Βhat1 = Βhat0 + Βhat1 +
25 Βhat2 + Βhat3 = 14

22
Interactions with Continuous
Variables
 The exact same logic about interactions applies if
Βhat1 depends on a continuous variable
y  ˆ0  ˆ1x1  ˆ2 x 2  uˆ
ˆ  ˆ ˆ x
1 0 1 2

ˆ 0 is the impact of x1 when x 2 =0


ˆ1 is the change in ˆ1 for each one unit increase in x 2
ˆ2 is the impact of x 2 when x1 =0 23
Example:
Democracy, Tariffs & Unemployment
50 40
Tariff Rate
30 20
10

Dictator Oligarch Anocrat Demo


Democracy 1-4

yhat_, Unemployment == 0 yh at_, Unemplo ym ent == 2


yhat_, Unemployment == 4 yh at_, Unemplo ym ent == 6

TARIFF  28  2( DEM )  1( DEM *UNEMP)  5(UNEMP)


24
Graphical Depiction of a Dummy/Continuous
Interaction
y yˆ  ˆ0  0 x1  1 ( x1 * x2 )  ˆ3 x2 if x2  1
̂1   0  1
yˆ  ˆ0  ˆ1 x1  ˆ2 x2 if x2  1

̂1

̂1   0 yˆ  ˆ0  0 x1  1 ( x1 * x2 )  ˆ3 x2 if x2  0


̂ 0
̂ 0
ˆ0  ˆ3
x1 (could be continuous, categorical, or 25
dichotomous)
What if a Variable Interacts with
Itself?
 What if Βhat1 depends on the value of x1?

y  ˆ0  ˆ1x1  ˆ2 x 2  uˆ


ˆ1  ˆ 0  ˆ1x1
 Then we substitute in as before:
y  ˆ0  (ˆ 0  ˆ1x1 )x1  ˆ2 x 2  uˆ
y  ˆ  ˆ x  ˆ x 2  ˆ x  uˆ
0 0 1 1 1 2 2

 Curvilinear (Quadratic) effect is a type of


interaction 26
More Complex Interactions
 We can use this method to specify the
functional form of βhat1 in any way we
choose
 Simply substitute the function in for βhat1 ,
multiply out the terms and estimate
 Only limitations are theories of interaction
and levels of collinearity

27
Examples of
interaction effects
from my own research

28
Governance and Economic Welfare
2 004 G DP per capita (in M illions of Con stant 199 4 VN D)
15 Figure 4: PCI Performance and Economic Welfare

“The Governance Premium”


Better governed (high PCI)
provinces are able to
generate higher living
standards from the same
10

level of development
5
0

0 20 40 60 80 10 0
Structura l E n dowments (Infrastructure, H uma n C a pital, Proxim ity to M arkets)

Low PC I H igh PCI

29
Predicted Number of Loans by Legal Status
among Vietnamese Private Firms
Land Use Rights Certificate

Registered at DPI None Partial Full

No 0.83 0.99 1.2

Yes 2.73 3.27 3.98

30
Predicted Probability of Provincial Division in
Vietnam
Predicted Probablity of Provincial Division
(By State Sector Output with Number of Cabinet Officials)
.4 .5 .6 .7 .8

0 .2 .4 .6 .8 1
State Contribution to Provincial Output

No Cabinet Members 1 Cabinet Member


2+ Cabinet Members
Contribution of covariates at 75th percentile

31
32
33

You might also like