moderndid.wboot_ipw_panel#
- moderndid.wboot_ipw_panel(delta_y, d, x, i_weights, n_bootstrap=1000, trim_level=0.995, random_state=None)[source]#
Compute bootstrap estimates for IPW DiD with panel data.
Implements a bootstrapped Inverse Probability Weighting (IPW) difference-in-differences estimator for panel data. Unlike doubly-robust methods, this uses only propensity scores without outcome regression.
- Parameters:
- delta_y
numpy.ndarray A 1D array representing the difference in outcomes between the post-treatment and pre-treatment periods (Y_post - Y_pre) for each unit.
- d
numpy.ndarray A 1D array representing the treatment indicator (1 for treated, 0 for control) for each unit.
- x
numpy.ndarray A 2D array of covariates (including intercept if desired) with shape (n_units, n_features).
- i_weights
numpy.ndarray A 1D array of individual observation weights for each unit.
- n_bootstrap
int Number of bootstrap iterations. Default is 1000.
- trim_level
float Maximum propensity score value for control units to avoid extreme weights. Default is 0.995.
- random_state
int,RandomStateinstanceorNone Controls the random number generation for reproducibility.
- delta_y
- Returns:
numpy.ndarrayA 1D array of bootstrap ATT estimates with length n_bootstrap.
See also
wboot_drdid_imp_panelImproved doubly-robust bootstrap for panel data.
wboot_dr_tr_panelTraditional doubly-robust bootstrap for panel data.