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: object

Structured report returned by diagnose_panel.

Attributes:
n_unitsint

Number of unique cross-sectional units.

n_periodsint

Number of unique time periods.

n_observationsint

Total row count.

is_balancedbool

Whether every unit is observed in every period.

n_duplicate_unit_timeint

Number of rows that share a unit-time pair with another row.

n_unbalanced_unitsint

Units observed in fewer than n_periods periods.

n_gapsint

Missing unit-time combinations in the full cross-product.

n_missing_rowsint

Rows containing at least one null value.

n_single_period_unitsint

Units observed in only one period.

n_early_treatedint or None

Units already treated in the first observed period. None when no treatment column is provided.

treatment_time_varyingbool or None

Whether the treatment indicator changes within units. None when no treatment column is provided.

suggestionslist[str]

Actionable remediation messages.

Methods

Attributes