sinanpl / OaxacaBlinder

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

Refactor bootstraps #31

Closed davidskalinder closed 4 months ago

davidskalinder commented 4 months ago

Depends on #30, which itself depends on #26.

This is a major restructuring of the bootstrapping function (and a minor refactoring of the main function) with three main goals:

  1. Reduce repetition
    1. Between the main (point estimate) function and the bootstrapping function
    2. Between the several types of things for which bootstraps are calculated (i.e., here, overall and varlevel estimates)
  2. Make double-loops more explicit and comprehensible (to me, at least!)
  3. Separate extraction of bootstrap estimates from summaries of those estimates

(Item 3 is the immediate payoff for me, since I want to have the ability to inspect the normality/convergence of the bootstrap distribution -- a PR for that is coming shortly.)

Along the way, I split the bootstrapping function into several smaller functions and a primary function that does a small amount of cleaning and calls the other functions.

This PR shouldn't introduce any user-visible changes, and the tests in #30 all pass for me. I'll submit a separate PR shortly that extends this refactoring to #15.

davidskalinder commented 4 months ago

All tests fail, should be fixed in #35.