Learn R Programming

SangerTools (version 1.0.2)

crude_rates: Crude Prevalence Calculator

Description

Calculate the crude prevalence of a health condition from a Master Patient Index like dataset

Usage

crude_rates(df, Condition, ...)

Arguments

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

Value

a tibble with Crude Prevalence Rates(Rate per 1,000) for each value included in ...

Examples

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab