outcome_outliers
Functions
- outcome_outliers – Detect outcome outliers per treatment group using IQR or z-score rules.
outcome_outliers
Detect outcome outliers per treatment group using IQR or z-score rules.
Parameters
- data (
CausalData or MultiCausalData) – Causal dataset containing the dataframe and metadata. - treatment (
str) – Treatment column name. For MultiCausalData, if not provided, one-hot treatment columns are converted to assigned treatment labels. - outcome (
str) – Outcome column name. Defaults todata.outcome. - method (
('iqr', 'zscore')) – Outlier detection rule. - iqr_k (
float) – Multiplier for the IQR rule. - z_thresh (
float) – Z-score threshold for the z-score rule. - tail (
('both', 'lower', 'upper')) – Which tail(s) to flag as outliers. - return_rows (
bool) – If True, also return the rows flagged as outliers (subset ofdata.df).
Returns
- summary (
DataFrame) – Per-treatment summary with counts, rates, bounds, and flags. - outliers (
DataFrame) – Only returned whenreturn_rows=True. Subset ofdata.dfcontaining flagged outlier rows.
Notes
Bounds are computed within each treatment group.