diff_diff.PanelProfile#
- class diff_diff.PanelProfile[source]#
Bases:
objectStructural facts about a DiD panel.
Returned by
profile_panel(). Mirrors theBusinessContextfrozen-dataclass pattern. Consume.to_dict()for a JSON-serializable representation and reason against the bundledllms-autonomous.txtguide.Methods
__init__(n_units, n_periods, n_obs, ...[, ...])to_dict()Return a JSON-serializable dict representation of the profile.
Attributes
outcome_shapetreatment_dosen_unitsn_periodsn_obsis_balancedobservation_coveragetreatment_typeis_staggeredn_cohortscohort_sizeshas_never_treatedhas_always_treatedtreatment_varies_within_unitfirst_treatment_periodlast_treatment_periodmin_pre_periodsmin_post_periodsoutcome_dtypeoutcome_is_binaryoutcome_has_zerosoutcome_has_negativesoutcome_missing_fractionoutcome_summaryalerts- __init__(n_units, n_periods, n_obs, is_balanced, observation_coverage, treatment_type, is_staggered, n_cohorts, cohort_sizes, has_never_treated, has_always_treated, treatment_varies_within_unit, first_treatment_period, last_treatment_period, min_pre_periods, min_post_periods, outcome_dtype, outcome_is_binary, outcome_has_zeros, outcome_has_negatives, outcome_missing_fraction, outcome_summary, alerts, outcome_shape=None, treatment_dose=None)#
- Parameters:
n_units (int)
n_periods (int)
n_obs (int)
is_balanced (bool)
observation_coverage (float)
treatment_type (str)
is_staggered (bool)
n_cohorts (int)
has_never_treated (bool)
has_always_treated (bool)
treatment_varies_within_unit (bool)
first_treatment_period (Any | None)
last_treatment_period (Any | None)
min_pre_periods (int | None)
min_post_periods (int | None)
outcome_dtype (str)
outcome_is_binary (bool)
outcome_has_zeros (bool)
outcome_has_negatives (bool)
outcome_missing_fraction (float)
outcome_shape (OutcomeShape | None)
treatment_dose (TreatmentDoseShape | None)
- Return type:
None
- classmethod __new__(*args, **kwargs)#