dml_panel
Estimates causal treatment effects from long panel data using double/debiased machine learning with unit and optional time fixed effects, cross-fitting, and cluster-robust standard errors.
Instructions
Long-panel Double/Debiased ML for static panel models with fixed effects (Clarke & Polselli 2025, simplified). Absorbs unit (and optional time) fixed effects via within-transform, cross-fits ML nuisance learners with folds that split units, and reports cluster-robust SE at the unit level. PLR moment (continuous or binary treatment). Validation: validated evidence tier (known-truth, reference, external-parity, or Monte Carlo artifact). Assumptions: Conditional unconfoundedness within unit: E[epsilon_it | X_it, alpha_i, lambda_t] = 0; Strict exogeneity conditional on covariates (weaker than standard FE); Nuisance learners converge fast enough (op(n^{-1/4})) after within-transform. Pre-conditions: long panel: at least unit and outcome columns; include_time_fe=True needs time column; enough units (clusters) for cluster-robust SE -- >= 30 ideally; enough periods per unit for within-transform to leave variation in the treatment. Failure modes: Few units (< 30) -- cluster-robust SE under-coverage -> Use wild cluster bootstrap (sp.wild_cluster_bootstrap) or CR3 jackknife; Within-unit variation in treatment is near zero -> Unit FE absorbs almost all treatment variation -- switch to between...
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| y | Yes | Outcome column | |
| ml_g | No | Outcome nuisance learner | |
| ml_m | No | Treatment nuisance learner | |
| seed | No | Random seed for reproducible stochastic steps. | |
| time | No | Time column (required if include_time_fe) | |
| unit | Yes | Unit ID column (FE + clustering) | |
| alpha | No | Significance level for confidence intervals and tests. | |
| treat | Yes | Treatment column | |
| 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_folds | No | Number of cross-fitting or cross-validation folds. | |
| 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://. | |
| 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 | Yes | Covariate columns X_it | |
| 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. | |
| include_time_fe | No | Whether to include time fe. | |
| binary_treatment | No | binary_treatment parameter (bool). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||