crude_rates: Crude Prevalence Calculator

View source: R/crude_rates.R

crude_ratesR Documentation

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

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)

ald0405/SangerTools documentation built on Feb. 20, 2024, 3:11 p.m.