Panel Utilities#

The panel module provides diagnostic, validation, and transformation tools for preparing panel data before estimation. All functions accept any Arrow-compatible DataFrame and return the same format.

Diagnostics#

diagnose_panel

Run a diagnostic battery on panel data.

PanelDiagnostics

Structured report returned by diagnose_panel.

Validation#

is_balanced_panel

Check whether the panel is balanced.

has_gaps

Check whether the panel has any implicit missing unit-time pairs.

scan_gaps

Identify missing unit-time combinations.

are_varying

Check which columns vary within units over time.

Transformation#

make_balanced_panel

Drop units not observed in every time period.

fill_panel_gaps

Make the panel rectangular by inserting null rows for missing pairs.

complete_data

Keep units observed in at least min_periods time periods.

deduplicate_panel

Remove duplicate unit-time pairs.

get_first_difference

Add a "dy" column containing first-differenced outcomes.

get_group

Extract treatment-group timing into a "G" column.

assign_rc_ids

Add a unique "rowid" column for repeated cross-section data.

panel_to_wide

Pivot a long panel to wide format.

wide_to_panel

Unpivot wide-format data into a long panel.