moderndid.wboot_reg_panel#

moderndid.wboot_reg_panel(delta_y, d, x, i_weights, n_bootstrap=1000, random_state=None)[source]#

Compute bootstrap estimates for regression-based robust DiD with panel data.

This function implements a regression-based difference-in-differences estimator that uses outcome regression on the control group only, without propensity scores. It is designed for settings with 2 time periods and 2 groups.

Parameters:
delta_ynumpy.ndarray

A 1D array representing the difference in outcomes between the post-treatment and pre-treatment periods (Y_post - Y_pre) for each unit.

dnumpy.ndarray

A 1D array representing the treatment indicator (1 for treated, 0 for control) for each unit.

xnumpy.ndarray

A 2D array of covariates (including intercept if desired) with shape (n_units, n_features).

i_weightsnumpy.ndarray

A 1D array of individual observation weights for each unit.

n_bootstrapint

Number of bootstrap iterations. Default is 1000.

random_stateint, RandomState instance or None

Controls the random number generation for reproducibility.

Returns:
numpy.ndarray

A 1D array of bootstrap ATT estimates with length n_bootstrap.

See also

wboot_drdid_imp_panel

Doubly-robust bootstrap with propensity scores.

wboot_ipw_panel

IPW bootstrap without outcome regression.