# Difference in Differences with Multiple Time Periods and Multiple Treatment Periods

I'm working on a panel data difference in differences model where each unit (country) is observed every year. In any year, a country can be engaged in a war (treatment), a militarized interstate dispute (control), both, or neither. I want to estimate the effect of fighting a war on GDP growth in year following the war's conclusion, by estimating the equation:

$$y_{it} = \alpha + y_{it-1}+ X_{it} +\beta{Post Conflict}+\gamma{War}+\delta{War\cdot{PostConflict}}+\eta_{i}+\nu_{t}+\epsilon$$

where $$y_{it-1}$$ is lagged GDP growth, $$X_{it}$$ is the covariates, and $$\eta_{t}$$ and $$\nu_{i}$$ are year and country fixed effects. The difference in differences term $$\delta$$ is the interaction term between treatment and post-conflict and gives the effect of war on GDP growth.

Including countries that fight a war and an interstate dispute is a good thing as it increases the within country variation, but I am unsure of the following two things:

1. If war is treatment and militarized interstate dispute is the control, should I include observations that don't have either the treatment or control?

2. For observations that fight a war and a militarized interstate dispute at the same time, can I code them as a war since they were exposed to treatment, or should I drop them entirely?

(Copied from OP's response in answer)
A country may enter and leave treatment at any point in time, so I don't think collinearity is a problem with the fixed effects. The control group is a militarized interstate dispute and treatment is a full-out war because conditional on a militarized interstate dispute, escalation to war is as-if random. For this reason, I was likely going to drop country-years where there was no war or militarized interstate dispute.

I think the bigger problem for my study is there are some country-years with both a war and a militarized interstate dispute. I take your point that a unit can't be both a control and treated, but I'm not sure what to do about it. Can I simply remove these observations from the panel, or does that fact that these observations exist suggest the framework of the DiD is invalid?

• Welcome! First, a few things regarding notation. Do all of your treated countries enter into treatment at the same time? Your 'War' and 'PostConflict' variables are likely collinear with your year and country fixed effects. Also, in a difference-in-differences framework, you can't be in both treatment and control conditions in the same country-year period. Is your control condition countries that neither engaged in war nor in a militarized interstate dispute? Please provide further clarification. Commented Apr 15, 2020 at 1:01
• Please register &/or merge your accounts (you can find information on how to do this in the My Account section of our help center), then you will be able to edit & comment on your own question. Commented Jun 7, 2020 at 21:22
• I think you have a serious problem with the idea of treatment. War affects economic growth; that is believable. However, I would not presume that being in a war is unaffected by economic growth, even after conditioning on a militarized interstate dispute. I think you should either find an instrument to break this reverse causality or model both economic growth and war (or war log-odds, maybe) dynamically. The data granularity leading to units being in control and "treatment" in the same year is difficult: you may need to use irregular time series/longitudinal data analysis to handle that. Commented Jul 23, 2020 at 23:20

A country may enter and leave treatment at any point in time, so I don't think collinearity is a problem with the fixed effects.

In addition to fixed effects for country and year, your model includes two main effects. One main effect indexes treated countries (i.e., "war" indicator); the other main effect is a time dummy (i.e., "post-conflict" indicator).

Since the "timing" of treatment is not uniform across all entities, you do not have a situation that lends itself to the classical difference-in-differences (DD) approach with two groups and two discrete time periods. War may begin at different times in different countries. Likewise, countries may enter into and out of a wartime condition. Your "post-conflict" (i.e., post-treatment) variable is not well-defined. Your "war" main effect, which is constant within a country, is collinear with your country fixed effect $$\eta_{i}$$. You also include a time dummy which indexes post-treatment periods. This will also be collinear with your year fixed effect $$\nu_{t}$$. I do not claim that your model is inestimable, but rather your software will have to make adjustments for the model to run. If you include a "post-conflict" variable, software may drop one additional year dummy as a compromise for the inclusion of a full set of year effects. In sum, you can approach this in the same way but with a few less variables. Here is another formulation of the more general DD equation:

$$y_{it} = \alpha + \phi y_{i,t-1} + \delta \textrm{Wartime}_{it} + \theta X_{it} + \eta_{i} + \nu_{t} + \epsilon_{it},$$

where the model is the same as before, but with a treatment dummy representing countries in wartime years. The variable $$\textrm{Wartime}_{it}$$ is your interaction term (i.e., $$War\cdot{PC}$$). Again, $$\textrm{Wartime}_{it}$$ is coded explicitly; it is equal to one in precisely those country-year observations when a country enters into a wartime condition, 0 otherwise.

If war is treatment and militarized interstate dispute is the control, should I include observations that don't have either the treatment or control?

There are many ways to proceed and I hope other contributors will offer their input. In a 'generalized' DD framework, there is always some implicit treatment and control group comparison. Countries officially entering into the wartime condition can serve as your treatment group. Armed combat (i.e., war) is your treatment. Countries ensnared in militarized interstate disputes, but never engaging in armed conflict, can serve as controls. One way to proceed is to restrict your sample to only those countries engaged in militarized interstate disputes. In the years preceding wartime exposure, you observe the economic outputs of all countries. All observed countries are in the militarized dispute condition in the pre-exposure period; this is your baseline (no treatment) condition. In some year (but not precisely the same year for all treated countries), wartime exposure affects a subset of countries, but not others. This is what I was referring to earlier when I stated that a country cannot be in both treatment and control groups in the same country-year period. Put differently, the country is either at war, or in some condition of militarized interstate conflict/negotiation. My only concern is, is it possible to be at war with one country and simultaneously involved in some militarized interstate conflict with another possibly neighboring country? I am sure you've considered this possibility. In my estimation, war is a clearly defined exposure. You could make the case that war is qualitatively different than being in a state of conflict/negotiation. I am not familiar with the details of your study, but you could also investigate different types of treatment. The economic health of a nation is undoubtedly influenced by the length of time at war, or even more so by the 'intensity' of that war.

I also imagine you observe countries before the onset of militarized interstate conflicts as well. In this case, you observe countries throughout several phases. In other words, there is a peacetime epoch, a militarized interstate dispute epoch, and a wartime epoch. I think you are most concerned with how to incorporate these different 'conflict phases' into your model. You make a solid argument that a declaration of war is as good as randomly assigned conditional on the country being in a state of militarized interstate conflict.

For observations that fight a war and a militarized interstate dispute at the same time, can I code them as a war since they were exposed to treatment, or should I drop them entirely?

I assume "at the same time" implies a country with multiple conflicts, such that they are “at war” with one country and also embroiled in a militarized interstate dispute with another. Can you code a specific 'country-year' as "at war" if involved in multiple conflicts? If yes, then I would investigate the effects of being "at war" with, and without, the 'multi-conflict' countries in your sample.

As noted earlier, you still have a well-defined exposure. However, your treatment is possibly confounded by the fact that some countries might be more predisposed to war than others. Is a country more likely to declare war if it was engaged in more than one interstate conflict in the pre-exposure period? I might suspect a country would be more bellicose if involved in multiple conflicts. Moreover, I might suspect a country's spatial proximity to a nearby belligerent government would also affect their exposure status. The contemporaneous cross-correlation across your $$i$$ countries might be a concern. These are my substantive musings.

I also wonder if excluding observations in the peacetime epoch is deliberately reducing the number of pre- or post-treatment observations in your panel (I say post-treatment as in beyond conclusion of the war). Some countries may only be involved in a militarized interstate dispute for a couple of years prior to a war, while others may be involved in interstate conflict(s) for decades. I would proceed by assessing the group trends in your economic output variables across these different epochs.

The more I think about it, the more I think I will use several different timings of GDP growth, such as current year, following year, following two years, etc. I also think a good placebo test would be lag GDP growth, as fighting a war should not affect the previous year's growth unless there is something wrong with the design.

You should consider adjusting the time configuration of your $$\textrm{Wartime}_{it}$$ variable to monitor how your treatment affects your outcome in different epochs. Note, the coefficient on $$\textrm{Wartime}_{it}$$ is the immediate (contemporaneous) effect of treatment. If you also acquired data after countries moved out of the wartime condition, then you can adjust your treatment variable by one or more periods to assess the persistence of wartime exposure on economic outputs.

This is known in the literature as 'lagging' your treatment indicator. One way to proceed is the following:

$$y_{it} = \alpha + \phi y_{i,t-1} + \sum_{\tau = 0}^{m}\delta_{-\tau} \textrm{Wartime}_{i,t - \tau} + \theta X_{it} + \eta_{i} + \nu_{t} + \epsilon_{it},$$

where the sum on the right-hand side allows for $$m$$ lags (i.e., $$\delta_{-1}, \delta_{-2},..., \delta_{-m}$$). These are additive, time-varying treatment effects. Note, when $$-\tau = 0$$, your estimate of $$\delta_{0}$$ is your contemporaneous effect; it is precisely the same wartime exposure period from before. If you are interested in how war affects a country’s economic health once it concludes, then lagging your treatment variable is one way to do it. You might also be interested in the anticipatory effects of war, in which case you could also incorporate a lead(s) of your treatment variable. Note, there are many variations of this general theme, so make sure you can justify your approach. Ultimately, you should be guided by your particular discipline and overall understanding of how the treatment affects your outcome. This brings me to my next concern.

Incorporating time-varying independent (treatment) variables is different than the inclusion of lagged dependent variables as covariates. Your model explicitly includes a lag of your outcome as a regressor. You can do this, but it introduces bias. In your case, you incorporate both the unobserved country-specific effect $$\eta_{i}$$ and a lagged dependent variable on the right-hand side of your equation. Consistent estimation is compromised when you condition on $$\eta_{i}$$ and $$y_{i,t-1}$$. Think about what would happen if you demeaned or differenced your equation; you would remove the fixed effect, but the "demeaned/differenced residual" is necessarily correlated with your lagged dependent regressor. Your lagged outcome on the right-hand side is not distributed independently of the error term. This bias is more pronounced with small T and an autocorrelated error process. Software has fixes for this, and it may require you to go looking for suitable instruments.

Another way to proceed is to run two equations. First, run your fixed effects model as before and drop the GDP lag. Then, rerun the same model with the GDP lag, but now drop the unobserved country-specific effect. Applied econometricians show fixed effects and lagged dependent variables estimates have a useful "bracketing property" (see Angrist and Pischke, 2009). In other words, it bounds the causal effect of interest. See pages 182-186 of this online resource if you do not have access to their book.

I hope this clears things up!

• Thank you for responding. I got locked out of my account somehow so I made a new one. A country may enter and leave treatment at any point in time, so I don't think collinearity is a problem with the fixed effects. The control group is a militarized interstate dispute and treatment is a full-out war because conditional on a militarized interstate dispute, escalation to war is as-if random. For this reason, I was likely going to drop country-years where there was no war or militarized interstate dispute. I think the bigger problem for my study is there are some country-years with both a war and Commented Apr 15, 2020 at 1:47
• In the future, you could provided further clarification in the comments. As for your treatment, is there a group of countries that were involved in a militarized dispute but never entered into the wartime (treatment) condition? Commented Apr 15, 2020 at 2:49
• Yes, in fact most countries engage in a militarized interstate and do not escalate in to war. I'll try to be clearer in future posts. Thanks again for respond I really appreciate it. Commented Apr 15, 2020 at 3:08
• I will formulate a more thorough response. In the comments we often ask for clarification so we can pinpoint your question(s). Commented Apr 15, 2020 at 3:34
• Also, you noted in your question that you want to investigate wartime effects on a country’s GDP growth in the year(s) after the war has ended? Are you only interested in the year(s) beyond conclusion of the conflict? Commented Apr 15, 2020 at 3:46