Skip to content

anhqle/oaxaca

Repository files navigation

oaxaca

Release Build status codecov Commit activity License

The Oaxaca-Blinder decomposition is a statistical method used to explain the difference in outcomes between two groups by decomposing it into:

  • A part that is "explained" by differences in group predictor
  • A part that remains "unexplained"

For example, the gender wage gap can be partly "explained" by the difference in education and work experience between men and women. The remaining "unexplained" part is typically considered discrimination.

For a methodological review, see Jann (2008) and Fortin et al. (2011).

Why use this package?

If possible, you should use the Stata package oaxaca, which is the most feature-rich implementation (Jann, 2008). If you can't, existing implementations in R and Python are lacking:

  1. The R oaxaca package does not permit more than 1 categorical variable (discussion)
  2. The Python implementation in statsmodels only decomposes into the explained and unexplained part, without a "detailed decomposition" into the contribution of each predictor

For industry data science work, these limitations are prohibitive. This package thus fills in the gap by providing:

  1. As table stakes, two-fold and three-fold decomposition, with detailed decomposition for each predictor
  2. Multiple ways to deal with the "omitted base category problem" (see below)
  3. Automatic handling of the case when the two groups don't have a common support. For example, some occupations may only exist in 1975 and not 2025, and vice versa
  4. Rich HTML table output

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors