innovate.staggered_att_polars
All current Python definitions
View source · Source file SHA-256: 522871fe0b61b840b5f85b8f278beb2b79c7afd68645265ae3a68983d56d74e4
Signature
Section titled “Signature”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.
Parameters
Section titled “Parameters”frame: Polars table withunit_ids, numerictimeand numericoutcomescolumns. Lazy input is collected after column selection.adoption_times: Mapping from unit identifiers to treatment-adoption times in the panel’s time units, orNonefor never-treated units.options: Additional nativestaggered_long_panel_attoptions. They must not duplicate the selected columns or the wrapper’s fixed fields.
Returns
Section titled “Returns”Native result payload for staggered long-panel average treatment effects, with the native diagnostics and aggregation fields retained.
Raises
Section titled “Raises”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.