Skip to main content

Oaxaca Blinder decomposition

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oaxaca-1.0.2.tar.gz (48.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

oaxaca-1.0.2-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

Details for the file oaxaca-1.0.2.tar.gz.

File metadata

  • Download URL: oaxaca-1.0.2.tar.gz
  • Upload date:
  • Size: 48.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.14

File hashes

Hashes for oaxaca-1.0.2.tar.gz
Algorithm Hash digest
SHA256 6f9cbb06f0e0717d278447f5a823d215d46a82c0e8f7eeeb2dbd542cc250aad9
MD5 bc36ed1236229e223f631b125bade2d2
BLAKE2b-256 5a9a9859ed04301b99ee306d1f691712c888766e003c09f25ce824d13557fa89

See more details on using hashes here.

File details

Details for the file oaxaca-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: oaxaca-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 20.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.14

File hashes

Hashes for oaxaca-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 75cb4518fb9503ceafbd71015d83476c3ef063e89038625afe505edf9cf46575
MD5 91d8f0f307873a3ee5920d30444e897e
BLAKE2b-256 81b9cf1c4f8a0cc794256fddea94fedb9d91275d49915aa38d58959c65225d99

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page