Title: | Estimate Incidence and Prevalence using the OMOP Common Data Model |
---|---|
Description: | Calculate incidence and prevalence using data mapped to the Observational Medical Outcomes Partnership (OMOP) common data model. Incidence and prevalence can be estimated for the total population in a database or for a stratification cohort. |
Authors: | Edward Burn [aut, cre] , Berta Raventos [aut] , Marti Catala [aut] , Mike Du [ctb] , Yuchen Guo [ctb] , Adam Black [ctb] , Ger Inberg [ctb] , Kim Lopez [ctb] |
Maintainer: | Edward Burn <[email protected]> |
License: | Apache License (>= 2) |
Version: | 0.9.0 |
Built: | 2024-11-28 00:09:53 UTC |
Source: | CRAN |
Run benchmark of incidence and prevalence analyses
benchmarkIncidencePrevalence(cdm, analysisType = "all")
benchmarkIncidencePrevalence(cdm, analysisType = "all")
cdm |
A CDM reference object |
analysisType |
A string of the following: "all", "only incidence", "only prevalence" |
a tibble with time taken for different analyses
cdm <- mockIncidencePrevalence( sampleSize = 100, earliestObservationStartDate = as.Date("2010-01-01"), latestObservationStartDate = as.Date("2010-01-01"), minDaysToObservationEnd = 364, maxDaysToObservationEnd = 364, outPre = 0.1 ) timings <- benchmarkIncidencePrevalence(cdm)
cdm <- mockIncidencePrevalence( sampleSize = 100, earliestObservationStartDate = as.Date("2010-01-01"), latestObservationStartDate = as.Date("2010-01-01"), minDaysToObservationEnd = 364, maxDaysToObservationEnd = 364, outPre = 0.1 ) timings <- benchmarkIncidencePrevalence(cdm)
Collect population incidence estimates
estimateIncidence( cdm, denominatorTable, outcomeTable, denominatorCohortId = NULL, outcomeCohortId = NULL, interval = "years", completeDatabaseIntervals = TRUE, outcomeWashout = Inf, repeatedEvents = FALSE, strata = list(), includeOverallStrata = TRUE )
estimateIncidence( cdm, denominatorTable, outcomeTable, denominatorCohortId = NULL, outcomeCohortId = NULL, interval = "years", completeDatabaseIntervals = TRUE, outcomeWashout = Inf, repeatedEvents = FALSE, strata = list(), includeOverallStrata = TRUE )
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 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). |
Incidence estimates
cdm <- mockIncidencePrevalence(sampleSize = 1000) cdm <- generateDenominatorCohortSet( cdm = cdm, name = "denominator", cohortDateRange = c(as.Date("2008-01-01"), as.Date("2018-01-01")) ) inc <- estimateIncidence( cdm = cdm, denominatorTable = "denominator", outcomeTable = "outcome" )
cdm <- mockIncidencePrevalence(sampleSize = 1000) cdm <- generateDenominatorCohortSet( cdm = cdm, name = "denominator", cohortDateRange = c(as.Date("2008-01-01"), as.Date("2018-01-01")) ) inc <- estimateIncidence( cdm = cdm, denominatorTable = "denominator", outcomeTable = "outcome" )
Estimate period prevalence
estimatePeriodPrevalence( cdm, denominatorTable, outcomeTable, denominatorCohortId = NULL, outcomeCohortId = NULL, interval = "years", completeDatabaseIntervals = TRUE, fullContribution = FALSE, strata = list(), includeOverallStrata = TRUE )
estimatePeriodPrevalence( cdm, denominatorTable, outcomeTable, denominatorCohortId = NULL, outcomeCohortId = NULL, interval = "years", completeDatabaseIntervals = TRUE, fullContribution = FALSE, strata = list(), includeOverallStrata = TRUE )
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. |
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). |
Period prevalence estimates
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" )
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" )
Estimate point prevalence
estimatePointPrevalence( cdm, denominatorTable, outcomeTable, denominatorCohortId = NULL, outcomeCohortId = NULL, interval = "years", timePoint = "start", strata = list(), includeOverallStrata = TRUE )
estimatePointPrevalence( cdm, denominatorTable, outcomeTable, denominatorCohortId = NULL, outcomeCohortId = NULL, interval = "years", timePoint = "start", strata = list(), includeOverallStrata = TRUE )
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. Can be "weeks", "months", "quarters", or "years". 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. |
timePoint |
where to compute the point prevalence |
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). |
Point prevalence estimates
cdm <- mockIncidencePrevalence(sampleSize = 1000) cdm <- generateDenominatorCohortSet( cdm = cdm, name = "denominator", cohortDateRange = c(as.Date("2008-01-01"), as.Date("2018-01-01")) ) estimatePointPrevalence( cdm = cdm, denominatorTable = "denominator", outcomeTable = "outcome", interval = "months" )
cdm <- mockIncidencePrevalence(sampleSize = 1000) cdm <- generateDenominatorCohortSet( cdm = cdm, name = "denominator", cohortDateRange = c(as.Date("2008-01-01"), as.Date("2018-01-01")) ) estimatePointPrevalence( cdm = cdm, denominatorTable = "denominator", outcomeTable = "outcome", interval = "months" )
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()
.
generateDenominatorCohortSet( cdm, name, cohortDateRange = as.Date(c(NA, NA)), ageGroup = list(c(0, 150)), sex = "Both", daysPriorObservation = 0, requirementInteractions = TRUE )
generateDenominatorCohortSet( cdm, name, cohortDateRange = as.Date(c(NA, NA)), ageGroup = list(c(0, 150)), sex = "Both", daysPriorObservation = 0, requirementInteractions = TRUE )
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. |
A cdm reference
cdm <- mockIncidencePrevalence(sampleSize = 1000) cdm <- generateDenominatorCohortSet( cdm = cdm, name = "denominator", cohortDateRange = as.Date(c("2008-01-01", "2020-01-01")) ) cdm
cdm <- mockIncidencePrevalence(sampleSize = 1000) cdm <- generateDenominatorCohortSet( cdm = cdm, name = "denominator", cohortDateRange = as.Date(c("2008-01-01", "2020-01-01")) ) cdm
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()
.
generateTargetDenominatorCohortSet( cdm, name, targetCohortTable, targetCohortId = NULL, cohortDateRange = as.Date(c(NA, NA)), timeAtRisk = c(0, Inf), ageGroup = list(c(0, 150)), sex = "Both", daysPriorObservation = 0, requirementInteractions = TRUE )
generateTargetDenominatorCohortSet( cdm, name, targetCohortTable, targetCohortId = NULL, cohortDateRange = as.Date(c(NA, NA)), timeAtRisk = c(0, Inf), ageGroup = list(c(0, 150)), sex = "Both", daysPriorObservation = 0, requirementInteractions = TRUE )
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 ids or the cohort names of the cohorts of interest for the target table. If NULL all cohorts will be considered in the analysis. |
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. |
timeAtRisk |
Lower and upper bound for the time at risk window to apply relative to the target cohort entry. A value of list(c(0, 30), c(31, 60)) would, for example, create one set of denominator cohorts with time up to the 30 days following target cohort entry and another set with time from 31 days following entry to 60 days. If time at risk start is after target cohort exit and/ or observation period end then no time will be contributed. If time at risk end is after cohort exit and/ or observation period, then only time up to these will be contributed. |
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. |
A cdm reference
cdm <- mockIncidencePrevalence(sampleSize = 1000) cdm <- generateTargetDenominatorCohortSet( cdm = cdm, name = "denominator", targetCohortTable = "target", cohortDateRange = as.Date(c("2008-01-01", "2020-01-01")) ) cdm
cdm <- mockIncidencePrevalence(sampleSize = 1000) cdm <- generateTargetDenominatorCohortSet( cdm = cdm, name = "denominator", targetCohortTable = "target", cohortDateRange = as.Date(c("2008-01-01", "2020-01-01")) ) cdm
Generate example subset of the OMOP CDM for estimating incidence and prevalence
mockIncidencePrevalence( personTable = NULL, observationPeriodTable = NULL, targetCohortTable = NULL, outcomeTable = NULL, sampleSize = 1, outPre = 1, seed = 444, earliestDateOfBirth = NULL, latestDateOfBirth = NULL, earliestObservationStartDate = as.Date("1900-01-01"), latestObservationStartDate = as.Date("2010-01-01"), minDaysToObservationEnd = 1, maxDaysToObservationEnd = 4380, minOutcomeDays = 1, maxOutcomeDays = 10, maxOutcomes = 1 ) mockIncidencePrevalenceRef( personTable = NULL, observationPeriodTable = NULL, targetCohortTable = NULL, outcomeTable = NULL, sampleSize = 1, outPre = 1, seed = 444, earliestDateOfBirth = NULL, latestDateOfBirth = NULL, earliestObservationStartDate = as.Date("1900-01-01"), latestObservationStartDate = as.Date("2010-01-01"), minDaysToObservationEnd = 1, maxDaysToObservationEnd = 4380, minOutcomeDays = 1, maxOutcomeDays = 10, maxOutcomes = 1 )
mockIncidencePrevalence( personTable = NULL, observationPeriodTable = NULL, targetCohortTable = NULL, outcomeTable = NULL, sampleSize = 1, outPre = 1, seed = 444, earliestDateOfBirth = NULL, latestDateOfBirth = NULL, earliestObservationStartDate = as.Date("1900-01-01"), latestObservationStartDate = as.Date("2010-01-01"), minDaysToObservationEnd = 1, maxDaysToObservationEnd = 4380, minOutcomeDays = 1, maxOutcomeDays = 10, maxOutcomes = 1 ) mockIncidencePrevalenceRef( personTable = NULL, observationPeriodTable = NULL, targetCohortTable = NULL, outcomeTable = NULL, sampleSize = 1, outPre = 1, seed = 444, earliestDateOfBirth = NULL, latestDateOfBirth = NULL, earliestObservationStartDate = as.Date("1900-01-01"), latestObservationStartDate = as.Date("2010-01-01"), minDaysToObservationEnd = 1, maxDaysToObservationEnd = 4380, minOutcomeDays = 1, maxOutcomeDays = 10, maxOutcomes = 1 )
personTable |
A tibble in the format of the person table. |
observationPeriodTable |
A tibble in the format of the observation period table. |
targetCohortTable |
A tibble in the format of a cohort table which can be used for stratification |
outcomeTable |
A tibble in the format of a cohort table which can be used for outcomes |
sampleSize |
The number of unique patients. |
outPre |
The fraction of patients with an event. |
seed |
The seed for simulating the data set. Use the same seed to get same data set. |
earliestDateOfBirth |
The earliest date of birth of a patient in person table. |
latestDateOfBirth |
The latest date of birth of a patient in person table. |
earliestObservationStartDate |
The earliest observation start date for patient format. |
latestObservationStartDate |
The latest observation start date for patient format. |
minDaysToObservationEnd |
The minimum number of days of the observational integer. |
maxDaysToObservationEnd |
The maximum number of days of the observation period integer. |
minOutcomeDays |
The minimum number of days of the outcome period default set to 1. |
maxOutcomeDays |
The maximum number of days of the outcome period default set to 10. |
maxOutcomes |
The maximum possible number of outcomes per person can have default set to 1. |
A cdm reference to a duckdb database with mock data.
cdm <- mockIncidencePrevalence(sampleSize = 100) cdm
cdm <- mockIncidencePrevalence(sampleSize = 100) cdm
Options are:
hideConfidenceInterval: Logical. Whether to show confidence intervals
line: Logical. Whether to plot a line using geom_line
point: Logical. Whether to plot points using geom_point
facetNcols -> Numeric. Number of facet columns
facetScales -> Character. Should scales be fixed ("fixed", the default), free ("free"), or free in one dimension ("free_x", "free_y")?
optionsPlot()
optionsPlot()
List of available parameters and their default values.
optionsPlot()
optionsPlot()
It provides a list of allowed inputs for .option argument in tableIncidence, and their given default values.
optionsTableIncidence()
optionsTableIncidence()
The default .options named list.
{ optionsTableIncidence() }
{ optionsTableIncidence() }
It provides a list of allowed inputs for .option argument in tablePrevalence, and their given default values.
optionsTablePrevalence()
optionsTablePrevalence()
The default .options named list.
{ optionsTablePrevalence() }
{ optionsTablePrevalence() }
Plot incidence results
plotIncidence( result, x = "incidence_start_date", y = "incidence_100000_pys", ylim = c(0, NA), ribbon = FALSE, facet = NULL, colour = NULL, options = list() )
plotIncidence( result, x = "incidence_start_date", y = "incidence_100000_pys", ylim = c(0, NA), ribbon = FALSE, facet = NULL, colour = NULL, options = list() )
result |
Incidence results |
x |
Variable to plot on x axis |
y |
Variable to plot on y axis. Options are: "incidence_100000_pys", "outcome_count", "denominator_count", "person_days" |
ylim |
Limits for the Y axis |
ribbon |
If TRUE, the plot will join points using a ribbon |
facet |
Variables to use for facets |
colour |
Variables to use for colours |
options |
A list of optional plot options. See optionsPlot() for the default parameters. |
A ggplot with the incidence results plotted
cdm <- mockIncidencePrevalence(sampleSize = 1000) cdm <- generateDenominatorCohortSet( cdm = cdm, name = "denominator", cohortDateRange = c(as.Date("2008-01-01"), as.Date("2018-01-01")) ) inc <- estimateIncidence( cdm = cdm, denominatorTable = "denominator", outcomeTable = "outcome" ) plotIncidence(inc)
cdm <- mockIncidencePrevalence(sampleSize = 1000) cdm <- generateDenominatorCohortSet( cdm = cdm, name = "denominator", cohortDateRange = c(as.Date("2008-01-01"), as.Date("2018-01-01")) ) inc <- estimateIncidence( cdm = cdm, denominatorTable = "denominator", outcomeTable = "outcome" ) plotIncidence(inc)
Plot prevalence results
plotPrevalence( result, x = "prevalence_start_date", y = "prevalence", ylim = c(0, NA), ribbon = FALSE, facet = NULL, colour = NULL, options = list() )
plotPrevalence( result, x = "prevalence_start_date", y = "prevalence", ylim = c(0, NA), ribbon = FALSE, facet = NULL, colour = NULL, options = list() )
result |
Prevalence results |
x |
Variable to plot on x axis |
y |
Variable to plot on y axis. Options are: "prevalence", "denominator_count", "outcome_count" |
ylim |
Limits for the Y axis |
ribbon |
If TRUE, the plot will join points using a ribbon |
facet |
Variables to use for facets |
colour |
Variables to use for colours |
options |
A list of optional plot options. See optionsPlot() for the default parameters. |
A ggplot with the prevalence results plotted
cdm <- mockIncidencePrevalence(sampleSize = 1000) cdm <- generateDenominatorCohortSet( cdm = cdm, name = "denominator", cohortDateRange = c(as.Date("2014-01-01"), as.Date("2018-01-01")) ) prev <- estimatePointPrevalence( cdm = cdm, denominatorTable = "denominator", outcomeTable = "outcome" ) plotPrevalence(prev)
cdm <- mockIncidencePrevalence(sampleSize = 1000) cdm <- generateDenominatorCohortSet( cdm = cdm, name = "denominator", cohortDateRange = c(as.Date("2014-01-01"), as.Date("2018-01-01")) ) prev <- estimatePointPrevalence( cdm = cdm, denominatorTable = "denominator", outcomeTable = "outcome" ) plotPrevalence(prev)
Table of incidence results
tableIncidence( result, type = "gt", header = c("estimate_name"), groupColumn = character(), settingsColumn = omopgenerics::settingsColumns(result), hide = character(), .options = list(), settingsColumns = lifecycle::deprecated() )
tableIncidence( result, type = "gt", header = c("estimate_name"), groupColumn = character(), settingsColumn = omopgenerics::settingsColumns(result), hide = character(), .options = list(), settingsColumns = lifecycle::deprecated() )
result |
Incidence results |
type |
Type of table. Can be "gt", "flextable", or "tibble" |
header |
A vector specifying the elements to include in the header. The
order of elements matters, with the first being the topmost header.
The header vector can contain one of the following variables: "cdm_name",
"denominator_cohort_name", "outcome_cohort_name", "incidence_start_date",
"incidence_end_date", "estimate_name", variables in the |
groupColumn |
Variables to use as group labels. Allowed columns are the
same as in |
settingsColumn |
Variables from the settings atribute to dispaly in the table |
hide |
Table columns to exclude, options are the ones described in
|
.options |
Table options to apply |
settingsColumns |
Table of results
cdm <- mockIncidencePrevalence(sampleSize = 1000) cdm <- generateDenominatorCohortSet( cdm = cdm, name = "denominator", cohortDateRange = c(as.Date("2008-01-01"), as.Date("2018-01-01")) ) inc <- estimateIncidence( cdm = cdm, denominatorTable = "denominator", outcomeTable = "outcome" ) tableIncidence(inc)
cdm <- mockIncidencePrevalence(sampleSize = 1000) cdm <- generateDenominatorCohortSet( cdm = cdm, name = "denominator", cohortDateRange = c(as.Date("2008-01-01"), as.Date("2018-01-01")) ) inc <- estimateIncidence( cdm = cdm, denominatorTable = "denominator", outcomeTable = "outcome" ) tableIncidence(inc)
Table of incidence attrition results
tableIncidenceAttrition( result, type = "gt", header = "variable_name", groupColumn = c("cdm_name", "variable_level"), settingsColumn = omopgenerics::settingsColumns(result), hide = "estimate_name", settingsColumns = lifecycle::deprecated() )
tableIncidenceAttrition( result, type = "gt", header = "variable_name", groupColumn = c("cdm_name", "variable_level"), settingsColumn = omopgenerics::settingsColumns(result), hide = "estimate_name", settingsColumns = lifecycle::deprecated() )
result |
A summarised_result object. Output of summariseCohortAttrition(). |
type |
Type of table. Check supported types with
|
header |
Columns to use as header. See options with
|
groupColumn |
Variables to use as group labels. Allowed columns are the
same as in |
settingsColumn |
Variables from the settings atribute to dispaly in the table |
hide |
Table columns to exclude, options are the ones described in
|
settingsColumns |
A visual table.
Table of prevalence results
tablePrevalence( result, type = "gt", header = c("estimate_name"), groupColumn = character(), settingsColumn = omopgenerics::settingsColumns(result), hide = character(), .options = list(), settingsColumns = lifecycle::deprecated() )
tablePrevalence( result, type = "gt", header = c("estimate_name"), groupColumn = character(), settingsColumn = omopgenerics::settingsColumns(result), hide = character(), .options = list(), settingsColumns = lifecycle::deprecated() )
result |
Prevalence results |
type |
Type of table. Can be "gt", "flextable", or "tibble" |
header |
A vector specifying the elements to include in the header. The
order of elements matters, with the first being the topmost header.
The header vector can contain one of the following variables: "cdm_name",
"denominator_cohort_name", "outcome_cohort_name", "prevalence_start_date",
"prevalence_end_date", "estimate_name", variables in the |
groupColumn |
Variables to use as group labels. Allowed columns are the
same as in |
settingsColumn |
Variables from the settings atribute to dispaly in the table |
hide |
Table columns to exclude, options are the ones described in
|
.options |
Table options to apply |
settingsColumns |
Table of prevalence results
cdm <- mockIncidencePrevalence(sampleSize = 1000) cdm <- generateDenominatorCohortSet( cdm = cdm, name = "denominator", cohortDateRange = c(as.Date("2008-01-01"), as.Date("2018-01-01")) ) prev <- estimatePointPrevalence( cdm = cdm, denominatorTable = "denominator", outcomeTable = "outcome", interval = "months" ) tablePrevalence(prev)
cdm <- mockIncidencePrevalence(sampleSize = 1000) cdm <- generateDenominatorCohortSet( cdm = cdm, name = "denominator", cohortDateRange = c(as.Date("2008-01-01"), as.Date("2018-01-01")) ) prev <- estimatePointPrevalence( cdm = cdm, denominatorTable = "denominator", outcomeTable = "outcome", interval = "months" ) tablePrevalence(prev)
Table of prevalence attrition results
tablePrevalenceAttrition( result, type = "gt", header = "variable_name", groupColumn = c("cdm_name", "variable_level"), settingsColumn = omopgenerics::settingsColumns(result), hide = "estimate_name", settingsColumns = lifecycle::deprecated() )
tablePrevalenceAttrition( result, type = "gt", header = "variable_name", groupColumn = c("cdm_name", "variable_level"), settingsColumn = omopgenerics::settingsColumns(result), hide = "estimate_name", settingsColumns = lifecycle::deprecated() )
result |
A summarised_result object. Output of summariseCohortAttrition(). |
type |
Type of table. Check supported types with
|
header |
Columns to use as header. See options with
|
groupColumn |
Variables to use as group labels. Allowed columns are the
same as in |
settingsColumn |
Variables from the settings atribute to dispaly in the table |
hide |
Table columns to exclude, options are the ones described in
|
settingsColumns |
A visual table.