Skip to contents

`r lifecycle::badge("deprecated")`

Usage

summariseCohortTiming(
  cohort,
  cohortId = NULL,
  strata = list(),
  restrictToFirstEntry = TRUE,
  timing = c("min", "q25", "median", "q75", "max"),
  density = FALSE
)

Arguments

cohort

A cohort table in a cdm reference.

cohortId

Vector of cohort definition ids to include, if NULL, all cohort definition ids will be used.

strata

List of the stratifications within each group to be considered. Must be column names in the cohort table provided.

restrictToFirstEntry

If TRUE only an individual's first entry per cohort will be considered. If FALSE all entries per individual will be considered.

timing

Summary statistics for timing.

density

Get data for density plot.

Value

A summarised result.

Examples

# \donttest{
library(PatientProfiles)
cdm <- PatientProfiles::mockPatientProfiles()
results <- summariseCohortTiming(cdm$cohort2)
#>  The following estimates will be computed:
#>  days_between_cohort_entries: min, q25, median, q75, max
#> ! Table is collected to memory as not all requested estimates are supported on
#>   the database side
#> → Start summary of data, at 2024-05-11 12:04:27.222125
#>  Summary finished, at 2024-05-11 12:04:27.271524
CDMConnector::cdmDisconnect(cdm = cdm)
# }