knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(funnelplot)
library(ggplot2)
data("example_data", package = "funnelplot")
head(example_data)

The control argument

The control argument to funnel is used...

pointTarget

# outcome ~ covariates | cluster ID
f1 <- funnelModel(test ~ gender  +age| hosp_id, pointTarget(), data = example_data)
plot(f1)
# outcome ~ covariates | cluster ID
f1s <- funnelModel(test ~ gender +age | hosp_id, pointTarget(standardised = TRUE), 
  data = example_data)
plot(f1s)

distTarget

# outcome ~ covariates | cluster ID
f2 <- funnelModel(test ~ gender + age | hosp_id, distTarget(limits = c(0.01,0.05),
  standardised = FALSE), data = example_data)
plot(f2)
# outcome ~ covariates | cluster ID
f2s <- funnelModel(test ~ gender + age | hosp_id, distTarget(limits = c(0.01,0.05),
  standardised = TRUE), data = example_data)
plot(f2s)


oizin/funnelplot documentation built on March 11, 2021, 2:58 p.m.