sinanpl / OaxacaBlinder

R implementation of Oaxaca-Blinder gap decomposition
MIT License
1 stars 1 forks source link

Add sum check for bootstraps #29

Closed davidskalinder closed 4 months ago

davidskalinder commented 4 months ago

This PR is like #25 but for bootstraps. Unlike #25, it only throws a warning if at least some of the bootstrap runs pass the checksum, discarding the runs that fail (the number discarded is in the warning). If no bootstraps pass, then it throws an error.

This PR includes a test for a case where some of the bootstrap runs have zero-variance levels for a categorical variable but other runs include all the levels. As a result, this test should fail until this branch is merged with #27, after which is should pass.

@sinanpl as always let me know if there's anything I can help clarify for this!

davidskalinder commented 4 months ago

NB that I'm pretty sure that this PR clobbers #13, but it'll get the functionality back in #31 anyway, so I'm not correcting it here.