Analysis of Differential Behaviour of SPARRA Score Across Demographic Groups

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: .


SPARRAfairness: an R package implementing functions for assessing differential behaviour of the SPARRA score in demographic groups.

To download and install this package, use

install.packages("SPARRAfairness")
library(SPARRAfairness)

For examples demonstrating use of this package, see vignette SPARRAfairness_vignette.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("SPARRAfairness")

0.1.0.0 by James Liley, 2 years ago


Browse source code at https://github.com/cran/SPARRAfairness


Authors: Ioanna Thoma [aut] , Catalina Vallejos [ctb] , Louis Aslett [ctb] , Jill Ireland [ctb] , Simon Rogers [ctb] , James Liley [cre, aut]


Documentation:   PDF Manual  


GPL (>= 3) license


Imports mvtnorm, cvAUC, ggplot2, ggrepel, patchwork, scales

Depends on stats, graphics, grDevices, matrixStats, ranger

Suggests knitr, rmarkdown


See at CRAN