Learn R Programming

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.

Copy Link

Version

Install

install.packages('SPARRAfairness')

Monthly Downloads

168

Version

0.1.0.0

License

GPL (>= 3)

Maintainer

James Liley

Last Published

April 9th, 2025

Functions in SPARRAfairness (0.1.0.0)

dat2mat

dat2mat
drawperson

drawperson
drawprop

drawprop
counterfactual_yhat

counterfactual_yhat
phs_colours

phs_colours
integral

integral() Quick form for trapezoidal integration over range of x
adjusted_fdr

adjusted_fdr
ab

ab() Shorthand to draw a red x-y line
logistic

Logistic
logit

Logit
getcal

getcal()
for_breakdown

for_breakdown
plot.sparraROC

Plot function for class sparraROC
plot_decomp

plot_decomp
adjusted_for

adjusted_for
getprc

getprc()
getroc

getroc() Comprehensive plotting function for receiver-operator characteristic curve. Also calculates AUROC and standard error.
roc_2panel

roc_2panel Draws a ROC curve (with legend) with a second panel underneath showing sensitivity difference.
all_data

All data for fairness measures
build_diff

build_diff Prepares a data frame for a ggplot object to compare differences using linear interpolation.
prc_2panel

prc_2panel Draws a PRC curve (with legend) with a second panel underneath showing precision difference.
cal_2panel

cal_2panel Draws calibration curves (with legend) with a second panel underneath showing predicted differences.
plot.sparraPRC

Plot function for class above
plot.sparraCAL

Plot function for class sparraCAL
demographic_parity

demographic_parity
group_fairness

group_fairness
sim_pop_data

sim_pop_data
groupmetric_2panel

groupmetric_2panel Draws plots of a group fairness metric with a second panel underneath
decomposition_matrix

Decomposition matrix