Is the effect of some cause different for different sets of cases?
Did the local success of an explicitly secular political party, Indian National Congress (INC), reduce the likelihood of religious riots between Hindus and Muslims in India?
Nellis et al compare the incidence of riots in districts in which the INC barely won and barely lost MLA elections (w/ in 1 ppt).
They estimate the model:
\[\mathrm{Any \ Riot}_{it} = \alpha + \beta_1 \mathrm{INC \ Victory}_{it} + \epsilon_{it}\]
Any Riot | |
---|---|
Intercept | 0.236 |
(0.022) | |
INC Win | −0.076 |
(0.031) | |
Num.Obs. | 644 |
R2 | 0.009 |
Wilkinson (2004) argues that political parties work to stop religious riots in India when Muslims are electorally pivotal.
If the INC was responsive to this electoral logic, we should expect causal effect of INC victory on riots to be stronger when the ENP was above the median:
This is a Binary by Binary interaction:
How do we estimate an interaction effect?
Include both causal variable and interacting variable, AND their product.
\(y_i = \beta_0 + \beta_1 D_i + \beta_2 X_i+ \beta_3 D_iX_i + \epsilon_i\)
Easy to do in R
:
m2 = lm(any_riot ~ INC_win*high_enp, data = riots)
m3 = lm(any_riot ~ INC_win + high_enp + INC_win:high_enp,
data = riots)
*
expands out the ‘main’ effects and interaction
effects
:
just multiplies two variables together, no ‘main’
effects
Any Riot | |
---|---|
Intercept | 0.242 |
(0.032) | |
INC Win | −0.084 |
(0.045) | |
High ENP | −0.009 |
(0.045) | |
INC Win x High ENP | 0.012 |
(0.063) | |
Num.Obs. | 636 |
R2 | 0.010 |
Different intercepts (means) for each group:
INC Lose | INC Win | |
---|---|---|
ENP Low | Intercept |
Intercept + INC_win |
ENP High | Intercept + high_enp |
Intercept + high_enp + INC_win + INC_win:high_enp |
Interpretation:
Interaction Effects: Effect of INC victory differs across ENP?
INC_win:high_enp
tells us how much more likely riots
are (on average) when INC wins vs loses in High ENP districts, compared
to when INC wins vs loses in Low ENP districts.“Main Effects”:
INC_win
: change probability of riot when INC wins (vs
loses) in low ENP areas.hign_enp
: difference in probability of riot in high vs
low ENP areas where INC loses.Different intercepts (means) for each group:
Untreated | Treated | |
---|---|---|
Pre | Intercept |
Intercept + Treated |
Post | Intercept + Post |
Intercept + Treated + Post + Treated:Post |
lm(Y ~ Treated*Post, data = data)
If we have many treated, many untreated units \(i\), across multiple time periods \(t\), it is common to do this:
lm(Y ~ Treated*Post + dummy_i + dummy_t, data = data)
feols(Y ~ Treated*Post | dummy_i + dummy_t, data = data)
Which of these four coefficients will we be able to actually estimate? (think about linear independence)
Intercept + Treated + Post + Treated:Post
Rather than fitting different intercepts for groups:
Assumptions
Assumptions
We can look at voting for Black Suffrage in Iowa.
Recall: investigation of effect of enlistment rates in the Civil War and on change in voting for suffrage between 1857 and 1868 (pre- and post- war).
Does the effect of having veterans in a county depend on what happened during their military service?
Suffrage Change | |
---|---|
Intercept | 0.638 |
(0.170) | |
Enlist Rate | −0.577 |
(0.519) | |
Combat Days | −0.010 |
(0.005) | |
Enlist X Combat | 0.031 |
(0.016) | |
Num.Obs. | 79 |
R2 | 0.193 |
We can center both variables at \(0\) to make it easier to interpret:
Suffrage Change | |
---|---|
Intercept | 0.449 |
(0.010) | |
Enlist Rate (0- | 0.524 |
(0.125) | |
Combat Days (0) | 0.000 |
(0.001) | |
Enlist X Combat | 0.031 |
(0.016) | |
Num.Obs. | 79 |
R2 | 0.193 |
Now main effects are interpretable.
For continuous interactions, we need to calculate the marginal effect
marginal effect: unit effect of \(x\) on \(y\) at a given value of \(z\).
\(y_i = \beta_0 + \beta_1 x_i+ \beta_2 z_i+ \beta_3 x_iz_i + \epsilon_i\)
Marginal effects have their own standard errors.
\(Var(aX + bZ) = a^2 Var(X) + b^2 Var(Z) + 2ab Cov(X,Z)\)
\(Var(\beta_1 + z_i \beta_3) = Var(\beta_1) + z_i^2 Var(\beta_3) + 2z_i Cov(\beta_1,\beta_3)\)
Standard Errors:
Hainmueller et al show this can go wrong:
interflex
package
helpful for:
interflex
package to handle thisMain identifying assumption (for unbiased estimates of causal effects) is:
Cinella and Hazlett (2020) develop tools to analyze sensitivity of regression results to violations of conditional independence assumption:
Link to partial identification:
Effect of income on Anti-Muslim Prejudice in Myanmar
linear | |
---|---|
(Intercept) | 0.794*** (0.013) |
svy_sh_income_rc | −0.053*** (0.004) |
svy_sh_female_rc | 0.054*** (0.005) |
svy_sh_age_rc.L | 0.028** (0.010) |
svy_sh_age_rc.Q | −0.010 (0.009) |
svy_sh_age_rc.C | 0.010 (0.008) |
svy_sh_age_rc^4 | −0.006 (0.007) |
svy_sh_age_rc^5 | −0.008 (0.006) |
svy_sh_education_rc.L | −0.097*** (0.012) |
svy_sh_education_rc.Q | 0.054*** (0.011) |
svy_sh_education_rc.C | 0.132*** (0.012) |
svy_sh_education_rc^4 | 0.070*** (0.011) |
svy_sh_education_rc^5 | 0.028*** (0.007) |
svy_sh_ethnicity_rcChin | 0.035** (0.013) |
svy_sh_ethnicity_rcMon | 0.040** (0.015) |
svy_sh_ethnicity_rcKachin | 0.046+ (0.024) |
svy_sh_ethnicity_rcKayah | 0.063*** (0.016) |
svy_sh_ethnicity_rcKayin | 0.023* (0.010) |
svy_sh_ethnicity_rcRakhine | 0.105*** (0.023) |
svy_sh_ethnicity_rcShan | 0.012 (0.008) |
svy_sh_ethnicity_rcMixed ancestry | 0.010 (0.030) |
svy_sh_ethnicity_rcNon-TYT | −0.116*** (0.013) |
svy_sh_religion_rcChristian | −0.116*** (0.010) |
svy_sh_religion_rcMuslim | −0.598*** (0.014) |
svy_sh_religion_rcHindu | −0.151*** (0.026) |
svy_sh_religion_rcAnimist | −0.013 (0.049) |
svy_sh_religion_rcAthiest | −0.670*** (0.100) |
svy_sh_religion_rcOther | −0.499* (0.194) |
svy_sh_profession_type_rc2 | −0.005 (0.010) |
svy_sh_profession_type_rc3 | −0.025* (0.011) |
svy_sh_profession_type_rc4 | −0.027** (0.010) |
svy_sh_profession_type_rc5 | 0.000 (0.010) |
svy_sh_profession_type_rc6 | 0.002 (0.018) |
svy_sh_income_source_rcDay Labour | −0.011 (0.011) |
svy_sh_income_source_rcRetired | −0.006 (0.027) |
svy_sh_income_source_rcService Provider | −0.008 (0.012) |
svy_sh_income_source_rcShop Owner | −0.013 (0.012) |
svy_sh_income_source_rcStaff | −0.003 (0.011) |
svy_sh_income_source_rcTrader | −0.037* (0.016) |
Num.Obs. | 28179 |
R2 | 0.161 |
RMSE | 0.43 |
require(sensemakr)
require(stringr)
covars = model.matrix(m_linear) %>% colnames
covars_edu = covars %>% str_detect("education") %>% covars[.]
myanmar.sensitivity <- sensemakr(model = m_linear,
treatment = "svy_sh_income_rc",
benchmark_covariates = list('education' = covars_edu),
kd = 1:3,
ky = 1:3,
q = 1,
alpha = 0.05,
reduce = TRUE)
Adjusted effect for confounder 1-3 times larger than education.
Adjusted effect if confounder explained all or most of the outcome
Using the veterans
data:
suff65_yes
on enlist_rate
,
suff57_yes
, and state
.sensemakr
, examine the sensitivity of
enlist_rate
, using suff57_yes
as the
‘benchmark’plot(enlist_sensitivity)
We have previously assumed we measured variables without error. Not a reasonable assumption. How does this affect estimated effects of \(D\)?
if errors in measurements (of \(D\) or \(Y\)) correlated with causal variable \(D\), estimates will be biased (can even be confounding)
if measurements have random error, it depends…
First, the good news:
If we have random measurement error in \(Y\) or \(D\), problems are manageable.
This is our model:
\[Y^* = \alpha + \beta D^* + \epsilon\]
\(Y^*\) is the true value of the variable that we observe as \(Y\).
\[Y = Y^* + \nu\]
\(D^*\) is the true value of the variable that we observe as \(D\).
\[D = D^* + \eta\]
What happens when we have measurement error in \(Y\)?
\[Y = \alpha + \beta D^* + \epsilon + \nu\]
Recall: \(E(\nu) = 0; Cov(D^*,\nu) = 0\). So, estimate \(\widehat{\beta}\) for \(\beta\) is unbiased.
Standard errors are affected:
What happens when we have measurement error in \(D\)?
\[Y^* = \alpha + \beta (D - \eta) + \epsilon\]
If we estimate the model using just \(D\), not \(D^*\)
\[Y^* = \alpha + \beta D + \rho\]
\[cov(D, \rho) = cov(D^* + \eta, \epsilon - \beta\eta) = -\beta \sigma^2_\eta \neq 0\]
What happens when we have measurement error in \(D\)?
We get bias… but what does this bias look like?
\[\small\begin{eqnarray} \widehat{\beta} &=& \frac{Cov(D, Y^*)}{Var(D)} \\ &=& \frac{Cov(D^* + \eta, \alpha + \beta D^* + \epsilon)}{Var(D^* + \eta)} \\ &=& \frac{\beta Cov(D^*, D^*)}{Var(D^*) + Var(\eta)} \\ &=& \beta \frac{Var(D^*)}{Var(D^*) + Var(\eta)} \\ \end{eqnarray}\]
Attenuation bias!
\[\widehat{\beta} = \beta \frac{Var(D^*)}{Var(D^*) + Var(\eta)}\]
This is \(\beta\) times a ratio of variance of true value over that of the observed. (Signal to noise). As the errors \(\eta\) increase, this ratio goes toward \(0\). So \(\widehat{\beta}\) suffers from attenuation bias.
Our estimates of \(\beta\) will be biased toward zero, which may be “conservative”.
What if we to estimate the causal effect of \(D\) on \(Y\), conditioning on \(X\)?
Imagine we evaluate the effect of COVID vaccination for people who self select into the vaccine.
What is the effect of the vaccine? We can naively compare people who select into vaccination…
Vaccine | Conspiracy | N | COVID.Rate |
---|---|---|---|
Yes | Yes | 100 | 0.010 |
Yes | No | 400 | 0.005 |
No | Yes | 400 | 0.100 |
No | No | 100 | 0.050 |
What is the naive (without conditioning) estimated effect of vaccination?
Or we can condition on, e.g., belief in conspiracies about COVID/vaccines that might relate to vaccine uptake and other COVID propensities…
Vaccine | Conspiracy | N | COVID.Rate |
---|---|---|---|
Yes | Yes | 100 | 0.010 |
Yes | No | 400 | 0.005 |
No | Yes | 400 | 0.100 |
No | No | 100 | 0.050 |
In this example:
Failing to condition on conspiracy beliefs leads us to overstate the effect of vaccines, because…
What if we measure conspiracy beliefs with error: 40 percent chance of incorrect classification. We observe this data:
Vaccine | Conspiracy | N | COVID.Rate |
---|---|---|---|
Yes | Yes | 220 | 0.0064 |
Yes | No | 280 | 0.0057 |
No | Yes | 280 | 0.0930 |
No | No | 220 | 0.0860 |
What is the naive (no conditioning) estimate of the effect of the vaccine?
What is the estimated effect of the vaccine conditioning on conspiracy-belief?