paneltestDML | R Documentation |
This function applies an overidentification test to assess if unconfoundedness of the treatments and conditional common trends as imposed in differences-in-differences jointly hold in panel data when evaluating the average treatment effect on the treated (ATET).
paneltestDML(y1, y0, d, x, trim = 0.01, MLmethod = "lasso", k = 3)
y1 |
Potential outcomes for the treated. |
y0 |
Potential outcomes for the non-treated. |
d |
Treatment group indicator (binary). Should not contain missing values. |
x |
Covariates to be controlled for. Should not contain missing values. |
trim |
Trimming threshold for discarding observations with too small propensity scores within any subgroup defined by the treatment group and time. Default is 0.05. |
MLmethod |
Machine learning method for estimating nuisance parameters using the |
k |
Number of folds in k-fold cross-fitting. Default is 3. |
The test statistic corresponds to the difference between the ATETs that are based on two distinct doubly robust score functions, namely that under unconfoundedness and that based on difference-in-differences under conditional common trends. Estimation in panel data is based on double machine learning and the function supports different machine learning methods to estimate nuisance parameters (conditional mean outcomes and propensity scores) as well as cross-fitting to mitigate overfitting. ATETselobs and ATETdid equals zero.
A list with the following components:
est |
Test statistic. |
se |
Standard error. |
pval |
P-value. |
ntrimmed |
Number of trimmed or dropped observations due to propensitiy scores below the threshold |
pscore.xy0 |
Propensity score under unconfoundedness. |
pscore.x |
Propensity score under conditional common trends. |
ATETselobs |
ATET based on the selection on observables/unconfoundedness assumption. |
seATETselobs |
Standard error of the ATET based on the selection on observables/unconfoundedness assumption. |
ATETdid |
ATET based on difference-in-differences invoking the conditional common trends assumption. |
seATETdid |
Standard error of the ATET based on difference-in-differences invoking the conditional common trends assumption. |
Huber, M., and Oeß, E.-M. (2024): "A joint test of unconfoundedness and common trends", arXiv preprint 2404.16961.
## Not run:
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
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.