sinanpl / OaxacaBlinder

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

Fix `invalid 'times' argument` error when running `coef(ci = TRUE)` on a threefold model #16

Closed davidskalinder closed 5 months ago

sinanpl commented 5 months ago

can you elaborate on this one @davidskalinder?

couldn't track it from the issues and not sure how it affects the ouptuts

davidskalinder commented 5 months ago

Ah, yes, sorry. coef(ci = TRUE) was broken for threefold decompositions. Here's a reprex showing the old behavior:

library(OaxacaBlinder)

set.seed(1973)

threefold <- OaxacaBlinderDecomp(
  formula = real_wage ~ education | foreign_born,
  data = chicago_long,
  type = 'threefold',
  n_bootstraps = 10
)

coef(threefold, ci = TRUE)
#> Error in rep(coeftypes, rep(nterms, 4)): invalid 'times' argument

Created on 2024-03-25 with reprex v2.1.0

Make sense? Just let me know if not...