fwildclusterboot icon indicating copy to clipboard operation
fwildclusterboot copied to clipboard

Feature Request: Option to return bootstrapped coefficient estimates

Open amarbler opened this issue 8 months ago • 4 comments

Hi,

Thanks for setting up and maintaining this package!

I recently read Roodman et al. (2019) and noticed that the Stata version of boottest() includes an option to return the numerators of the bootstrapped test statistics using svmat(numer). These numerators represent the coefficient estimates from all bootstrap replications under the null hypothesis β = 0.

It appears that currently this isn't available in fwildclusterboot::boottest(), but would be a useful option. Would it be possible to consider including this or a similar feature in a future update?

Thanks again for your great work on this package!

amarbler avatar Mar 25 '25 08:03 amarbler

Hi, this is already possible - the bootstrapped t stats are stored in the model$t_boot =)

s3alfisc avatar Mar 26 '25 11:03 s3alfisc

Hi,

Sorry for the confusion. I'm referring to the numerator of the bootstrapped t-statistics—not the final t_boot values. Under the null hypothesis that the coefficient is 0, the numerator corresponds to the bootstrapped coefficient estimates, which is exactly what I'm looking to retrieve.

Thanks for your help! :)

amarbler avatar Mar 26 '25 12:03 amarbler

I see!

These are computed in this function as "numer". This function is then called via fast_n_reliable implementation, which itself is called by run_bootstrap. And last, run_bootstrap is the function called by the estimation APIs boottest.lm, boottest.fixest etc.

So should be doable!

Btw, in the "fast and reliable" algo from the newer MacKinnon, Nielsen, Webb paper, the numerator is computed here: link

s3alfisc avatar Mar 26 '25 21:03 s3alfisc

I forked your repository and implemented the changes for fast and wild and fast and reliable. Let me know if you want me to open a pull request.

amarbler avatar Mar 27 '25 16:03 amarbler