From 86a00a55f82f13d7e09d3ad4fb477edc80fdf775 Mon Sep 17 00:00:00 2001 From: igerber Date: Wed, 25 Nov 2026 17:06:56 -0500 Subject: [PATCH] docs(guides): group_time_effects cells are dicts, not GroupTimeEffect objects The bundled llms-full.txt guide documented CallawaySantAnnaResults.group_time_effects as dict[(g,t), GroupTimeEffect]. Every estimator that carries the field stores plain dicts (keys effect, se, t_stat, p_value, conf_int, n_treated, n_control, skip_reason), and nothing in the library constructs GroupTimeEffect. Code written from the guide (cell.effect) fails against real results (cell["effect"]). Correct the guide entry, and say the same in the GroupTimeEffect section of docs/api/staggered.rst, which described the class as the container for group-time effects. Docs only; no behavior change. Adds a changelog fragment. --- changelog.d/20261125-llms-full-group-time-effects-dict.md | 7 +++++++ diff_diff/guides/llms-full.txt | 2 +- docs/api/staggered.rst | 5 ++++- 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 changelog.d/20261125-llms-full-group-time-effects-dict.md diff --git a/changelog.d/20261125-llms-full-group-time-effects-dict.md b/changelog.d/20261125-llms-full-group-time-effects-dict.md new file mode 100644 index 00000000..4724f296 --- /dev/null +++ b/changelog.d/20261125-llms-full-group-time-effects-dict.md @@ -0,0 +1,7 @@ +### Documentation +- Corrected the `CallawaySantAnnaResults.group_time_effects` entry in the + bundled `llms-full.txt` guide: each ATT(g,t) cell is a plain dict with the + keys `effect`, `se`, `t_stat`, `p_value`, `conf_int`, `n_treated`, + `n_control` and `skip_reason` (read as `cell["effect"]`), not a + `GroupTimeEffect` object. The `GroupTimeEffect` section of the staggered API + page now says the same. No behavior change. diff --git a/diff_diff/guides/llms-full.txt b/diff_diff/guides/llms-full.txt index 76d66f8f..cf0dcd22 100644 --- a/diff_diff/guides/llms-full.txt +++ b/diff_diff/guides/llms-full.txt @@ -1594,7 +1594,7 @@ Returned by `CallawaySantAnna.fit()`. | Attribute | Type | Description | |-----------|------|-------------| -| `group_time_effects` | `dict[(g,t), GroupTimeEffect]` | ATT(g,t) for each (group, time) | +| `group_time_effects` | `dict[(g,t), dict]` | ATT(g,t) cell for each (group, time), stored as a plain dict: `{effect, se, t_stat, p_value, conf_int, n_treated, n_control, skip_reason}`. Read a value as `cell["effect"]`; `skip_reason` is `None` for an estimable cell | | `att` | `float` | Overall ATT | | `se` | `float` | SE of overall ATT | | `t_stat` | `float` | T-statistic | diff --git a/docs/api/staggered.rst b/docs/api/staggered.rst index 14b50d27..af1cb095 100644 --- a/docs/api/staggered.rst +++ b/docs/api/staggered.rst @@ -94,7 +94,10 @@ Results container for Callaway-Sant'Anna estimation. GroupTimeEffect --------------- -Container for individual group-time ATT(g,t) effects. +Typed record for one group-time ATT(g,t) effect. Estimator results do not store +this class: ``group_time_effects`` maps each ``(group, time)`` key to a plain +``dict`` with the keys ``effect``, ``se``, ``t_stat``, ``p_value``, ``conf_int``, +``n_treated``, ``n_control`` and ``skip_reason``, read as ``cell["effect"]``. .. autoclass:: diff_diff.GroupTimeEffect :no-index: