Filtering
filter_common_support
filter_common_support(df: DataFrame, ps_col: str = PS_COL, treatment_col: str = TREATMENT_COL, threshold: float = 0.05) -> pd.DataFrame
Filters individuals based on common support in propensity scores, removing those outside the range.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
df
|
DataFrame
|
Input DataFrame containing columns for the propensity score and treatment status. |
required |
ps_col
|
str
|
Column name for the propensity score. |
PS_COL
|
treatment_col
|
str
|
Column name for the treatment status (1 for treated, 0 for control). |
TREATMENT_COL
|
threshold
|
float
|
Quantile threshold (default 0.05) to trim the tails of the distribution for better common support. |
0.05
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame after removing individuals without common support. |
Source code in CausalEstimate/filter/propensity.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | |