Presentation on theme: "1 Quantitative Methods II Dummy Variables & Interaction Effects Edmund Malesky, Ph.D., UCSD."— Presentation transcript:
1 Quantitative Methods II Dummy Variables & Interaction Effects Edmund Malesky, Ph.D., UCSD
2 The Homogeneity Assumption OLS assumes all cases in your data are comparable xs 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
3 Qualitative Variables These group effects remain as part of the error term If groups differ in their distribution of xs, then we get a correlation between the X variables and the error term Violates assumption: cov(X i, u i )=E(u)=0 Omitted Variable Bias!
4 Testing for Differences Across Groups (p ) The Chow Test i.e. Testing for difference between males and females on academic performance. SSR 1 =Males only; SSR 2 =Females only SSR ur =SSR 1 +SSR 2 SSR P =SSR r =Pooling across both groups The Chow Test: 1.Is only valid under homoskedasticity (the error variance for the two groups must be equal). 2.The null hypothesis is that there is no difference at all; either in the intercept or the slope between the two groups. 3.This may be two restrictive in these cases, we should allow dummy variables and dummy interactions to allow us to predict different slopes and intercepts for the two groups.
5 Example: Democracy & Tariffs Here we see that democracies have lower tariffs Here we see that states in Regional Trading Arrangements (RTAs) have lower tariffs But if Democracies are more likely to be in RTAs, then pooling RTA and non-RTA states biases the coefficient
6 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 RTAs Create a categorical variable that captures this group difference
7 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:
8 Democracy and Tariff Barriers
9 x 1 (could be continuous, categorical, or dichotomous) y Graphical Depiction of a Dummy
10 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
11 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.
12 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
13 Interpreting Multi-Category Dummies Each coefficient compares the mean for that group to the mean in the excluded category Thus if: β hat 2 -β hat 4 compare the mean tariff in each region to the mean in the Americas Mean in Americas is β hat 0 An alternative strategy is to drop the constant and run all dummies, as discussed last week.
14 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
15 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?
16 Interaction Effects: An Example What if the effect of democracy on tariffs depends on whether the state is in an RTA?
17 Interaction Effects: An Illustration (Notice that democracy has been converted to a dummy as well for illustration purposes)
18 How Do We Estimate This Set of Relationships? We begin with: Substituting for Β hat 1, we get: Β hat 1 Β hat 2 Β hat 3 In STATA, they will appear as regular coefficients
19 What Do These Coefficients Mean?
20 Interpreting the Interaction Recall that: RTA is a dummy variable taking on the values 0 or 1
21 An Illustration of the Coefficients Imagine we estimate:
22 Substantive Effects of Dummy Interactions No RTARTA Non- Democracy Β hat 0 =30 Β hat 0 + Β hat 3 =20 DemocracyΒ hat 0 + Β hat 1 =25 14 Β hat 0 + Β hat 1 + Β hat 2 + Β hat 3 = 14
23 Interactions with Continuous Variables The exact same logic about interactions applies if Β hat 1 depends on a continuous variable
24 Example: Democracy, Tariffs & Unemployment
25 x 1 (could be continuous, categorical, or dichotomous) y Graphical Depiction of a Dummy/Continuous Interaction
26 What if a Variable Interacts with Itself? What if Β hat 1 depends on the value of x 1 ? Then we substitute in as before: Curvilinear (Quadratic) effect is a type of interaction
27 More Complex Interactions We can use this method to specify the functional form of β hat 1 in any way we choose Simply substitute the function in for β hat 1, multiply out the terms and estimate Only limitations are theories of interaction and levels of collinearity
28 Examples of interaction effects from my own research
29 Governance and Economic Welfare
30 Predicted Number of Loans by Legal Status among Vietnamese Private Firms Land Use Rights Certificate Registered at DPI NonePartialFull No Yes
31 Predicted Probability of Provincial Division in Vietnam (By State Sector Output with Number of Cabinet Officials)