draw_plot: Funnel Plots drawing function

View source: R/draw_plot.R

draw_plotR Documentation

Funnel Plots drawing function

Description

Internal function for drawing plot. Do not use this directly, call 'funnel_plot()' instead.

Usage

draw_plot(
  mod_plot_agg,
  limits,
  x_label,
  y_label,
  title,
  label,
  multiplier,
  draw_unadjusted,
  draw_adjusted,
  target,
  min_y,
  max_y,
  min_x,
  max_x,
  data_type,
  sr_method,
  theme,
  plot_cols,
  max.overlaps
)

Arguments

mod_plot_agg

data.frame of containing numerator, denominator, ratio/proportion, SEs and limits

limits

data.frame of limits from set_plot_range().

x_label

Title for the funnel plot x-axis. Usually expected deaths, readmissions, incidents etc.

y_label

Title for the funnel plot y-axis. Usually a standardised ratio.

title

Plot title

label

Whether to label outliers, highlighted groups, both or none. Default is "outlier", by accepted values are: "outlier", "highlight", "both" or "NA".

multiplier

Scale relative risk and funnel by this factor. Default to 1, but 100 is used for HSMR

draw_unadjusted

Draw exact limits based only on data points with no iterpolation. (default=FALSE)

draw_adjusted

Draw overdispersed limits using Spiegelhalter's (2012) tau2 (default=TRUE)

target

the calculated target value for the data type

min_y

Specify the plot range.

max_y

Specify the plot range.

min_x

Specify the plot range.

max_x

Specify the plot range.

data_type

the data type SR, PR or RC.

sr_method

CQC or SHMI methods for standardised ratios

theme

a ggplot theme function.

Value

A list containing [1] the funnel plot as a ggplot2 object., [2]the limits table.


FunnelPlotR documentation built on June 22, 2024, 11:56 a.m.