Skip to content
Submodule
causalis.shared.outcome_outliers

outcome_outliers

Submodule causalis.shared.outcome_outliers with no child pages and 1 documented members.

Functions

Jump directly into the documented functions for this page.

1 items
function
causalis.shared.outcome_outliers.outcome_outliers

outcome_outliers

Detect outcome outliers per treatment group using IQR or z-score rules.

Parameters

dataCausalData or MultiCausalData

Causal dataset containing the dataframe and metadata.

treatmentstr, optional

Treatment column name. For MultiCausalData, if not provided, one-hot treatment columns are converted to assigned treatment labels.

outcomestr, optional

Outcome column name. Defaults to data.outcome.

method{“iqr”, “zscore”}, default “iqr”

Outlier detection rule.

iqr_kfloat, default 1.5

Multiplier for the IQR rule.

z_threshfloat, default 3.0

Z-score threshold for the z-score rule.

tail{“both”, “lower”, “upper”}, default “both”

Which tail(s) to flag as outliers.

return_rowsbool, default False

If True, also return the rows flagged as outliers (subset of data.df).

Returns

summary : pandas.DataFrame

Per-treatment summary with counts, rates, bounds, and flags. outliers : pandas.DataFrame Only returned when return_rows=True. Subset of data.df containing flagged outlier rows.

Notes

Bounds are computed within each treatment group.

Canonical target

causalis.shared.outcome_outliers.outcome_outliers

Sections

ParametersReturnsNotes
Link to this symbol