crude_rates | R Documentation |
Calculate the crude prevalence of a health condition from a Master Patient Index like dataset
crude_rates(df, Condition, ...)
df |
a tidy dataframe in standard Master Patient Index format ie SangerTools::PopHealthData |
Condition |
A Health condition flag denoted by 1 & 0; where 1 denotes the patient being positive for the health condition |
... |
Variables used to standardise by; Must always have Ageband, additional variables are optional |
a tibble with Crude Prevalence Rates(Rate per 1,000) for each value included in ...
library(SangerTools) library(dplyr) health_data <- SangerTools::PopHealthData glimpse(health_data) # Generate crude prevalene rate stats crude_prevalence <- SangerTools::crude_rates(health_data, Diabetes, Locality) print(crude_prevalence)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.