Description
Plots a bar graph of decomposition of FORP by cause of admission
Usage
plot_decomp(decomp1, decomp2, threshold, labels, inc_died = TRUE)
Value
Silently return ggplot object
Arguments
- 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
Details
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