moderndid.mboot_twfep_did#
- moderndid.mboot_twfep_did(linrep, n_units, n_bootstrap=1000, random_state=None)[source]#
Compute multiplier bootstrap for TWFE panel data DiD using Mammen weights.
Implements the standard multiplier bootstrap for Two-Way Fixed Effects difference-in-differences with panel data (2 periods and 2 groups) using Mammen’s (1993) binary weights.
- Parameters:
- linrep
numpy.ndarray Influence function values, stacked as [pre-period, post-period].
- n_units
int Number of cross-sectional units.
- n_bootstrap
int, default=1000 Number of bootstrap iterations.
- random_state
int|numpy.random.Generator|None, default=None Controls random number generation for reproducibility.
- linrep
- Returns:
numpy.ndarrayBootstrap ATT estimates of shape (n_bootstrap,).
Notes
The weights are generated at the unit level and then duplicated across time periods to maintain the panel structure.
References
[1]Mammen, E. (1993). “Bootstrap and wild bootstrap for high dimensional linear models”. The Annals of Statistics, 21(1), 255-285.