estimatePeriodPrevalence {IncidencePrevalence} | R Documentation |
Estimate period prevalence
Description
Estimate period prevalence
Usage
estimatePeriodPrevalence(
cdm,
denominatorTable,
outcomeTable,
denominatorCohortId = NULL,
outcomeCohortId = NULL,
interval = "years",
completeDatabaseIntervals = TRUE,
fullContribution = FALSE,
level = "person",
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 |
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 period prevalence is estimated. This can be "weeks", "months", "quarters", "years", or "overall". ISO weeks will be used for weeks. Calendar months, quarters, or years can be used as the period. If more than one option is chosen then results will be estimated for each chosen interval. |
completeDatabaseIntervals |
TRUE/ FALSE. Where TRUE, prevalence will only be estimated for those intervals where the database captures all the interval (based on the earliest and latest observation period start dates, respectively). |
fullContribution |
TRUE/ FALSE. Where TRUE, individuals will only be included if they in the database for the entire interval of interest. If FALSE they are only required to present for one day of the interval in order to contribute. |
level |
Can be "person" or "record". When estimating at the record level, each span of time contributed in the denominator will be considered separately (e.g. so as to estimate prevalence at the episode level). When estimating at the person level, multiple entries for a person will be considered together. |
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). |
Value
Period prevalence estimates
Examples
cdm <- mockIncidencePrevalence(sampleSize = 1000)
cdm <- generateDenominatorCohortSet(
cdm = cdm, name = "denominator",
cohortDateRange = c(as.Date("2008-01-01"), as.Date("2018-01-01"))
)
estimatePeriodPrevalence(
cdm = cdm,
denominatorTable = "denominator",
outcomeTable = "outcome",
interval = "months"
)