calculate_cruderate | R Documentation |
calculate_cruderate
performs calculations for a crude rate per 100,000 (by default) and associated standard errors. If the numerator is 0, the
standard error is determined by the modified Wald interval. Missing numerator values will be filled with zero. When denominator is NA,
the rates/SE will not occur.
calculate_cruderate(data, numerator, denominator, per = 1e+05)
data |
A data object. |
numerator |
Character vector of the column name. |
denominator |
Character vector of the column name. |
per |
Numeric value for rate scale (i.e. per X population). |
A new dataset (tibble
) with crude rate and standard error added.
tempData <- data.frame(cases = as.numeric(c(1, 0 , 100, 10, NA)), population = as.numeric(c(10, 1000, 3200, NA, 1000)))
calculate_cruderate(tempData, 'cases', 'population')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.