assign_funnel_significance | R Documentation |
This follows the funnel plot methodology published on the PHE Fingertips Technical Guidance page: https://fingertips.phe.org.uk/profile/guidance/supporting-information/PH-methods
assign_funnel_significance(
data,
numerator,
denominator,
rate,
statistic = NULL,
rate_type = NULL,
multiplier = NULL
)
data |
a data.frame containing the data to assign significance for; unquoted string; no default |
numerator |
field name from data containing the observed numbers of cases in the sample meeting the required condition (the numerator or observed counts for the control limits); unquoted string; no default |
denominator |
field name from data containing the population(s) in the sample (the denominator or expected counts for the control limits); unquoted string; no default |
rate |
field name from data containing the rate data when creating funnels for a Crude or Directly Standardised Rate; unquoted string; no default |
statistic |
type of statistic to inform funnel calculations. Acceptable values are "proportion", "ratio" or "rate"; string; no default |
rate_type |
if statistic is "rate", specify either "dsr" or "crude"; string; no default |
multiplier |
the multiplier that the rate is normalised with (ie, per 100,000); only required when statistic = "rate"; numeric; no default |
returns the original data.frame with the significance level appended
Matthew Francis
Other PHEindicatormethods package functions:
calculate_ISRate()
,
calculate_ISRatio()
,
calculate_funnel_limits()
,
calculate_funnel_points()
,
phe_dsr()
,
phe_life_expectancy()
,
phe_mean()
,
phe_proportion()
,
phe_quantile()
,
phe_rate()
,
phe_sii()
library(dplyr)
df <- data.frame(
Area = c("A", "B", "C", "D"),
numerator = c(10232, 12321, 15123, 13213),
denominator = c(15232, 16123, 17932, 18475)
)
df %>%
assign_funnel_significance(numerator, denominator,
statistic = "proportion", multiplier = 100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.