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.3.tar.gz (48.8 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.3-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for oaxaca-1.0.3.tar.gz
Algorithm Hash digest
SHA256 54dc6c14008bbcec76cdf22748950bc0380f07f82f601e6eac05538d327493b8
MD5 7e6aa4f4ee526e4f70673dbc6e12ca25
BLAKE2b-256 03af4f7a670c8a4a2c9a72102e6a0385adebbe85220f38e1c9d8925d78e40115

See more details on using hashes here.

File details

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

File metadata

  • Download URL: oaxaca-1.0.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 16d3864d83937cd63bc4a29884ff342d23f1ab8300b8cc5a45160434ef3e50f5
MD5 02f2c0fa92c6ff88bc44cf27b2f311df
BLAKE2b-256 505d86a56f5359a52044ade6fbc3b4d904830cdf1aeeb6829130689e11401f5e

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