crude_pr: Crude Prevalence Rate. Calculate a group's Crude Prevalence...

Description Usage Arguments Value Examples

View source: R/crude_pr.R

Description

Crude Prevalence Rate. Calculate a group's Crude Prevalence Rate (Rate Per 1,000). This is created to work with datasets that have 1 row per individual and Columns as variables. This function utilises the Tidyverse framework of Non-Standard Evaluation. As such arguments are passed to the function without quotation.

Usage

1
crude_pr(dataset_base_pop, dataset_condition_pop, demographic)

Arguments

dataset_base_pop

A dataframe containing 1 row per patient of an entire population

dataset_condition_pop

A dataframe containing 1 row per patient of the population with a given condition

demographic

This the grouping variable over which the rates with be calculated

Value

a tibble with calculated rate per 1000

Examples

1
2
3
4
5
6
7
8
library(SangerTools)
library(dplyr)
health_data <- SangerTools::PopHealthData
glimpse(health_data)
# Generate crude prevalene rate stats
crude_prevalence <- SangerTools::crude_pr(health_data, health_data %>%
dplyr::filter(Diabetes==1), Locality)
print(crude_prevalence)

ald0405/SangerTools documentation built on Jan. 14, 2022, 9:42 p.m.