knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of funnelplot is to simplify risk adjusted comparisons of institutional (cluster) performance for the purpose of outlier discovery.
You can install the development version of funnelplot from GitHub with:
# install.packages("devtools") devtools::install_github("oizin/funnelplot")
This is a basic example which shows you how to produce a risk adjusted funnel plot with 95% and 99% control limits:
library(funnelplot) data("example_data") # outcome ~ covariates | cluster ID f1 <- funnelModel(test ~ age + gender | hosp_id, pointTarget(limits = c(0.05,0.01)), data = example_data) plot(f1) + theme_funnel()
funnelplot supports:
All objects returned by funnelplot::plot()
are ggplot2 objects enabling further customisation:
library(ggplot2) plot(f1) + labs(x = "Number of patients", y = "Performed test (%)", title = "Hospital performance (2018)", subtitle = "Adjusted for patient age and gender") + scale_y_continuous(breaks = seq(0.2,0.6,0.2),labels = 100*seq(0.2,0.6,0.2)) + scale_color_discrete(name = "Control limit", labels = c(0.95,0.99)) + theme(panel.background = element_rect(fill = "gray96", colour = "white", size = 0.5, linetype = "solid"))
See the vignettes:
# vignettes vignette("funnelplot-intro")
Benjamini, Y., & Hochberg, Y. (1995). Controlling the false discovery rate: a practical and powerful approach to multiple testing. Journal of the royal statistical society. Series B (Methodological), 289-300.
Jones, H. E., Ohlssen, D. I., & Spiegelhalter, D. J. (2008). Use of the false discovery rate when comparing multiple health care providers. Journal of clinical epidemiology, 61(3), 232-240.
Spiegelhalter, D. J. (2005). Funnel plots for comparing institutional performance. Statistics in medicine, 24(8), 1185-1202.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.