# `causalis.shared.outcome_outliers`

## Module Contents

### Functions

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

### API

causalis.shared.outcome_outliers.outcome_outliers(data: causalis.dgp.causaldata.CausalData | causalis.dgp.multicausaldata.MultiCausalData, treatment: Optional[str] = None, outcome: Optional[str] = None, *, method: Literal[causalis.shared.outcome_outliers.outcome_outliers.iqr, zscore] = 'iqr', iqr_k: float = 1.5, z_thresh: float = 3.0, tail: Literal[both, causalis.shared.outcome_outliers.outcome_outliers.lower, causalis.shared.outcome_outliers.outcome_outliers.upper] = 'both', return_rows: bool = False) → pandas.DataFrame | tuple[pandas.DataFrame, pandas.DataFrame]

  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, optional Treatment column name. For MultiCausalData, if not provided, one-hot treatment columns are converted to assigned treatment labels. outcome : str, optional Outcome column name. Defaults to `data.outcome`. method : {“iqr”, “zscore”}, default “iqr” Outlier detection rule. iqr_k : float, default 1.5 Multiplier for the IQR rule. z_thresh : float, 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_rows : bool, 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.