moderndid.core.panel.PanelDiagnostics#
- class moderndid.core.panel.PanelDiagnostics(n_units: int, n_periods: int, n_observations: int, is_balanced: bool, n_duplicate_unit_time: int, n_unbalanced_units: int, n_gaps: int, n_missing_rows: int, n_single_period_units: int, n_early_treated: int | None, treatment_time_varying: bool | None, suggestions: list[str] = <factory>)[source]#
Bases:
objectStructured report returned by
diagnose_panel.- Attributes:
- n_units
int Number of unique cross-sectional units.
- n_periods
int Number of unique time periods.
- n_observations
int Total row count.
- is_balancedbool
Whether every unit is observed in every period.
- n_duplicate_unit_time
int Number of rows that share a unit-time pair with another row.
- n_unbalanced_units
int Units observed in fewer than n_periods periods.
- n_gaps
int Missing unit-time combinations in the full cross-product.
- n_missing_rows
int Rows containing at least one null value.
- n_single_period_units
int Units observed in only one period.
- n_early_treated
intorNone Units already treated in the first observed period.
Nonewhen no treatment column is provided.- treatment_time_varyingbool or
None Whether the treatment indicator changes within units.
Nonewhen no treatment column is provided.- suggestions
list[str] Actionable remediation messages.
- n_units
Methods
Attributes