Skip to content

innovate.staggered_att_polars

All current Python definitions

View source · Source file SHA-256: 522871fe0b61b840b5f85b8f278beb2b79c7afd68645265ae3a68983d56d74e4

def staggered_att_polars(
frame: pl.DataFrame | pl.LazyFrame,
adoption_times: dict[str, float | None],
**options: Any,
) -> dict[str, Any]: ...

Estimate staggered treatment effects from a native long-panel request.

This wrapper selects the required columns and materializes them as Python lists before JSON serialization. A returned estimate does not establish the causal assumptions needed for interpretation, including valid comparison groups.

  • frame: Polars table with unit_ids, numeric time and numeric outcomes columns. Lazy input is collected after column selection.
  • adoption_times: Mapping from unit identifiers to treatment-adoption times in the panel’s time units, or None for never-treated units.
  • options: Additional native staggered_long_panel_att options. They must not duplicate the selected columns or the wrapper’s fixed fields.

Native result payload for staggered long-panel average treatment effects, with the native diagnostics and aggregation fields retained.

  • NativeError: If the panel, adoption map or options fail native validation.
  • TypeError: If option names collide with fixed fields or values cannot be serialized as JSON.
  • ValueError: If serialization encounters non-finite or circular values.
  • polars.exceptions.PolarsError: If required columns are missing or collection fails.