funnel_plot {success}R Documentation

Risk-adjusted funnel plot

Description

This function allows to construct a risk-adjusted funnel plot for comparing survival proportion between units, see Spiegelhalter (2005).

Usage

funnel_plot(data, ctime, p0, glmmod, followup, predlim = c(0.95, 0.99),
  assist)

Arguments

data

A data.frame with rows representing subjects and the following named columns:

entrytime:

time of entry into study (numeric);

survtime:

time from entry until event (numeric);

censorid:

censoring indicator (0 = right censored, 1 = observed), (integer);

unit:

integer or character indicating which unit (f.e. hospital) the observation belongs to.

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 entrytime + followup for individuals. If not specified, average failure proportion over whole data is used instead.

glmmod

A generalized linear regression model as produced by the function glm(). Recommended:
glm(as.formula("(survtime <= followup) & (censorid == 1) ~ covariates"), data = data).
Alternatively, a list with the following elements:

formula:

a formula() in the form ~ covariates;

coefficients:

a named vector specifying risk adjustment coefficients for covariates. Names must be the same as in formula and colnames of data.

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 parameter_assist()

Value

An object of class "funnelplot" containing:

Author(s)

Daniel Gomon

References

Spiegelhalter D. J. (2005). Funnel plots for comparing institutional performance. Statistics in medicine, 24(8), 1185-1202. doi:10.1002/sim.1970

See Also

plot.funnelplot, summary.funnelplot

Other quality control charts: bk_cusum(), cgr_cusum()

Examples

#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)

[Package success version 1.0.1 Index]