View source: R/SPARRAfairness_functions.R
plot_decomp | R Documentation |
Plots a bar graph of decomposition of FORP by cause of admission
plot_decomp(decomp1, decomp2, threshold, labels, inc_died = TRUE)
decomp1 |
matrix for first group; see specification in description |
decomp2 |
matrix for second group; see specification in description |
threshold |
score threshold to plot (between 0 and 1) |
labels |
labels for group 1 and group 2 |
inc_died |
set to TRUE to include a second panel showing 'death' type admissions |
Takes two matrices as input with the following specifications: Each matrix corresponds to one group Columns are named with the admission types to be plotted. Any admission types including the string 'Died' are counted as deaths If the matrix has N rows, these are interpreted as corresponding to N score quantiles in increasing order. The (i,j)th entry of the matrix is the number of people admitted for reason i with a score greater than or equal to (j-1)/N and less than (j/N) who are in that group
Silently return ggplot object
# See vignette
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.