Skip to content

innovate.treatment_contrast_frame

All current Python definitions

View source · Source file SHA-256: 522871fe0b61b840b5f85b8f278beb2b79c7afd68645265ae3a68983d56d74e4

def treatment_contrast_frame(result: dict[str, Any]) -> pl.DataFrame: ...

Project a treatment-contrast result into the historical tabular schema.

  • result: Native result payload containing overall.estimate and a bootstrap mapping with interval bounds and draw count, or None when bootstrap results are unavailable.

One-row DataFrame with Float64 estimate, ci_lower and ci_upper and Int32 n_bootstrap. An absent bootstrap produces null bounds and zero draws; this projection does not calculate new uncertainty estimates.

  • KeyError: If required result or bootstrap fields are missing.
  • TypeError: If the result does not have the expected mapping structure.
  • polars.exceptions.PolarsError: If values cannot satisfy the output schema.