Closed davidskalinder closed 5 months ago
Should fix #6. Hard to test as always, but here's a minimal-yet-still-clunky one:
library(OaxacaBlinder) clna <- chicago_long |> dplyr::mutate(educ2 = dplyr::na_if(education, "LTHS")) twofold <- OaxacaBlinderDecomp( formula = real_wage ~ educ2 | female, data = clna, type = "twofold", baseline_invariant = TRUE, n_bootstraps = 30 ) clna |> dplyr::filter(!is.na(educ2)) |> dplyr::group_by(female) |> dplyr::summarize(mean = mean(real_wage, na.rm = TRUE)) |> dplyr::mutate(diff = dplyr::lag(mean) - mean) |> purrr::pluck("diff", 2) |> identical(twofold$gaps$gap) #> [1] TRUE
Created on 2024-03-15 with reprex v2.1.0
Should fix #6. Hard to test as always, but here's a minimal-yet-still-clunky one:
Created on 2024-03-15 with reprex v2.1.0