panel_qtet
Estimate quantile treatment effects on the treated from balanced three-period panel data, using distributional DiD with copula stability to recover the counterfactual outcome distribution.
Instructions
Callaway & Li (2019) quantile treatment effect on the treated for panel data. Recovers the counterfactual DISTRIBUTION of untreated outcomes for the treated group via distributional DiD plus a copula-stability assumption. Needs a balanced THREE-period panel (the third period identifies the copula). Exact parity with R qte::panel.qtet (6.8e-12). Validation: certified parity evidence. Assumptions: Distributional DiD; Copula stability: the dependence between the period-t change and the period-(t-1) level equals that between the period-(t-1) change and the period-(t-2) level, for the treated. Untestable at t, but checked on the untreated group and reported in model_info['copula_check']; Continuous outcome: with mass points the rank map is not measure-preserving; model_info['coherence_check'] flags it. Pre-conditions: balanced panel over three periods; binary treatment, read at period t; continuous outcome (mass points distort the rank map). Failure modes: Outcome has mass points (e.g. many zero earnings) -> The rank map collapses tied units onto one value and the QTT curve is distorted; the reported ATT (a mean DiD) is unaffected. Use sp.cic bounds for discrete outcomes; Only two peri...
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| t | Yes | Post-period VALUE of time | |
| y | Yes | Outcome | |
| se | No | SE method | bootstrap |
| seed | No | Random seed for reproducible stochastic steps. | |
| time | Yes | Period | |
| unit | Yes | Unit id | |
| alpha | No | Significance level for confidence intervals and tests. | |
| tmin1 | Yes | Pre-period VALUE of time | |
| tmin2 | Yes | Pre-pre-period VALUE; identifies the copula | |
| treat | Yes | Binary treatment | |
| 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. | |
| 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 | quantiles parameter (list). | |
| 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 | |||