funnel_plot | R Documentation |
This function allows to construct a risk-adjusted funnel plot for comparing survival proportion between units, see Spiegelhalter (2005).
funnel_plot(data, ctime, p0, glmmod, followup, predlim = c(0.95, 0.99),
assist)
data |
A
and optionally additional covariates used for risk-adjustment. |
ctime |
Construction time at which the funnel plot should be determined. Maximum possible time used when not specified. |
p0 |
The baseline failure probability at |
glmmod |
A generalized linear regression model as produced by
the function
|
followup |
The followup time for every individual. At what time after subject entry do we consider the outcome? |
predlim |
A vector of confidence levels for the prediction limits of interest. Default is c(0.95, 0.99). |
assist |
(optional): Output of the function |
An object of class "funnelplot" containing:
data
: A data.frame
containing:
unit
:unit number/name;
observed
:observed number of failures at unit;
expected
:expected (risk-adjusted) number of failures at unit;
numtotal
total number of individuals considered at this unit;
p
:(risk-adjusted) proportion of failure at unit;
predlimels
:worse/in-control/better performance than expected at specified confidence levels.
call
: the call used to obtain output
plotdata
: data used for plotting confidence intervals
predlim
: specified confidence level(s)
p0
: (Estimated) baseline failure probability
Daniel Gomon
Spiegelhalter D. J. (2005). Funnel plots for comparing institutional performance. Statistics in medicine, 24(8), 1185-1202. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1002/sim.1970")}
plot.funnelplot
, summary.funnelplot
Other quality control charts:
bk_cusum()
,
cgr_cusum()
#Determine a risk-adjustment model using a generalized linear model.
#Outcome (survival in first 100 days) is regressed on the available covariates:
exprfitfunnel <- as.formula("(survtime <= 100) & (censorid == 1)~ age + sex + BMI")
glmmodfun <- glm(exprfitfunnel, data = surgerydat, family = binomial(link = "logit"))
#Determine the necessary values to produce a funnel plot
funnel <- funnel_plot(data = surgerydat, ctime = 3*365, glmmod = glmmodfun, followup = 100)
#Produce a funnel plot!
plot(funnel)
## Not run:
require(plotly)
#Create an interactive plot!
ggplotly(plot(funnel))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.