Skip to contents

Build base cohorts

conceptCohort()
Create cohorts based on a concept set
demographicsCohort()
Create cohorts based on patient demographics
measurementCohort()
Create cohorts measurement based cohorts
requireMinCohortCount()
Filter cohorts to keep only records for those with a minimum amount of subjects
requireInDateRange()
Require that an index date is within a date range
requireIsFirstEntry()
Restrict cohort to first entry
requireIsLastEntry()
Restrict cohort to last entry per person
requireIsEntry()
Restrict cohort to specific entry

Impose singular demographic requirements on existing cohorts

requireAge()
Restrict cohort on age
requireSex()
Restrict cohort on sex
requirePriorObservation()
Restrict cohort on prior observation
requireFutureObservation()
Restrict cohort on future observation

Impose multiple demographic requirements on existing cohorts

requireDemographics()
Restrict cohort on patient demographics

Impose requirements of presence or absence in other cohorts, concept sets, or table

requireCohortIntersect()
Require cohort subjects are present (or absence) in another cohort
requireConceptIntersect()
Require cohort subjects to have (or not have) events of a concept list
requireTableIntersect()
Require cohort subjects are present in another clinical table

Impose presence or absence of a death record within a time window

requireDeathFlag()
Require cohort subjects have (or do not have) a death record

Update cohort start and end dates

entryAtFirstDate()
Update cohort start date to be the first date from of a set of column dates
entryAtLastDate()
Set cohort start date to the last of a set of column dates
exitAtDeath()
Set cohort end date to death date
exitAtFirstDate()
Set cohort end date to the first of a set of column dates
exitAtLastDate()
Set cohort end date to the last of a set of column dates
exitAtObservationEnd()
Set cohort end date to end of observation
padCohortDate()
Set cohort start or cohort end
padCohortEnd()
Add days to cohort end
padCohortStart()
Add days to cohort start
trimDemographics()
Restrict cohort on patient demographics
trimToDateRange()
Trim cohort dates to be within a date range

Concatanate cohort entries

collapseCohorts()
Collapse cohort entries using a certain gap to concatenate records.

Filter cohorts

subsetCohorts()
Generate a cohort table keeping a subset of cohorts.
sampleCohorts()
Sample a cohort table for a given number of individuals.

Copy cohorts

copyCohorts()
Copy a cohort table

Split cohorts

yearCohorts()
Generate a new cohort table restricting cohort entries to certain years
stratifyCohorts()
Create a new cohort table from stratifying an existing one

Combine cohorts

intersectCohorts()
Generate a combination cohort set between the intersection of different cohorts.
unionCohorts()
Generate cohort from the union of different cohorts

Match cohorts

matchCohorts()
Generate a new cohort matched cohort

Mock data

mockCohortConstructor()
Function to create a mock cdm reference for CohortConstructor

Package benchmark

benchmarkCohortConstructor()
Run benchmark of CohortConstructor package
benchmarkData
Benchmarking results

Utility functions

renameCohort()
Utility function to change the name of a cohort.
addCohortTableIndex()
Add an index to a cohort table