没错,DID其实就是一般的lm模型,是很简单的,没有必要那么麻烦
R里面也有packages可以做did,如下面的
https://cran.r-project.org/web/packages/wfe/index.html
wfe: Weighted Linear Fixed Effects Regression Models for Causal Inference
This R package provides a computationally efficient way of fitting weighted linear fixed effects estimators for causal inference with various weighting schemes. Imai and Kim (2012) show that weighted linear fixed effects estimators can be used to estimate the average treatment effects under different identification strategies. This includes stratified randomized experiments, matching and stratification for observational studies, first differencing, and
difference-in-differences. The package also provides various robust standard errors and a specification test for standard linear fixed effects estimators.