sinanpl / OaxacaBlinder

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

Test output with two baseline-adjusted variables against Stata #55

Closed davidskalinder closed 3 months ago

davidskalinder commented 3 months ago

Looking back at the current batch of tests, I notice that we have a (or several, maybe?) tests that compare a result with a single baseline-adjusted factor to the same result from Jann's Stata command, but we don't have any that compare the results when there are more than one factor. I'm pretty sure it works as it is, mind you, having hacked a comparison together and visually compared the results. But the adjustment algorithm always looks a bit finicky to me, so I'd feel better if a version with multiple adjusted factors (preferably with differing numbers of levels) was in the test suite. And come to think of it, we should probably just overwrite the one-factor tests with two-factor tests, since the two-factor tests will cover all the functionality of the one-factor tests in addition to ensuring that the multi-factor math is right.

I haven't cracked the codebase open in a little while, but it should be pretty easy to adapt the one-variable tests for this, so I should do it if I dive back in. (Or, GitHub reminds me, maybe I should mark this as a good first issue in case some eager beaver wants to submit a PR.)

davidskalinder commented 3 months ago

Should be fixed in #56.