oaxaca
Decompose mean outcome gaps between two groups into explained and unexplained components, showing how much of the difference is due to covariates versus group membership.
Instructions
Oaxaca-Blinder decomposition of mean outcome gaps. Validation: certified parity evidence. Assumptions: Linearity of conditional mean within each group; Constant returns to covariates within group (no interactions ignored); Reference-group choice does not change interpretive sign of explained vs. unexplained gaps. Pre-conditions: Binary group indicator with both groups represented; Linear specification of outcome on covariates within each group. Failure modes: Detailed decomposition signs flip when reference group changes -> Report aggregated decomposition only, or use pooled reference (Neumark / Cotton). Alternatives: sp.ffl_decompose, sp.dfl_decompose, sp.rif_decomposition. Typical minimum N: 200.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | Covariate names. | |
| y | Yes | Outcome variable name. | |
| alpha | No | Significance level for p-values. | |
| group | Yes | Binary group indicator (0 = Group A, 1 = Group B). | |
| detail | No | Payload depth: 'minimal' (~150 tokens) for sub-step calls where only the point estimate is needed; 'standard' (~1K tokens) for diagnostics + coefficient table; 'agent' (~2K tokens, default) adds violations / next_steps / suggested_functions so the LLM can plan its next call without another round-trip. | agent |
| as_handle | No | If true, cache the fitted result on the server and return result_id + result_uri alongside the JSON payload so a subsequent tools/call can chain without re-running. | |
| data_path | Yes | Absolute path or URL to a data file. Supported: .csv / .tsv / .txt (delimited), .parquet / .pq, .feather / .arrow, .xlsx / .xls, .dta (Stata), .json / .jsonl. Schemes: file://, s3://, gs://, https://. | |
| reference | No | Reference coefficient vector beta*: - ``0`` -- Group A coefficients (beta_A). The "explained" part uses Group A's returns as the benchmark. - ``1`` -- Group B coefficients (beta_B). - ``'pooled'`` -- Pooled OLS (Neumark 1988). - ``'cotton'`` -- Sample-size weighted average (Cotton 1988). - ``'reimers'`` -- Equal-weighted average (Reimers 1983). | |
| result_id | No | Optional handle to a previously-fitted result (returned by an earlier call when as_handle=true). Tools that operate on a fitted object accept this in place of re-supplying data_path + columns. | |
| data_columns | No | Optional column projection. Parquet/Feather/Stata loaders honour this for fast partial reads. | |
| data_sample_n | No | Optional uniform random subsample size (seed=0, deterministic) — useful on huge panels. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||