diff_diff.AggregationResult#
- class diff_diff.AggregationResult[source]#
Bases:
BaseResultsOne post-fit aggregation, as a table (spec section 6, row M-122).
Columnar arrays index-aligned to
label. Values are computed by the producing estimator’s aggregation machinery and stored here verbatim - this container never re-derives inference.- Parameters:
level (str) – The aggregation type that produced this table - one of
AGGREGATION_VOCABULARYor a documented per-estimator extra.label (np.ndarray) – Per-row aggregation key: the cohort for
"group", the calendar period for"calendar", the dose for"dose". A single"overall"entry for"simple"; a single"total"entry for"total".target (np.ndarray) – Per-row estimand discriminator, so one container can carry two aligned estimands over the same labels (ContinuousDiD’s ATT(d) and ACRT(d) become 2N rows).
"att"where an estimator has one;"total"on a"total"row - a total incremental outcome over the estimator’s aggregation mass, not an ATT.att (np.ndarray) – The canonical quintet, per row, carrying WHATEVER inference the fit stored - never recomputed. On a bootstrapped fit that usually means the producer’s percentile-bootstrap statistics carried through unchanged; view-relay producers can mix regimes per row where the fit itself did (dCDH’s
L_max >= 2cost-benefit delta keeps analyticalsafe_inferenceeven undern_bootstrap > 0- see the REGISTRY Phase 2 cost-benefit delta SE note).se (np.ndarray) – The canonical quintet, per row, carrying WHATEVER inference the fit stored - never recomputed. On a bootstrapped fit that usually means the producer’s percentile-bootstrap statistics carried through unchanged; view-relay producers can mix regimes per row where the fit itself did (dCDH’s
L_max >= 2cost-benefit delta keeps analyticalsafe_inferenceeven undern_bootstrap > 0- see the REGISTRY Phase 2 cost-benefit delta SE note).t_stat (np.ndarray) – The canonical quintet, per row, carrying WHATEVER inference the fit stored - never recomputed. On a bootstrapped fit that usually means the producer’s percentile-bootstrap statistics carried through unchanged; view-relay producers can mix regimes per row where the fit itself did (dCDH’s
L_max >= 2cost-benefit delta keeps analyticalsafe_inferenceeven undern_bootstrap > 0- see the REGISTRY Phase 2 cost-benefit delta SE note).p_value (np.ndarray) – The canonical quintet, per row, carrying WHATEVER inference the fit stored - never recomputed. On a bootstrapped fit that usually means the producer’s percentile-bootstrap statistics carried through unchanged; view-relay producers can mix regimes per row where the fit itself did (dCDH’s
L_max >= 2cost-benefit delta keeps analyticalsafe_inferenceeven undern_bootstrap > 0- see the REGISTRY Phase 2 cost-benefit delta SE note).conf_int_lower (np.ndarray) – Interval bounds at the fit’s
alpha.conf_int_upper (np.ndarray) – Interval bounds at the fit’s
alpha.n (np.ndarray) – Per-row count as float, NaN where the producer records none. Its SEMANTIC is
n_kind- never assume units.n_kind (str or None) – Semantic of
n, fromN_KIND_VOCABULARY- the SAME closed vocabularyEventStudyResultsdraws on, so a consumer can route onn_kindacross both containers.Nonewhen the producer records no count.weight (np.ndarray or None) – Normalized aggregation mass per row, summing to 1 within one
(level, target)group.Nonewhere no per-row mass exists - CallawaySantAnna’s"group"aggregation weights(g, t)cells equally WITHIN each cohort and has no cross-cohort mass, so inventing one would be a fabricated number. Single-row containers ("simple","total") carryweight=[1.0].df (np.ndarray) – Per-row inference degrees of freedom, NaN where none governed the stored p-value. NaN on percentile-bootstrap rows (no df governs them); a bootstrapped fit’s rows can still carry a finite df where the fit kept analytical inference for that row (the dCDH delta case above).
alpha (float) – Significance level the interval was computed at.
estimator (str or None) – Producing estimator class name, for provenance in
summary().
Methods
__init__(level, label, target, att, se, ...)summary([alpha])Human-readable table.
to_dataframe()Return the pinned
AGGREGATION_SCHEMAcolumns, in order.to_dict()Canonical-name mapping (deprecated names never leak into output).
Attributes
alphaestimatorn_kindweightlevellabeltargetattset_statp_valueconf_int_lowerconf_int_upperndf- __init__(level, label, target, att, se, t_stat, p_value, conf_int_lower, conf_int_upper, n, df, alpha=0.05, n_kind=None, weight=None, estimator=None, _COLUMN_FIELDS=('label', 'target', 'att', 'se', 't_stat', 'p_value', 'conf_int_lower', 'conf_int_upper', 'n', 'df'))#
- Parameters:
- Return type:
None
- classmethod __new__(*args, **kwargs)#