python class to perform propensity score matching
PS_GROUP = 'treatment' # set the group variable (treatment/control)
TARGET = 'target' # set the target variable, the outcome of interest
FILE_PATH = 'data/df.csv' # dataframe contains all dependant and independent variables
data = PrepData(FILE_PATH, group=PS_GROUP, target=TARGET, index_col="id")
scorer = PScorer()
scorer.fit(data.input, data.group_label)
ps_scores: Series = scorer.predict(data.input)
ScorePlotter.plot_roc_curve(ps_scores, data.group_label)
matcher = ObsMatcher(n_matches=1, caliper=0.001)
matched_index: List[int] = matcher.match_scores(ps_scores, data.group_label)
ScorePlotter.plot_smd_comparison(
data=data.input,
matched_index=matched_index,
treatment=data.group_label
)