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.
Examples
# \donttest{
if(isTRUE(omock::isMockDatasetDownloaded("GiBleed"))){
library(CohortConstructor)
cdm <- mockCohortConstructor()
cohort <- cdm |>
demographicsCohort(name = "cohort3", ageRange = c(18,40), sex = "Male")
attrition(cohort)
# Can also create multiple demographic cohorts, and add minimum prior history requirements.
cohort <- cdm |>
demographicsCohort(name = "cohort4",
ageRange = list(c(0, 19),c(20, 64),c(65, 150)),
sex = c("Male", "Female", "Both"),
minPriorObservation = 365)
attrition(cohort)
}
# }
