yu_elwert_decompose
Decompose a group disparity into causal components with nonparametric estimation, providing certified parity evidence for decisions.
Instructions
Nonparametric causal decomposition of a group disparity. Validation: certified parity evidence.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | Adjustment covariates (used to identify within-group CATEs). | |
| y | Yes | Name of the (continuous) outcome column. | |
| seed | No | Random seed for reproducible stochastic steps. | |
| trim | No | Lower/upper clip for fitted propensities (only used in ``method="efficient"``). | |
| alpha | No | Two-sided coverage level. | |
| group | Yes | Binary group indicator (0/1) -- ``1`` = advantaged / index group. | |
| 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 |
| method | No | ``"plugin"`` uses within-cell OLS for outcomes and within-group logit for the propensity and computes plug-in expectations. ``"efficient"`` is the efficient-influence-function estimator of the authors' ``cdgd`` package (``cdgd0_manual``) on those same nuisance fits: Hajek-normalised doubly robust potential outcomes, with selection the residual so the components add up exactly -- recommended when nuisance functions might be misspecified. ``method="efficient"`` computed selection as a covariance of doubly robust scores, so the four components did not add up to the disparity (0.566 against 0.572 on a 2,000-row example), and used unnormalised inverse-probability weights. Given the same nuisance predictions it now matches ``cdgd::cdgd0_manual`` to machine precision. ``inference="analytic"`` is new. ``"plugin"`` is unchanged. | plugin |
| n_boot | No | Number of bootstrap replications. | |
| cluster | No | Column name to use for cluster bootstrap. | |
| 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://. | |
| inference | No | ``"bootstrap"`` returns SEs and percentile CIs from the non-parametric (cluster-aware) bootstrap. ``"analytic"`` (only with ``method="efficient"``) returns the efficient-influence-function SEs and Wald CIs of ``cdgd``. ``"none"`` skips inference. | bootstrap |
| 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. | |
| treatment | Yes | Binary treatment indicator (0/1). | |
| 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 | |||