cic
Quantify distributional treatment effects by estimating counterfactual outcome distributions for treated units and reporting quantile treatment effects.
Instructions
Changes-in-Changes (Athey & Imbens 2006). Nonparametric quantile DiD that identifies the full counterfactual outcome distribution for treated units, not just the mean. Reports quantile treatment effects (QTE) via empirical-CDF transformation; bootstrap SE. Validation: certified parity evidence. Assumptions: Rank-invariance of untreated potential outcomes across periods; Time-invariant group-level production technology (distributional DiD); SUTVA. Pre-conditions: continuous-ish outcome with sufficient support overlap between treated and control; 2 periods, 2 groups. Failure modes: Discrete outcome with few support points -> CIC quantile transformation degenerates; use sp.qte or sp.drdid for mean effects. Alternatives: sp.qte, sp.drdid, sp.did_2x2. Typical minimum N: 200.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| y | Yes | Outcome variable column name or outcome array. | |
| seed | No | Random seed for reproducible stochastic steps. | |
| time | Yes | Period indicator (0=pre, 1=post) | |
| alpha | No | Significance level for confidence intervals and tests. | |
| group | Yes | Treatment-group indicator (0/1) | |
| 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 |
| n_boot | No | Number of bootstrap replications. | |
| n_grid | No | Grid size for inverse-CDF mapping | |
| 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://. | |
| quantiles | No | Quantile grid (default: deciles) | |
| 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. | |
| covariates | No | Covariates for the Athey-Imbens (2006 p.466) two-step estimator; 'C(col)' / 'i.col' terms are absorbed as fixed effects | |
| first_stage | No | First-stage residualizer (only 'feols' supported) | feols |
| 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 | |||