Collect population incidence estimates
estimateIncidence.Rd
Collect population incidence estimates
Usage
estimateIncidence(
cdm,
denominatorTable,
outcomeTable,
denominatorCohortId = NULL,
outcomeCohortId = NULL,
interval = "years",
completeDatabaseIntervals = TRUE,
outcomeWashout = Inf,
repeatedEvents = FALSE,
strata = list(),
includeOverallStrata = TRUE
)
Arguments
- cdm
A CDM reference object
- denominatorTable
A cohort table with a set of denominator cohorts (for example, created using the
generateDenominatorCohortSet()
function).- outcomeTable
A cohort table in the cdm reference containing a set of outcome cohorts.
- denominatorCohortId
The cohort definition ids or the cohort names of the denominator cohorts of interest. If NULL all cohorts will be considered in the analysis.
- outcomeCohortId
The cohort definition ids or the cohort names of the outcome cohorts of interest. If NULL all cohorts will be considered in the analysis.
- interval
Time intervals over which incidence is estimated. Can be "weeks", "months", "quarters", "years", or "overall". ISO weeks will be used for weeks. Calendar months, quarters, or years can be used, or an overall estimate for the entire time period observed (from earliest cohort start to last cohort end) can also be estimated. If more than one option is chosen then results will be estimated for each chosen interval.
- completeDatabaseIntervals
TRUE/ FALSE. Where TRUE, incidence will only be estimated for those intervals where the denominator cohort captures all the interval.
- outcomeWashout
The number of days used for a 'washout' period between the end of one outcome and an individual starting to contribute time at risk. If Inf, no time can be contributed after an event has occurred.
- repeatedEvents
TRUE/ FALSE. If TRUE, an individual will be able to contribute multiple events during the study period (time while they are present in an outcome cohort and any subsequent washout will be excluded). If FALSE, an individual will only contribute time up to their first event.
- strata
Variables added to the denominator cohort table for which to stratify estimates.
- includeOverallStrata
Whether to include an overall result as well as strata specific results (when strata has been specified).
Examples
# \donttest{
cdm <- mockIncidencePrevalence(sampleSize = 1000)
cdm <- generateDenominatorCohortSet(
cdm = cdm, name = "denominator",
cohortDateRange = c(as.Date("2008-01-01"), as.Date("2018-01-01"))
)
#> ℹ Creating denominator cohorts
#> ✔ Cohorts created in 0 min and 2 sec
inc <- estimateIncidence(
cdm = cdm,
denominatorTable = "denominator",
outcomeTable = "outcome"
)
#> Getting incidence for analysis 1 of 1
#> Overall time taken: 0 mins and 1 secs
# }