The short answer is that using fixed effect at the unit or at the treated group level does not change estimation, only inference. Typically, using unit fixed-effect will absorb more variation, and hence you will have smaller standard errors.
Whether the units are in the same aggregated group does not change this result (it only changes how you define your treated group level, and the fact that you need panel instead of repeated cross-sections). The same applies to the time fixed effects: you can either use say year fixed effects, or just a FE for pre and post.
Note however that the equivalence only holds when there is no covariate X. As soon as you have Xs, results are different whether you use unit or group fixed effects.
The example below compares the 5 estimators. Estimators are:
- OLS
- FE with FE: (treated) group by (treatment) period
- FE with FE: units by (treatment) period
- FE with FE: (treated) group by year
- FE with FE: units by year
OLS FE period-group FE period-unit FE year-group FE year-unit
---------------------------------------------------------------------------------------------
did -0.4028 * -0.4028 * -0.4028 * -0.4028 * -0.4028 *
(0.1853) (0.1853) (0.1834) (0.1758) (0.1727)
---------------------------------------------------------------------------------------------
Num. obs. 70 70 70 70 70
Num. groups: time 2 2
Num. groups: treated 2 2
Num. groups: country 7 7
Num. groups: year 10 10
=============================================================================================
*** p < 0.001; ** p < 0.01; * p < 0.05
And the table below show the 3 first regressions, this time with covariates:
===================================================================
OLS x FE period-group X FE period-unit X
-------------------------------------------------------------------
did -0.407 * -0.407 * -0.460 *
(0.189) (0.189) (0.187)
x1 0.018 0.018 0.220
(0.104) (0.104) (0.165)
-------------------------------------------------------------------
Num. obs. 70 70 70
Num. groups: time 2 2
Num. groups: treated 2
Num. groups: country 7
===================================================================
*** p < 0.001; ** p < 0.01; * p < 0.05
Code:
library(tidyverse)
library(haven)
library(texreg)
library(lfe)
dat <- read_dta("http://dss.princeton.edu/training/Panel101.dta") %>%
mutate(time = (year>=1994) ,
treated = (country>4),
did = time*treated)
reg_ols <- lm(y_bin~ time+ treated+ did, data = dat)
reg_fe_a <- felm(y_bin~ did | time+ treated, data = dat)
reg_fe_b <- felm(y_bin~ did | time+ country, data = dat)
reg_fe_c <- felm(y_bin~ did | year+ treated, data = dat)
reg_fe_d <- felm(y_bin~ did | year+ country, data = dat)
reg_ols_x <- update(reg_ols, .~.+x1)
reg_fe_a_x <- update(reg_fe_a, .~.+x1)
reg_fe_b_x <- update(reg_fe_b, .~.+x1)
screenreg(list(reg_ols, reg_fe_a, reg_fe_b, reg_fe_c, reg_fe_d),
omit.coef = "time|treated|Intercept", digits=4,
include.rsquared = FALSE, include.adjrs = FALSE, include.rmse = FALSE,
custom.model.names = c("OLS", "FE period-group", "FE period-unit", "FE year-group", "FE year-unit"))
#>
#> =============================================================================================
#> OLS FE period-group FE period-unit FE year-group FE year-unit
#> ---------------------------------------------------------------------------------------------
#> did -0.4028 * -0.4028 * -0.4028 * -0.4028 * -0.4028 *
#> (0.1853) (0.1853) (0.1834) (0.1758) (0.1727)
#> ---------------------------------------------------------------------------------------------
#> Num. obs. 70 70 70 70 70
#> Num. groups: time 2 2
#> Num. groups: treated 2 2
#> Num. groups: country 7 7
#> Num. groups: year 10 10
#> =============================================================================================
#> *** p < 0.001; ** p < 0.01; * p < 0.05
screenreg(list(reg_ols_x, reg_fe_a_x, reg_fe_b_x),
omit.coef = "time|treated|Inter", digits=3,
include.rsquared = FALSE, include.adjrs = FALSE, include.rmse = FALSE,
custom.model.names = c("OLS x", "FE period-group X", "FE period-unit X"))
#>
#> ===================================================================
#> OLS x FE period-group X FE period-unit X
#> -------------------------------------------------------------------
#> did -0.407 * -0.407 * -0.460 *
#> (0.189) (0.189) (0.187)
#> x1 0.018 0.018 0.220
#> (0.104) (0.104) (0.165)
#> -------------------------------------------------------------------
#> Num. obs. 70 70 70
#> Num. groups: time 2 2
#> Num. groups: treated 2
#> Num. groups: country 7
#> ===================================================================
#> *** p < 0.001; ** p < 0.01; * p < 0.05
Created on 2021-04-01 by the reprex package (v1.0.0)