In this post we will discuss how to manually implement a Difference-in-Differences (DiD) estimator in R,
using simulated data.
Let have a look if the data came out the way we wanted it to.
We now combine the observations into a single data.frame and add some dummy variables required for the estimation.
The below plot illustrates what the common trend assumption does.
Compute the DiD estimator.