if (FALSE) {
n=1000
x=matrix(rnorm(n * 5), n, 5)
d=1*(x[,1]+2*rnorm(n)>0)
t=rbinom(n, 1, 0.5)
y0=x[,1]+rnorm(n)
y1=y0+rnorm(n)
y=ifelse(t == 1, y1, y0)
# report p-value (note that unconfoundedness and common trends hold jointly)
paneltestDML(y1, y0, d, x)$pval}
Run the code above in your browser using DataLab