
Run cohort-level diagnostics
cohortDiagnostics.Rd
Runs phenotypeR diagnostics on the cohort. The diganostics include: * Age groups and sex summarised. * A summary of visits of everyone in the cohort using visit_occurrence table. * A summary of age and sex density of the cohort. * Attritions of the cohorts. * Overlap between cohorts (if more than one cohort is being used).
Examples
# \donttest{
library(PhenotypeR)
cdm <- mockPhenotypeR()
result <- cohortDiagnostics(cdm$my_cohort)
#> • Getting cohort attrition
#> • Getting cohort overlap
#> • Getting cohort timing
#> ℹ The following estimates will be computed:
#> • days_between_cohort_entries: median, q25, q75, min, max, density
#> ! Table is collected to memory as not all requested estimates are supported on
#> the database side
#> → Start summary of data, at 2025-02-19 09:28:49.650517
#> ✔ Summary finished, at 2025-02-19 09:28:49.743608
#> • cohort_1 - get cohort and index
#> • cohort_1 - cohort summary
#> ℹ adding demographics columns
#> ℹ adding tableIntersectCount 1/1
#> ℹ summarising data
#> ✔ summariseCharacteristics finished!
#> • cohort_1 - age density
#> ℹ The following estimates will be computed:
#> • age: density
#> → Start summary of data, at 2025-02-19 09:28:54.031069
#> ✔ Summary finished, at 2025-02-19 09:28:54.33912
#> • cohort_2 - get cohort and index
#> • cohort_2 - cohort summary
#> ℹ adding demographics columns
#> ℹ adding tableIntersectCount 1/1
#> ℹ summarising data
#> ✔ summariseCharacteristics finished!
#> • cohort_2 - age density
#> ℹ The following estimates will be computed:
#> • age: density
#> → Start summary of data, at 2025-02-19 09:28:58.347234
#> ✔ Summary finished, at 2025-02-19 09:28:58.653185
CDMConnector::cdmDisconnect(cdm = cdm)
# }