if (FALSE) {
# Example with simulated data
n=4000 # sample size
t=1*(rnorm(n)>0) # time period
u=runif(n,0,1) # time constant unobservable
x= 0.25*t+runif(n,0,1) # time varying covariate
d=1*(x+u+2*rnorm(n)>0) # treatment
y=d*t+t+x+u+2*rnorm(n) # outcome
# true effect is equal to 1
results=didDML(y=y, d=d, t=t, x=x)
cat("ATET: ", round(results$ATET, 3), ", Standard error: ", round(results$se, 3))
}
Run the code above in your browser using DataLab