# Difference in difference with interaction

I am trying to estimate a causal effect using a difference in difference estimator. I suspect there will be a different effect for small and large firms. I am interested in this different effect. I want to know if it is statistically significantly different.

$$y_it =d_t* \beta1+Treated_i* \beta2+Treated_i *d_t *\beta3+big_i*d_t*\beta4+big_i *Treated_i*\beta5+Treated_i*d_t*big_i*\beta6+\epsilon$$ Where big is a dummy indicating whether the firm is small or big. 'd' is an indicator for the moment of treatment and treated is an dummy for being in the treatment group. The function will include some control variables, to ensure the trend in the residuals is similar.

This was the formula I was thinking of using. Or do I only need to interact the actual treatment effect with the interaction term (rather than the treatment moment and treatmentgroup dummy as well)? Furthermore am I correct in thinking that this will satisfy the assumptions underlying the DiD estimator ? The trends in the pre-treatment period will be the same, conditional on being a large or small firm, which is captured by this setup. The treatment is an exogeneous shock.

If this is not a valid approach, what is a suitable alternative ? I thought of running the DiD separately for the small and big sample, but this will not tell me anything about which group faces a bigger effect. At least not in a way that I can statistically test which one is stronger.

A triple difference-in-difference is the correct specification for this problem. I'll present a conceptual explanation and then a mathematical one.

Conceptually, the standard (double) difference-in-difference can also be thought of as estimating heterogeneous treatment effect. In this perspective, time is the "treatment", and we want to estimate how time affects the outcome differentially across two groups. (Of course, time itself doesn't cause anything. It's just a stand-in for the real treatment that happens between the two time periods).

Thus, we can extend the standard D-in-D into triple D-in-D if we want to add another layer of heterogeneous treatment effect (i.e. the heterogeneity across big firms vs small firms in your cases).

Mathematically, the specification would be as follows:

$$Y = \alpha + \beta_1 T + \beta_2 G + \beta_3 B + \gamma_1 TG + \gamma_2 GB + \gamma_3 TB + \delta_1 TGB$$

with

\begin{align} T &= \text{treatment time} \\ G &= \text{treatment group} \\ B &= \text{big firms} \end{align}

The DD estimate for treatment effect in small firms is $\gamma_1$ (exactly the same as the standard DD)

The DD estimate for treatment effect in big firms is $\gamma_1 + \delta_1$

Thus the treatment effect for big and small firms differs by $(\gamma_1 + \delta_1) - \gamma_1 = \delta_1$, which is also the coefficient of the triple interaction term, or the DDD estimate.

I think this (exploring the heterogeneous treatment effects of DD for different groups) could be easily confused with the DDD method. However, they share the same specification, I'd just run the following: $y_{it} = \alpha + \beta_1 d_t + \beta_2 Treat_i + \beta_3 d_t \times Treat_i + \\ \beta_4 big_i + \beta_5 big_i\times Treat_i + \beta_6 big_i \times d_t + \\ \delta_0 d_t \times Treat_i \times big _i + \epsilon _{it}$

where $\delta_0$ is what you want.

$\delta_0 = [(\bar{y}_{Treat,2}-\bar{y}_{Treat,1})-(\bar{y}_{Control,2}-\bar{y}_{Control,1})]_{big}-[(\bar{y}_{Treat,2}-\bar{y}_{Treat,1})-(\bar{y}_{Control,2}-\bar{y}_{Control,1})]_{small}$