diff_diff.BaseResults#
- class diff_diff.BaseResults[source]#
Bases:
objectShared base for ESTIMATOR result containers (spec section 5).
Behaviorally inert in 3.9 - a TRANSITIONAL marker base that makes the results contract checkable and anchors the 4.0 storage flip. It does not yet enforce a uniform runtime protocol: most subclasses are scalar estimator results (one canonical quintet), but
EventStudyResultsis intentionally vector-valued, and a few inherited classes still exposesummary()without analphaargument. Full protocol uniformity (uniformsummary(alpha=None), native canonical storage) is enforced in later Phase 2 / 4.0 PRs. The target contract every ESTIMATOR-results subclass converges to:Canonical quintet.
att,se,t_stat,p_value,conf_intbound to ONE coherent inference row (native fields or property aliases over legacyoverall_*/avg_*storage; the storage flips to native canonical fields at 4.0, ledger rows M-050..M-058, with legacy names living on as FutureWarning properties until 5.0).Serialization.
summary(alpha=None),to_dict()(canonical key names only - deprecated names never leak into serialized output), andto_dataframe(level=...)where multiple views exist.Pickle migration. Classes whose stored field names change ship
__setstate__migration following theSyntheticDiDResults.__setstate__precedent (diff_diff/results.py) so 3.x pickles load under 4.0.Planned estimand self-description hook. The per-class headline semantics (name / definition / aggregation / headline attribute) currently live in
_reporting_helpers.describe_target_parameter, keyed by result-class name. A later PR lifts that block onto this base so results self-describe their target parameter (the MMM exporter’s verified allowlist is the first consumer); nothing here constrains that lift.
Diagnostic result containers (spec section 3.5) do NOT inherit this base - they are marked with
Diagnosticand are exempt from the quintet by type.Methods
__init__()- __init__()#
- classmethod __new__(*args, **kwargs)#