prev_totals: Calculates the prevalence totals for the output of a data...

View source: R/prevalence.R

prev_totalsR Documentation

Calculates the prevalence totals for the output of a data frame of events/patients etc.

Description

e.g. Run on the output of a call to prev_terms

Usage

prev_totals(dat, included_totals = c("year", .ehr$practice_id),
  time_var = "year", person_years = 100)

Arguments

dat

a dataframe

included_totals

character vector describing which aggregates should be included e.g. c("year", "practid")

time_var

name of the variable determining timepoints

person_years

numeric multiplier for presentation of prevalence and incidence numbers

Details

Outputs totals by aggregated by a time variable and other variables Updated to use dplyr to do the aggregation - Now 40x faster!

Value

list of aggregates and/or the original data


rOpenHealth/rEHR documentation built on Sept. 25, 2024, 5:32 p.m.