cs_report
Generates a comprehensive staggered difference-in-differences analysis report, featuring diagnostics, coefficient estimates, and actionable next steps for evidence-based business decisions.
Instructions
One-call staggered-DID workflow following Baker et al. (2026).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| g | No | Outcome / cohort / time / unit id columns (required when ``data_or_result`` is a DataFrame). | |
| i | No | Outcome / cohort / time / unit id columns (required when ``data_or_result`` is a DataFrame). | |
| t | No | Outcome / cohort / time / unit id columns (required when ``data_or_result`` is a DataFrame). | |
| x | No | Covariates for conditional parallel trends. | |
| y | No | Outcome / cohort / time / unit id columns (required when ``data_or_result`` is a DataFrame). | |
| alpha | No | Significance level for confidence intervals and tests. | |
| max_e | No | Event-time window passed to the dynamic aggregation. | |
| min_e | No | Event-time window passed to the dynamic aggregation. | |
| 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 | Multiplier-bootstrap replications for :func:`aggte`. | |
| balance | No | balance parameter (bool). | |
| save_to | No | When set, treats the value as a *path prefix* and writes the report in every supported format in one call: - ``<prefix>.txt`` -- fixed-width plain-text report - ``<prefix>.md`` -- GitHub-flavoured Markdown - ``<prefix>.tex`` -- booktabs LaTeX fragment - ``<prefix>.xlsx`` -- multi-sheet workbook - ``<prefix>.png`` -- 2x2 summary figure (only if matplotlib is installed; silently skipped otherwise) Missing parent directories are created on the fly. | |
| verbose | No | If ``True``, print the report before returning. | |
| weights | No | Unit weights omega. Changes the target parameter, not just precision -- see :func:`statspai.did.callaway_santanna`. | |
| 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 | No | 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://. | |
| estimator | No | estimator parameter (str). | dr |
| 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. | |
| rr_method | No | Sensitivity restriction handed to :func:`breakdown_m`. | smoothness |
| triangulate | No | Also fit the other covariate strategies (regression adjustment, IPW, doubly robust) and report them side by side, as in the paper's Table 7 / Figure 4. Only meaningful with covariates. | |
| anticipation | No | anticipation parameter (int). | |
| data_columns | No | Optional column projection. Parquet/Feather/Stata loaders honour this for fast partial reads. | |
| random_state | No | Seed for the bootstrap (set to ``None`` for non-reproducibility). | |
| control_group | No | control_group parameter (str). | nevertreated |
| data_sample_n | No | Optional uniform random subsample size (seed=0, deterministic) — useful on huge panels. | |
| data_or_result | Yes | Either a long-format panel (then ``y, g, t, i`` are required and :func:`callaway_santanna` is run first), or an already-fitted :func:`callaway_santanna` result. | |
| functional_form | No | functional_form parameter (bool). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||