Differencing or demeaning your equation will remove the within-unit effects. In fact, in your setting with $T = 2$, your estimates of $\beta_{2}$ should be the same whether you difference, demean, or 'pool' your data. I conducted a quick test in R using the plm()
function to demonstrate this (see below). In settings where $T > 2$, however, this no longer holds.
Both fixed effects and difference-in-differences (DD) models include fixed effects for units/higher-level entities (i.e., firms, counties, states, etc.). Your equation is the canonical DD setup most people see in texts/papers. In my opinion, I would call it a DD approach.
Labeling this a fixed effects approach, however, is not inaccurate either, as DD is a special case of fixed effects. See this post for more information. Again, I should note, differencing your equation will not produce similar treatment effects once you acquire more than two periods.
# Classical DD Equation
# Pooling vs. Differencing vs. Demeaning
# T = 2 ONLY!
data <- tibble(
id = c(rep(1, 2), rep(2, 2), rep(3, 2), rep(4, 2)), # 4 units
time = rep(c(1, 2), 4), # 2 periods
y = rnorm(8, mean = 10, sd = 1) # random outcome
)
data_two_periods <- data %>%
mutate(treat = ifelse(id == 3 | id == 4, 1, 0), # treatment group (units 3 and 4)
post = ifelse(time == 2, 1, 0) # post-treatment (period 2)
)
library(plm)
plm_pool <- plm(y ~ treat*post, data = data_two_periods, index = c("id", "time"), model = "pooling")
plm_diff <- plm(y ~ treat*post, data = data_two_periods, index = c("id", "time"), model = "fd")
plm_fe <- plm(y ~ treat*post, data = data_two_periods, index = c("id", "time"), model = "within")
# Pulling out the coefficients on each interaction term
> plm_pool$coefficients["treat:post"]
treat:post
-0.1690198
> plm_diff$coefficients["treat:post"]
treat:post
-0.1690198
> plm_fe$coefficients["treat:post"]
treat:post
-0.1690198
Please review this interesting post which discusses how the addition of covariates might impact your estimates in the two period case.