Analysis of Differential Behaviour of SPARRA Score Across Demographic Groups
ab() Shorthand to draw a red x-y line
adjusted_fdr
adjusted_for
build_diff Prepares a data frame for a ggplot object to compare differ...
cal_2panel Draws calibration curves (with legend) with a second panel ...
counterfactual_yhat
dat2mat
demographic_parity
drawperson
drawprop
for_breakdown
getcal()
getprc()
getroc() Comprehensive plotting function for receiver-operator charact...
group_fairness
groupmetric_2panel Draws plots of a group fairness metric with a secon...
integral() Quick form for trapezoidal integration over range of x
Logistic
Logit
phs_colours
plot_decomp
Plot function for class sparraCAL
Plot function for class above
Plot function for class sparraROC
prc_2panel Draws a PRC curve (with legend) with a second panel underne...
roc_2panel Draws a ROC curve (with legend) with a second panel underne...
sim_pop_data
The SPARRA risk score (Scottish Patients At Risk of admission and Re-Admission) estimates yearly risk of emergency hospital admission using electronic health records on a monthly basis for most of the Scottish population. This package implements a suite of functions used to analyse the behaviour and performance of the score, focusing particularly on differential performance over demographically-defined groups. It includes useful utility functions to plot receiver-operator-characteristic, precision-recall and calibration curves, draw stock human figures, estimate counterfactual quantities without the need to re-compute risk scores, to simulate a semi-realistic dataset. Our manuscript can be found at: <doi:10.1371/journal.pdig.0000675>.