summariseCohortTiming {CohortCharacteristics}R Documentation

Summarise timing between entries into cohorts in a cohort table

Description

Summarise timing between entries into cohorts in a cohort table

Usage

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

Arguments

cohort

A cohort table in a cdm reference.

cohortId

A cohort definition id to restrict by. If NULL, all cohorts will be included.

strata

A list of variables to stratify results. These variables must have been added as additional columns in the cohort table.

restrictToFirstEntry

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

estimates

Summary statistics to use when summarising timing.

density

TRUE or FALSE. If TRUE, estimates for a density plot will also be computed.

Value

A summary of timing between entries into cohorts in the cohort table.

Examples


library(CohortCharacteristics)
cdm <- CohortCharacteristics::mockCohortCharacteristics()
summariseCohortTiming(cdm$cohort2) |> dplyr::glimpse()
CDMConnector::cdmDisconnect(cdm = cdm)



[Package CohortCharacteristics version 0.2.0 Index]