Learn R Programming

CohortConstructor (version 0.2.2)

demographicsCohort: Create cohorts based on patient demographics

Description

demographicsCohort() creates a cohort table based on patient characteristics. If and when an individual satisfies all the criteria they enter the cohort. When they stop satisfying any of the criteria their cohort entry ends.

Usage

demographicsCohort(
  cdm,
  name,
  ageRange = NULL,
  sex = NULL,
  minPriorObservation = NULL,
  minFutureObservation = NULL
)

Value

A cohort table

Arguments

cdm

A cdm reference.

name

Name of the new cohort table

ageRange

A list of vectors specifying minimum and maximum age.

sex

Can be "Both", "Male" or "Female".

minPriorObservation

A minimum number of prior observation days in the database.

minFutureObservation

A minimum number of future observation days in the database.

Examples

Run this code
# \donttest{
library(CohortConstructor)

cdm <- mockCohortConstructor()

cohort <-  cdm |> demographicsCohort(name = "cohort3", ageRange = c(18,40), sex = "Male")

attrition(cohort)
# }

Run the code above in your browser using DataLab