generateTargetDenominatorCohortSet {IncidencePrevalence} | R Documentation |
Identify a set of denominator populations using a target cohort
Description
generateTargetDenominatorCohortSet()
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
generateTargetDenominatorCohortSet(
cdm,
name,
targetCohortTable,
targetCohortId = NULL,
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. |
targetCohortTable |
A cohort table in the cdm reference to use to limit cohort entry and exit (with individuals only contributing to a cohort when they are contributing to the cohort in the target table). |
targetCohortId |
The cohort definition id for the cohort of interest in the target table. If targetCohortTable is specified, a single targetCohortId must also be specified. |
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 <- generateTargetDenominatorCohortSet(
cdm = cdm,
name = "denominator",
targetCohortTable = "target",
cohortDateRange = as.Date(c("2008-01-01", "2020-01-01"))
)
cdm