6
$\begingroup$

How do I conduct a mediation analysis in a difference-in-difference setting? For example, a city selects some neighborhoods for a new crime fighting strategy (the treatment $D$) that involves an increase in the number of police officers on the street (mechanism $M_1$), additional surveillance cameras (mechanism $M_2$), an increase in misdemeanor arrests ($M_3$) and potentially other unmeasured components (e.g. change in leadership etc).

To estimate the effect of $D$ on crime, I can use a simple difference in difference model.

$$ y_{jt} = \delta_j + \gamma_t + \phi D_{jt} + \epsilon_{jt} $$

$y$ is the crime rate by neighborhood $j$ and year $t$. $D_{jt}$ signifies the neighborhoods and years in which the new crime fighting strategy was in place. The relevant coefficient for the overall effect of the treatment is $\phi$.

Now my question: How do I determine which element of the policy was effective (increase in officers, additional cameras, increase in misdemeanor arrests)? I see two relevant questions here:

  • Did $M_x$ mediate the relation between $D$ and $Y$?
  • What is the effect of $M_x$ on $y$ and can I use the variation in $M_x$ created by the policy to estimate the effect of $M_x$?
$\endgroup$
2
  • $\begingroup$ Is there variation in the three Ms across treated neighborhoods? $\endgroup$
    – dimitriy
    Commented Feb 10, 2017 at 23:27
  • $\begingroup$ Yes, there is variation in the Ms across treated (and across untreated) neighborhoods. $\endgroup$
    – greg
    Commented Feb 10, 2017 at 23:29

2 Answers 2

4
+100
$\begingroup$

You need to explicitly think about a causal model for $Y$ including the $M^x$. It seems you are assuming the effect of $D$ on $Y$ is a constant $\phi$, so I'll assume constant effects throughout.

You could postulate that

$$ Y_{jt} = \delta^1_j + \gamma^1_t + \phi^1 D_{jt} + M_{jt}\alpha + \epsilon^1_{jt} $$

where $M_{jt}$ is a vector of all $M^x$ and $\alpha$ is a vector of coefficients. Then, $\phi^1$ is what the mediation literature would call the controlled direct effect of D, fixing the mediators $M^x$. Since we are assuming constant effects, this then also equals the so-called natural direct effect.

Under these assumptions, if $\phi^1$ is zero, then any causal effect $D$ has on $Y$ must flow through the mediators. It also holds under these assumptions that

$$ ATE = \phi = \phi^1 + NIE$$

where NIE stands for natural indirect effect, so that by identifying $\phi$ and $\phi^1$, you get the NIE "for free".

You assume that $\phi$ is identified via DiD. However, that does not automatically identify $\phi^1$. You need to assume that $\epsilon^1_{jt}$ is mean independent from D. In this context, this means to assume no unobserved variables besides $D$ and the unit/time FE influencing both $M$ and $Y$.

If this seems plausible, $\phi^1$ can be estimated by a regression of $Y$ on unit and time FE and D and M. That means that the usual advice not to adjust for post-treatment variables becomes moot, because we need to net out the indirect effect of $D$ through $M$.

Things get more a bit more tricky when the $M^x$ influence each other. However, this is testable under the no-confounding assumption: Simply regress any $M^x$ on $D$ and the other two mediators (and fixed effects). If any regression coefficient of the $M$s is different from zero, then either the no-confounding or the mediator-do-not-influence-each-other assumption is wrong.

If you're interested in the effect of $M^x$ on $Y$ only, under no-confounding, a simple FE regression of $Y$ on $M^x$ and $D$ will do under constant effects. Again, you then would also need to think about the relationship between the mediators in order to decide for which you needed to adjust in that regression.

$\endgroup$
3
  • $\begingroup$ The assumption that no variables besides D influence both M and Y is obviously untenable. M_1 is the number of police officers on the street while Y is the crime rate. Clearly, crime rate affects the number of police officers on the street, which makes M_1 a "collider" variable (i.e. endogenous). Your answer relies heavily on this assumption, and if the assumption does not hold (good luck convincing anyone crime doesn't affect the number of police), your answer does not follow. $\endgroup$
    – Peter
    Commented Feb 21, 2017 at 15:24
  • $\begingroup$ @Peter I do not know OPs specific data set, so not sure about the identification assumptions. He thinks the effect of D on Y is somehow identified, so maybe the CDE etc. is as well?. I wanted to give a general methodological answer that can be applied to any substantive context. $\endgroup$ Commented Feb 21, 2017 at 15:53
  • $\begingroup$ Assuming no variables besides D influence both M and Y means you've assumed AWAY all the difficulty that underlies the question. To say that this assumption/approach can be applied to any substantive context is like telling a person who wants to learn how to dunk a basketball: first assume you can dunk, then dunk. $\endgroup$
    – Peter
    Commented Feb 21, 2017 at 18:58
2
$\begingroup$

For the second question, I think you can use $D$ as an instrumental variable for your $M_{x}$ variables (one $x$ at a time) like this. \begin{align} M_{jt}^{x} &= \lambda_j + \theta_t + \pi D_{jt} + \nu_{jt} \tag{First stage}\\ y_{jt} &= \delta_j + \gamma_t + \phi M_{jt}^{x} + \epsilon_{jt} \tag{Outcome equation} \end{align}

The interpretation of $\phi$ (using $M_{1}$ as an example) is the effect of an increase in the number of police officers on the street on neighborhood crime rate for those neighborhoods that have more police officers on the street because they were selected for a new crime fighting strategy (local average treatment effect).

The paper I have in mind is Stephens and Yang (2014), which is about education and schooling (and actually criticizing a commonly used approach in that literature), but anyway, that's where I got the idea from.

$\endgroup$
5
  • $\begingroup$ I thought about IV but the problem is the exclusion restriction -- i.e. the assumption that the only link between D and Y goes through M_j. I could control for the other measured M, which partly addresses the problem, but relies on the assumption that there are no other unobserved M. Correct? $\endgroup$
    – greg
    Commented Feb 13, 2017 at 17:41
  • $\begingroup$ @greg Slapping myself as I forgot the exclusion restriction. I agree that you could control for the other observed Ms, but you'd be assuming there are no unobserved Ms. $\endgroup$
    – Peter
    Commented Feb 13, 2017 at 21:04
  • $\begingroup$ This does not make any sense. OP explicitly asks how to check whether M mediates the effect of D on Y. Your approach ASSUMES it COMPLETELY mediates, and provides an altnerative approach to identify the ATE of D, which the OP assumes is identified anyways via DiD! $\endgroup$ Commented Feb 20, 2017 at 11:50
  • $\begingroup$ @JulianSchuessler, that is why I started my reply with "For the second question,..." $\endgroup$
    – Peter
    Commented Feb 21, 2017 at 14:57
  • $\begingroup$ @Peter OPs first question implies D potentially affects Y through channels other than the specific M. Then D can not be a valid IV. Certainly also not conditional on the other Ms, if these and Y are also driven by unobserved confounders. Then, even conditional on the other Ms, D and Y will be connected because one conditions on colliders. $\endgroup$ Commented Feb 21, 2017 at 15:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.