# Regression model for a difference-in-difference analysis with three time points

I'm doing a difference-in-differences analysis with one pre-treatment time point (0), and two post-treatment time points (1, 2).

What would the regression model be?

Consider first the most basic form of a DID model, where $$T$$ is a dummy variable that equals one past the treatment time and 0 otherwise, and $$S$$ is a dummy variable that equals one if in the treatment group and 0 otherwise, and $$\varepsilon$$ is iid error:

$$$$y = \beta_0 + \beta_1T +\beta_2S + \beta_3(S*T) + \varepsilon$$$$

The DID effect is equal to $$\beta_3$$

We could just extend this basic format to accommodate more treatment times in the following way. Let $$T_1$$ equal one when time is after the first treatment time but before the second treatment time and 0 otherwise and $$T_2$$ equal one when time is after the second treatment time and 0 otherwise. S and $$\varepsilon$$ are still defined as they were above.

$$$$y = \beta_0 + \beta_1T_1 +\beta_2T_2 + \beta_3S + \beta_4(S*T_1) + \beta_5(S*T_2) + \varepsilon$$$$

The DID effects for treatment times $$T_1$$ and $$T_2$$ are $$\beta_4$$ and $$\beta_5$$ respectively.

• Very clear and helpful, thanks. – hassapikos Jun 5 '19 at 14:33