Closed davidskalinder closed 4 months ago
So based on the Stata output in https://github.com/sinanpl/OaxacaBlinder/issues/24#issue-2216096332, it looks like leaving out the dropped terms when calculating the totals is indeed the right thing to do, but as #24, we don't even seem to have the correct terms to add up yet. So I think this issue depends on #24.
Should be fixed in #27, closing.
When one group is missing levels of a set of dummy variables (or, after #20, of a categorical variable), the estimates for the predictors contain
NA
s; so when these estimates are summed to produce the overall estimates, the sum also becomesNA
. Reprex:Created on 2024-03-29 with reprex v2.1.0
As I mentioned at https://github.com/sinanpl/OaxacaBlinder/issues/17#issuecomment-2024278482, I think the solution is simply to put
na.rm = TRUE
in the overall sum calculations, but I (still) need to fire up Stata to make sure that that's how Jann's package does it. (oaxaca::oaxaca()
also returnsNA
overall estimates when any predictor estimates are missing.)