Description Usage Arguments Value Examples
View source: R/stem_funnel_plot.R
Create a funnel plot for a binary outcome for each combination of diseases. Uses functionality provided by the fundata
and funscore
functions in the funnelR package.
1 2 3 4 5 6 7 8 9 | stem_funnel_plot(
comorbid_column,
outcome_column,
cut_level = 2,
use_outcome = FALSE,
maximal = TRUE,
max_x = NULL,
dis_names = NULL
)
|
comorbid_column |
A vector of character strings made up of 0s and 1s, or of factors coercible to character, all should be identical lengths. |
outcome_column |
A numeric vector one if outcome occurred and zero if outcome did not occur. Should be the same length as |
cut_level |
A number indicating the level at which stems should be cut (i.e. the number of diagnoses). |
use_outcome |
A logical indicating if stem derivation should be based on outcome rates or on frequency, defaults to |
maximal |
A logical that true if the 'maximal' stem is to be considered for each record, or if it is to be limited to only records with the same number of diagnoses as |
max_x |
A number indicating the maximum frequency on the x axis, if left |
dis_names |
A list of disease names associated with each position of the comorbid string. If null, then the simple string is returned. |
A list, first element is a ggplot object; a funnel plot with associated 95% and 99% control limits, second element is the underlying data.
1 2 3 4 5 6 7 8 9 10 11 | comorbid_column <- c('1110', '0010', '0010', '0110')
outcome_column <- c(1,0,0,1)
stem_funnel_plot(comorbid_column = comorbid_column,
outcome_column = outcome_column,
use_outcome = FALSE,
maximal = TRUE,
max_x = NULL,
dis_names = c('heart disease', 'hypertension', 'chronic kidney disease', 'cancer')
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.