# Generalized difference-in-difference model in panel data

By "generalized", I mean the circumstance where I have more than 2 periods of time and 2 treatment groups whereas the typical D-I-D model involes just 2 periods, 1 treatment group and 1 control group. Moreover, an individual may jump between these treatment groups, say some observations may fall in treatment group A in period t but falls in treatment group B or control group in period t+1. Are there any methods or models particularly that can solve the problem like this?

• Have you consulted "Econometric Analysis of Cross Section and Panel Data" by J. Wooldridge? Several period DID models are surely mentioned there. The jumping individuals may be treated with appropriate dummy variables. – mpiktas Sep 26 '13 at 12:23
• Most commonly, people use fixed effects regression for this kind of situation. – Bill Sep 26 '13 at 14:26

The most common generalization is as follows (here I am following Bertrand et al. (2004), but for example Hansen (2007) also considers a similar approach):

Let $Y_{ist}$ be the outcome of interest for individual $i$ in group $s$ (such as a state) by time $t$ (such as a year) and $I_{st}$ be a dummy for whether the intervention has affected group $s$ at time $t$. One then typically estimates the following regression using OLS:

$Y_{ist}=A_s+B_t+cX_{ist}+\beta I_{st}+\epsilon_{ist}$

where $A_s$ and $B_t$ are fixed effects for states and years, respectively, $X_{ist}$ are relevant individual controls and $\epsilon_{ist}$ is an error term. The estimated impact of the intervention is then the OLS estimate $\hat \beta$.

When you have panel data the model is conceptually similar, but now you would typically consider individual fixed-effects. See Hansen (2007) -and also be aware of the autocorrelation issues-.

Imbens and Wooldridge (2008) provide a good overview and useful references for your question. They also have similar lecture notes focusing in difference-in-differences methods (http://www.nber.org/WNE/lect_10_diffindiffs.pdf).

Bertrand, M., Duflo, E. & Mullainathan, S. (2004). How Much Should We Trust Differences-In-Differences Estimates? The Quarterly Journal of Economics, 119(1), 249–275.

Hansen, C., (2007), “Generalized Least Squares Inference in Panel and Multilevel Models with Serial Correlation and Fixed Effects,” Journal of Econometrics.

Imbens, G. & Wooldridge, J. M. (2008). Recent developments in the econometrics of program evaluation.

• What do you mean by "When you have panel data the model is conceptually similar, but now you would typically consider individual fixed-effects."? – Andy Nov 22 '14 at 13:56
• I meant that, conceptually, you are trying to do the same: to account for pre-treatment differences between treatment and control groups. – Hernando Casas Nov 22 '14 at 20:05
• I meant that, conceptually, you are trying to do the same: to account for pre-treatment differences between treatment and control groups and to use the trend of the control group as counterfactual. Indeed, with panel data "One option is to proceed with estimation exactly as before, essentially ignoring the fact that the observations in different time periods come from the same unit" (Imbens and Wooldridge, 2008). So I guess I meant that the nature of the problem and what you are trying to accomplish is similar, although I should have warned about different assumptions and estimation issues. – Hernando Casas Nov 22 '14 at 20:15