generateDenominatorCohortSet {IncidencePrevalence} | R Documentation |
Identify a set of denominator populations
Description
generateDenominatorCohortSet()
creates a set of cohorts that
can be used for the denominator population in analyses of incidence,
using estimateIncidence()
, or prevalence, using estimatePointPrevalence()
or estimatePeriodPrevalence()
.
Usage
generateDenominatorCohortSet(
cdm,
name,
cohortDateRange = as.Date(c(NA, NA)),
ageGroup = list(c(0, 150)),
sex = "Both",
daysPriorObservation = 0,
requirementInteractions = TRUE
)
Arguments
cdm |
A CDM reference object |
name |
Name of the cohort table to be created. Note if a table already exists with this name in the database (give the prefix being used for the cdm reference) it will be overwritten. |
cohortDateRange |
Two dates. The first indicating the earliest cohort start date and the second indicating the latest possible cohort end date. If NULL or the first date is set as missing, the earliest observation_start_date in the observation_period table will be used for the former. If NULL or the second date is set as missing, the latest observation_end_date in the observation_period table will be used for the latter. |
ageGroup |
A list of age groups for which cohorts will be generated. A
value of |
sex |
Sex of the cohorts. This can be one or more of: |
daysPriorObservation |
The number of days of prior observation observed in the database required for an individual to start contributing time in a cohort. |
requirementInteractions |
If TRUE, cohorts will be created for all combinations of ageGroup, sex, and daysPriorObservation. If FALSE, only the first value specified for the other factors will be used. Consequently, order of values matters when requirementInteractions is FALSE. |
Value
A cdm reference
Examples
cdm <- mockIncidencePrevalenceRef(sampleSize = 1000)
cdm <- generateDenominatorCohortSet(
cdm = cdm,
name = "denominator",
cohortDateRange = as.Date(c("2008-01-01", "2020-01-01"))
)
cdm