This comprises all the diagnostics that are being offered in this package, this includes:
* A diagnostics on the database via `databaseDiagnostics`. * A diagnostics on the cohort_codelist attribute of the cohort via `codelistDiagnostics`. * A diagnostics on the cohort via `cohortDiagnostics`. * A diagnostics on the population via `populationDiagnostics`.
Arguments
- cohort
Cohort table in a cdm reference
- databaseDiagnostics
A list of arguments that uses `databaseDiagnostics`. If the list is empty, the default values will be used. Example: *databaseDiagnostics = list( "diagnostics" = c("snapshot", "personTableSummary", "observationPeriodsSummary", "clinicalRecordsSummary") )*
- codelistDiagnostics
A list of arguments that uses `codelistDiagnostics`. If the list is empty, the default values will be used. Example: *codelistDiagnostics = list( "diagnostics" = c("achillesCodeUse", "orphanCodeUse", "cohortCodeUse", "drugDiagnostics", "measurementDiagnostics"), "measurementDiagnosticsSample" = 20000, "drugDiagnosticsSample" = 20000 )*
- cohortDiagnostics
A list of arguments that uses `cohortDiagnostics`. If the list is empty, the default values will be used. Example: *cohortDiagnostics = list( "diagnostics" = c("cohortCount", "cohortCharacteristics", "largeScaleCharacteristics", "compareCohorts", "cohortSurvival), "cohortSample" = 20000, "matchedSample" = 1000 )*
- populationDiagnostics
A list of arguments that uses `populationDiagnostics`. If the list is empty, the default values will be used. Example: *populationDiagnostics = list( "diagnostics" = c("incidence", "periodPrevalence"), "populationSample" = 100000, "populationDateRange" = as.Date(c(NA,NA)) )*
Examples
# \donttest{
library(omock)
library(CohortConstructor)
library(PhenotypeR)
cdm <- mockCdmFromDataset(source = "duckdb")
#> ℹ Loading bundled GiBleed tables from package data.
#> ℹ Adding drug_strength table.
#> ℹ Creating local <cdm_reference> object.
#> ℹ Inserting <cdm_reference> into duckdb.
cdm$warfarin <- conceptCohort(cdm,
conceptSet = list(warfarin = c(1310149L,
40163554L)),
name = "warfarin")
#> ℹ Subsetting table drug_exposure using 2 concepts with domain: drug.
#> ℹ Combining tables.
#> ℹ Creating cohort attributes.
#> ℹ Applying cohort requirements.
#> ℹ Merging overlapping records.
#> ✔ Cohort warfarin created.
# Run PhenotypeR with the default values. If you want to check which are the
# default values, use:
# `formals(populationDiagnostics)`
result <- phenotypeDiagnostics(cdm$warfarin)
#> ℹ Creating log file:
#> /tmp/Rtmpm5Ep3e/phenotypeDiagnostics_log_2026_04_10_19_02_321c8b67f7ba7e.txt.
#> [2026-04-10 19:02:32] - Log file created
#> [2026-04-10 19:02:32] - Database diagnostics - getting CDM Snapshot
#> [2026-04-10 19:02:32] - Database diagnostics - summarising person table
#> ℹ The following estimates will be calculated:
#> • date_of_birth: density
#> ! Table is collected to memory as not all requested estimates are supported on
#> the database side
#> → Start summary of data, at 2026-04-10 19:02:37.122261
#> ✔ Summary finished, at 2026-04-10 19:02:37.184496
#> [2026-04-10 19:02:37] - Database diagnostics - summarising observation period
#> ℹ retrieving cdm object from cdm_table.
#> Warning: ! There are 2649 individuals not included in the person table.
#> ℹ The following estimates will be calculated:
#> • observation_period_start_date: density
#> • observation_period_end_date: density
#> ! Table is collected to memory as not all requested estimates are supported on
#> the database side
#> → Start summary of data, at 2026-04-10 19:02:40.371253
#> ✔ Summary finished, at 2026-04-10 19:02:40.435551
#> [2026-04-10 19:02:41] - Database diagnostics - summarising clinical tables -
#> summary
#> ℹ Adding variables of interest to drug_exposure.
#> ℹ Summarising records per person in drug_exposure.
#> ℹ Summarising subjects not in person table in drug_exposure.
#> ℹ Summarising records in observation in drug_exposure.
#> ℹ Summarising records with start before birth date in drug_exposure.
#> ℹ Summarising records with end date before start date in drug_exposure.
#> ℹ Summarising domains in drug_exposure.
#> ℹ Summarising standard concepts in drug_exposure.
#> ℹ Summarising source vocabularies in drug_exposure.
#> ℹ Summarising concept types in drug_exposure.
#> ℹ Summarising concept class in drug_exposure.
#> ℹ Summarising missing data in drug_exposure.
#> [2026-04-10 19:02:44] - Database diagnostics - summarising clinical tables -
#> trends
#> [2026-04-10 19:02:45] - Codelist diagnostics - index event breakdown
#> Getting counts of warfarin codes for cohort warfarin
#> [2026-04-10 19:02:46] - Codelist diagnostics - drug diagnostics
#> Returning entry cohort as the size of the cohorts to be sampled is equal or
#> smaller than `n`.
#> ℹ The following estimates will be calculated:
#> • exposure_duration: min, q01, q05, q25, median, q75, q95, q99, max,
#> percentage_missing
#> • quantity: min, q01, q05, q25, median, q75, q95, q99, max, percentage_missing
#> ! Table is collected to memory as not all requested estimates are supported on
#> the database side
#> → Start summary of data, at 2026-04-10 19:02:48.706474
#> ✔ Summary finished, at 2026-04-10 19:02:49.532502
#> ℹ The following estimates will be calculated:
#> • days_to_next_record: min, q01, q05, q25, median, q75, q95, q99, max,
#> percentage_missing
#> ! Table is collected to memory as not all requested estimates are supported on
#> the database side
#> → Start summary of data, at 2026-04-10 19:02:50.17419
#> ✔ Summary finished, at 2026-04-10 19:02:50.333264
#> ! No common ingredient found for codelist: `warfarin`.
#> ℹ Change ingredient threshold with options(PhenotypeR_ingredient_threshold),
#> threshold = 0.8.
#> Warning: The CDM reference containing the cohort must also contain achilles tables.
#> Returning only index event breakdown.
#> [2026-04-10 19:02:53] - Cohort diagnostics - cohort attrition
#> [2026-04-10 19:02:54] - Cohort diagnostics - cohort count
#> ℹ summarising data
#> ℹ summarising cohort warfarin
#> ✔ summariseCharacteristics finished!
#> → Skipping cohort sampling as all cohorts have less than 20000 individuals.
#> [2026-04-10 19:02:55] - Cohort diagnostics - matched cohorts
#> → Sampling cohort `tmp_036_sampled`
#> Returning entry cohort as the size of the cohorts to be sampled is equal or
#> smaller than `n`.
#> • Generating an age and sex matched cohort for warfarin
#> Starting matching
#> ℹ Creating copy of target cohort.
#> • 1 cohort to be matched.
#> ℹ Creating controls cohorts.
#> ℹ Excluding cases from controls
#> • Matching by gender_concept_id and year_of_birth
#> • Removing controls that were not in observation at index date
#> • Excluding target records whose pair is not in observation
#> • Adjusting ratio
#> Binding cohorts
#> ✔ Done
#> → Getting cohorts and indexes
#> [2026-04-10 19:03:06] - Cohort diagnostics - cohort characteristics
#> ℹ adding demographics columns
#> ℹ adding tableIntersectCount 1/1
#> window names casted to snake_case:
#> • `-365 to -1` -> `365_to_1`
#> ℹ summarising data
#> ℹ summarising cohort warfarin
#> ℹ summarising cohort warfarin_sampled
#> ℹ summarising cohort warfarin_matched
#> ✔ summariseCharacteristics finished!
#> [2026-04-10 19:03:10] - Cohort diagnostics - age density
#> ℹ The following estimates will be calculated:
#> • age: density
#> ! Table is collected to memory as not all requested estimates are supported on
#> the database side
#> → Start summary of data, at 2026-04-10 19:03:11.361398
#> ✔ Summary finished, at 2026-04-10 19:03:11.48842
#> [2026-04-10 19:03:11] - Cohort diagnostics - large scale characteristics
#> ℹ Summarising large scale characteristics
#> - getting characteristics from table condition_occurrence (1 of 7)
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table visit_occurrence (2 of 7)
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table measurement (3 of 7)
#> - getting characteristics from table measurement (3 of 7) for time window -Inf…
#> - getting characteristics from table measurement (3 of 7) for time window -365…
#> - getting characteristics from table measurement (3 of 7) for time window -30 …
#> - getting characteristics from table measurement (3 of 7) for time window 0 an…
#> - getting characteristics from table measurement (3 of 7) for time window 1 an…
#> - getting characteristics from table measurement (3 of 7) for time window 31 a…
#> - getting characteristics from table measurement (3 of 7) for time window 366 …
#> - getting characteristics from table procedure_occurrence (4 of 7)
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table observation (5 of 7)
#> - getting characteristics from table observation (5 of 7) for time window -Inf…
#> - getting characteristics from table observation (5 of 7) for time window -365…
#> - getting characteristics from table observation (5 of 7) for time window -30 …
#> - getting characteristics from table observation (5 of 7) for time window 0 an…
#> - getting characteristics from table observation (5 of 7) for time window 1 an…
#> - getting characteristics from table observation (5 of 7) for time window 31 a…
#> - getting characteristics from table observation (5 of 7) for time window 366 …
#> - getting characteristics from table drug_exposure (6 of 7)
#> - getting characteristics from table drug_exposure (6 of 7) for time window -I…
#> - getting characteristics from table drug_exposure (6 of 7) for time window -3…
#> - getting characteristics from table drug_exposure (6 of 7) for time window -3…
#> - getting characteristics from table drug_exposure (6 of 7) for time window 0 …
#> - getting characteristics from table drug_exposure (6 of 7) for time window 1 …
#> - getting characteristics from table drug_exposure (6 of 7) for time window 31…
#> - getting characteristics from table drug_exposure (6 of 7) for time window 36…
#> - getting characteristics from table drug_era (7 of 7)
#> - getting characteristics from table drug_era (7 of 7) for time window -Inf an…
#> - getting characteristics from table drug_era (7 of 7) for time window -365 an…
#> - getting characteristics from table drug_era (7 of 7) for time window -30 and…
#> - getting characteristics from table drug_era (7 of 7) for time window 0 and 0
#> - getting characteristics from table drug_era (7 of 7) for time window 1 and 30
#> - getting characteristics from table drug_era (7 of 7) for time window 31 and …
#> - getting characteristics from table drug_era (7 of 7) for time window 366 and…
#> Formatting result
#> 414 estimates dropped as frequency less than 1%
#> ✔ Summarising large scale characteristics
#> ℹ Summarising large scale characteristics
#> - getting characteristics from table condition_occurrence (1 of 7)
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table visit_occurrence (2 of 7)
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table measurement (3 of 7)
#> - getting characteristics from table measurement (3 of 7) for time window -Inf…
#> - getting characteristics from table measurement (3 of 7) for time window -365…
#> - getting characteristics from table measurement (3 of 7) for time window -30 …
#> - getting characteristics from table measurement (3 of 7) for time window 0 an…
#> - getting characteristics from table measurement (3 of 7) for time window 1 an…
#> - getting characteristics from table measurement (3 of 7) for time window 31 a…
#> - getting characteristics from table measurement (3 of 7) for time window 366 …
#> - getting characteristics from table procedure_occurrence (4 of 7)
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table observation (5 of 7)
#> - getting characteristics from table observation (5 of 7) for time window -Inf…
#> - getting characteristics from table observation (5 of 7) for time window -365…
#> - getting characteristics from table observation (5 of 7) for time window -30 …
#> - getting characteristics from table observation (5 of 7) for time window 0 an…
#> - getting characteristics from table observation (5 of 7) for time window 1 an…
#> - getting characteristics from table observation (5 of 7) for time window 31 a…
#> - getting characteristics from table observation (5 of 7) for time window 366 …
#> - getting characteristics from table drug_exposure (6 of 7)
#> - getting characteristics from table drug_exposure (6 of 7) for time window -I…
#> - getting characteristics from table drug_exposure (6 of 7) for time window -3…
#> - getting characteristics from table drug_exposure (6 of 7) for time window -3…
#> - getting characteristics from table drug_exposure (6 of 7) for time window 0 …
#> - getting characteristics from table drug_exposure (6 of 7) for time window 1 …
#> - getting characteristics from table drug_exposure (6 of 7) for time window 31…
#> - getting characteristics from table drug_exposure (6 of 7) for time window 36…
#> - getting characteristics from table drug_era (7 of 7)
#> - getting characteristics from table drug_era (7 of 7) for time window -Inf an…
#> - getting characteristics from table drug_era (7 of 7) for time window -365 an…
#> - getting characteristics from table drug_era (7 of 7) for time window -30 and…
#> - getting characteristics from table drug_era (7 of 7) for time window 0 and 0
#> - getting characteristics from table drug_era (7 of 7) for time window 1 and 30
#> - getting characteristics from table drug_era (7 of 7) for time window 31 and …
#> - getting characteristics from table drug_era (7 of 7) for time window 366 and…
#> Formatting result
#> 414 estimates dropped as frequency less than 1%
#> ✔ Summarising large scale characteristics
#> `cohort_sample` and `matched_sample` casted to character.
#> [2026-04-10 19:04:10] - Population diagnosics - denominator cohort
#> [2026-04-10 19:04:10] - Population diagnosics - sampling person table to1e+05
#> ℹ Creating denominator cohorts
#> ✔ Cohorts created in 0 min and 5 sec
#> [2026-04-10 19:04:16] - Population diagnosics - incidence
#> ℹ Getting incidence for analysis 1 of 7
#> ℹ Getting incidence for analysis 2 of 7
#> ℹ Getting incidence for analysis 3 of 7
#> ℹ Getting incidence for analysis 4 of 7
#> ℹ Getting incidence for analysis 5 of 7
#> ℹ Getting incidence for analysis 6 of 7
#> ℹ Getting incidence for analysis 7 of 7
#> ✔ Overall time taken: 0 mins and 9 secs
#> [2026-04-10 19:04:26] - Population diagnosics - prevalence
#> ℹ Getting prevalence for analysis 1 of 7
#> ℹ Getting prevalence for analysis 2 of 7
#> ℹ Getting prevalence for analysis 3 of 7
#> ℹ Getting prevalence for analysis 4 of 7
#> ℹ Getting prevalence for analysis 5 of 7
#> ℹ Getting prevalence for analysis 6 of 7
#> ℹ Getting prevalence for analysis 7 of 7
#> ✔ Time taken: 0 mins and 6 secs
#> `populationDateStart`, `populationDateEnd`, and `populationSample` casted to
#> character.
#> `populationDateStart` and `populationDateEnd` eliminated from settings as all
#> elements are NA.
#> [2026-04-10 19:04:33] - Phenotype diagnostics - exporting results
#> [2026-04-10 19:04:33] - Exporting log file
# Notice that the previous line of code will give the same results as typing manually
# all the default values:
result <- phenotypeDiagnostics(cdm$warfarin,
databaseDiagnostics = list(
"diagnostics" = c("snapshot", "personTableSummary",
"observationPeriodsSummary", "clinicalRecordsSummary")
),
codelistDiagnostics = list(
"diagnostics" = c("achillesCodeUse", "orphanCodeUse",
"cohortCodeUse", "drugDiagnostics",
"measurementDiagnostics"),
"measurementDiagnosticsSample" = 20000,
"drugDiagnosticsSample" = 20000
),
cohortDiagnostics = list(
"diagnostics" = c("cohortCount", "cohortCharacteristics",
"largeScaleCharacteristics",
"compareCohorts"),
"cohortSample" = 20000,
"matchedSample" = 1000
),
populationDiagnostics = list(
"diagnostics" = c("incidence", "periodPrevalence"),
"populationSample" = 100000,
"populationDateRange" = as.Date(c(NA,NA))
))
#> ℹ Creating log file:
#> /tmp/Rtmpm5Ep3e/phenotypeDiagnostics_log_2026_04_10_19_04_331c8b56d8ea6e.txt.
#> [2026-04-10 19:04:33] - Log file created
#> [2026-04-10 19:04:33] - Database diagnostics - getting CDM Snapshot
#> [2026-04-10 19:04:34] - Database diagnostics - summarising person table
#> ℹ The following estimates will be calculated:
#> • date_of_birth: density
#> ! Table is collected to memory as not all requested estimates are supported on
#> the database side
#> → Start summary of data, at 2026-04-10 19:04:38.074583
#> ✔ Summary finished, at 2026-04-10 19:04:38.130666
#> [2026-04-10 19:04:38] - Database diagnostics - summarising observation period
#> ℹ retrieving cdm object from cdm_table.
#> Warning: ! There are 2649 individuals not included in the person table.
#> ℹ The following estimates will be calculated:
#> • observation_period_start_date: density
#> • observation_period_end_date: density
#> ! Table is collected to memory as not all requested estimates are supported on
#> the database side
#> → Start summary of data, at 2026-04-10 19:04:41.399578
#> ✔ Summary finished, at 2026-04-10 19:04:41.473233
#> [2026-04-10 19:04:42] - Database diagnostics - summarising clinical tables -
#> summary
#> ℹ Adding variables of interest to drug_exposure.
#> ℹ Summarising records per person in drug_exposure.
#> ℹ Summarising subjects not in person table in drug_exposure.
#> ℹ Summarising records in observation in drug_exposure.
#> ℹ Summarising records with start before birth date in drug_exposure.
#> ℹ Summarising records with end date before start date in drug_exposure.
#> ℹ Summarising domains in drug_exposure.
#> ℹ Summarising standard concepts in drug_exposure.
#> ℹ Summarising source vocabularies in drug_exposure.
#> ℹ Summarising concept types in drug_exposure.
#> ℹ Summarising concept class in drug_exposure.
#> ℹ Summarising missing data in drug_exposure.
#> [2026-04-10 19:04:45] - Database diagnostics - summarising clinical tables -
#> trends
#> [2026-04-10 19:04:46] - Codelist diagnostics - index event breakdown
#> Getting counts of warfarin codes for cohort warfarin
#> [2026-04-10 19:04:48] - Codelist diagnostics - drug diagnostics
#> Returning entry cohort as the size of the cohorts to be sampled is equal or
#> smaller than `n`.
#> ℹ The following estimates will be calculated:
#> • exposure_duration: min, q01, q05, q25, median, q75, q95, q99, max,
#> percentage_missing
#> • quantity: min, q01, q05, q25, median, q75, q95, q99, max, percentage_missing
#> ! Table is collected to memory as not all requested estimates are supported on
#> the database side
#> → Start summary of data, at 2026-04-10 19:04:49.985036
#> ✔ Summary finished, at 2026-04-10 19:04:50.962688
#> ℹ The following estimates will be calculated:
#> • days_to_next_record: min, q01, q05, q25, median, q75, q95, q99, max,
#> percentage_missing
#> ! Table is collected to memory as not all requested estimates are supported on
#> the database side
#> → Start summary of data, at 2026-04-10 19:04:51.594242
#> ✔ Summary finished, at 2026-04-10 19:04:51.75057
#> ! No common ingredient found for codelist: `warfarin`.
#> ℹ Change ingredient threshold with options(PhenotypeR_ingredient_threshold),
#> threshold = 0.8.
#> Warning: The CDM reference containing the cohort must also contain achilles tables.
#> Returning only index event breakdown.
#> [2026-04-10 19:04:55] - Cohort diagnostics - cohort attrition
#> [2026-04-10 19:04:55] - Cohort diagnostics - cohort count
#> ℹ summarising data
#> ℹ summarising cohort warfarin
#> ✔ summariseCharacteristics finished!
#> → Skipping cohort sampling as all cohorts have less than 20000 individuals.
#> [2026-04-10 19:04:56] - Cohort diagnostics - matched cohorts
#> → Sampling cohort `tmp_056_sampled`
#> Returning entry cohort as the size of the cohorts to be sampled is equal or
#> smaller than `n`.
#> • Generating an age and sex matched cohort for warfarin
#> Starting matching
#> ℹ Creating copy of target cohort.
#> • 1 cohort to be matched.
#> ℹ Creating controls cohorts.
#> ℹ Excluding cases from controls
#> • Matching by gender_concept_id and year_of_birth
#> • Removing controls that were not in observation at index date
#> • Excluding target records whose pair is not in observation
#> • Adjusting ratio
#> Binding cohorts
#> ✔ Done
#> → Getting cohorts and indexes
#> [2026-04-10 19:05:07] - Cohort diagnostics - cohort characteristics
#> ℹ adding demographics columns
#> ℹ adding tableIntersectCount 1/1
#> window names casted to snake_case:
#> • `-365 to -1` -> `365_to_1`
#> ℹ summarising data
#> ℹ summarising cohort warfarin
#> ℹ summarising cohort warfarin_sampled
#> ℹ summarising cohort warfarin_matched
#> ✔ summariseCharacteristics finished!
#> [2026-04-10 19:05:12] - Cohort diagnostics - age density
#> ℹ The following estimates will be calculated:
#> • age: density
#> ! Table is collected to memory as not all requested estimates are supported on
#> the database side
#> → Start summary of data, at 2026-04-10 19:05:13.187456
#> ✔ Summary finished, at 2026-04-10 19:05:13.311514
#> [2026-04-10 19:05:13] - Cohort diagnostics - large scale characteristics
#> ℹ Summarising large scale characteristics
#> - getting characteristics from table condition_occurrence (1 of 7)
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table visit_occurrence (2 of 7)
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table measurement (3 of 7)
#> - getting characteristics from table measurement (3 of 7) for time window -Inf…
#> - getting characteristics from table measurement (3 of 7) for time window -365…
#> - getting characteristics from table measurement (3 of 7) for time window -30 …
#> - getting characteristics from table measurement (3 of 7) for time window 0 an…
#> - getting characteristics from table measurement (3 of 7) for time window 1 an…
#> - getting characteristics from table measurement (3 of 7) for time window 31 a…
#> - getting characteristics from table measurement (3 of 7) for time window 366 …
#> - getting characteristics from table procedure_occurrence (4 of 7)
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table observation (5 of 7)
#> - getting characteristics from table observation (5 of 7) for time window -Inf…
#> - getting characteristics from table observation (5 of 7) for time window -365…
#> - getting characteristics from table observation (5 of 7) for time window -30 …
#> - getting characteristics from table observation (5 of 7) for time window 0 an…
#> - getting characteristics from table observation (5 of 7) for time window 1 an…
#> - getting characteristics from table observation (5 of 7) for time window 31 a…
#> - getting characteristics from table observation (5 of 7) for time window 366 …
#> - getting characteristics from table drug_exposure (6 of 7)
#> - getting characteristics from table drug_exposure (6 of 7) for time window -I…
#> - getting characteristics from table drug_exposure (6 of 7) for time window -3…
#> - getting characteristics from table drug_exposure (6 of 7) for time window -3…
#> - getting characteristics from table drug_exposure (6 of 7) for time window 0 …
#> - getting characteristics from table drug_exposure (6 of 7) for time window 1 …
#> - getting characteristics from table drug_exposure (6 of 7) for time window 31…
#> - getting characteristics from table drug_exposure (6 of 7) for time window 36…
#> - getting characteristics from table drug_era (7 of 7)
#> - getting characteristics from table drug_era (7 of 7) for time window -Inf an…
#> - getting characteristics from table drug_era (7 of 7) for time window -365 an…
#> - getting characteristics from table drug_era (7 of 7) for time window -30 and…
#> - getting characteristics from table drug_era (7 of 7) for time window 0 and 0
#> - getting characteristics from table drug_era (7 of 7) for time window 1 and 30
#> - getting characteristics from table drug_era (7 of 7) for time window 31 and …
#> - getting characteristics from table drug_era (7 of 7) for time window 366 and…
#> Formatting result
#> 428 estimates dropped as frequency less than 1%
#> ✔ Summarising large scale characteristics
#> ℹ Summarising large scale characteristics
#> - getting characteristics from table condition_occurrence (1 of 7)
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table visit_occurrence (2 of 7)
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table measurement (3 of 7)
#> - getting characteristics from table measurement (3 of 7) for time window -Inf…
#> - getting characteristics from table measurement (3 of 7) for time window -365…
#> - getting characteristics from table measurement (3 of 7) for time window -30 …
#> - getting characteristics from table measurement (3 of 7) for time window 0 an…
#> - getting characteristics from table measurement (3 of 7) for time window 1 an…
#> - getting characteristics from table measurement (3 of 7) for time window 31 a…
#> - getting characteristics from table measurement (3 of 7) for time window 366 …
#> - getting characteristics from table procedure_occurrence (4 of 7)
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table observation (5 of 7)
#> - getting characteristics from table observation (5 of 7) for time window -Inf…
#> - getting characteristics from table observation (5 of 7) for time window -365…
#> - getting characteristics from table observation (5 of 7) for time window -30 …
#> - getting characteristics from table observation (5 of 7) for time window 0 an…
#> - getting characteristics from table observation (5 of 7) for time window 1 an…
#> - getting characteristics from table observation (5 of 7) for time window 31 a…
#> - getting characteristics from table observation (5 of 7) for time window 366 …
#> - getting characteristics from table drug_exposure (6 of 7)
#> - getting characteristics from table drug_exposure (6 of 7) for time window -I…
#> - getting characteristics from table drug_exposure (6 of 7) for time window -3…
#> - getting characteristics from table drug_exposure (6 of 7) for time window -3…
#> - getting characteristics from table drug_exposure (6 of 7) for time window 0 …
#> - getting characteristics from table drug_exposure (6 of 7) for time window 1 …
#> - getting characteristics from table drug_exposure (6 of 7) for time window 31…
#> - getting characteristics from table drug_exposure (6 of 7) for time window 36…
#> - getting characteristics from table drug_era (7 of 7)
#> - getting characteristics from table drug_era (7 of 7) for time window -Inf an…
#> - getting characteristics from table drug_era (7 of 7) for time window -365 an…
#> - getting characteristics from table drug_era (7 of 7) for time window -30 and…
#> - getting characteristics from table drug_era (7 of 7) for time window 0 and 0
#> - getting characteristics from table drug_era (7 of 7) for time window 1 and 30
#> - getting characteristics from table drug_era (7 of 7) for time window 31 and …
#> - getting characteristics from table drug_era (7 of 7) for time window 366 and…
#> Formatting result
#> 428 estimates dropped as frequency less than 1%
#> ✔ Summarising large scale characteristics
#> `cohort_sample` and `matched_sample` casted to character.
#> [2026-04-10 19:06:13] - Population diagnosics - denominator cohort
#> [2026-04-10 19:06:13] - Population diagnosics - sampling person table to1e+05
#> ℹ Creating denominator cohorts
#> ✔ Cohorts created in 0 min and 5 sec
#> [2026-04-10 19:06:19] - Population diagnosics - incidence
#> ℹ Getting incidence for analysis 1 of 7
#> ℹ Getting incidence for analysis 2 of 7
#> ℹ Getting incidence for analysis 3 of 7
#> ℹ Getting incidence for analysis 4 of 7
#> ℹ Getting incidence for analysis 5 of 7
#> ℹ Getting incidence for analysis 6 of 7
#> ℹ Getting incidence for analysis 7 of 7
#> ✔ Overall time taken: 0 mins and 10 secs
#> [2026-04-10 19:06:29] - Population diagnosics - prevalence
#> ℹ Getting prevalence for analysis 1 of 7
#> ℹ Getting prevalence for analysis 2 of 7
#> ℹ Getting prevalence for analysis 3 of 7
#> ℹ Getting prevalence for analysis 4 of 7
#> ℹ Getting prevalence for analysis 5 of 7
#> ℹ Getting prevalence for analysis 6 of 7
#> ℹ Getting prevalence for analysis 7 of 7
#> ✔ Time taken: 0 mins and 6 secs
#> `populationDateStart`, `populationDateEnd`, and `populationSample` casted to
#> character.
#> `populationDateStart` and `populationDateEnd` eliminated from settings as all
#> elements are NA.
#> [2026-04-10 19:06:36] - Phenotype diagnostics - exporting results
#> [2026-04-10 19:06:36] - Exporting log file
# By default, cohortSurvival analysis will not be run. If you want to run it, please use:
result <- phenotypeDiagnostics(cdm$warfarin,
cohortDiagnostics = list(
"diagnostics" = c("cohortCount", "cohortCharacteristics",
"largeScaleCharacteristics",
"compareCohorts", "cohortSurvival")))
#> ℹ Creating log file:
#> /tmp/Rtmpm5Ep3e/phenotypeDiagnostics_log_2026_04_10_19_06_371c8b3cd560e1.txt.
#> [2026-04-10 19:06:37] - Log file created
#> [2026-04-10 19:06:37] - Database diagnostics - getting CDM Snapshot
#> [2026-04-10 19:06:37] - Database diagnostics - summarising person table
#> ℹ The following estimates will be calculated:
#> • date_of_birth: density
#> ! Table is collected to memory as not all requested estimates are supported on
#> the database side
#> → Start summary of data, at 2026-04-10 19:06:41.603456
#> ✔ Summary finished, at 2026-04-10 19:06:41.660113
#> [2026-04-10 19:06:41] - Database diagnostics - summarising observation period
#> ℹ retrieving cdm object from cdm_table.
#> Warning: ! There are 2649 individuals not included in the person table.
#> ℹ The following estimates will be calculated:
#> • observation_period_start_date: density
#> • observation_period_end_date: density
#> ! Table is collected to memory as not all requested estimates are supported on
#> the database side
#> → Start summary of data, at 2026-04-10 19:06:44.970249
#> ✔ Summary finished, at 2026-04-10 19:06:45.043561
#> [2026-04-10 19:06:45] - Database diagnostics - summarising clinical tables -
#> summary
#> ℹ Adding variables of interest to drug_exposure.
#> ℹ Summarising records per person in drug_exposure.
#> ℹ Summarising subjects not in person table in drug_exposure.
#> ℹ Summarising records in observation in drug_exposure.
#> ℹ Summarising records with start before birth date in drug_exposure.
#> ℹ Summarising records with end date before start date in drug_exposure.
#> ℹ Summarising domains in drug_exposure.
#> ℹ Summarising standard concepts in drug_exposure.
#> ℹ Summarising source vocabularies in drug_exposure.
#> ℹ Summarising concept types in drug_exposure.
#> ℹ Summarising concept class in drug_exposure.
#> ℹ Summarising missing data in drug_exposure.
#> [2026-04-10 19:06:49] - Database diagnostics - summarising clinical tables -
#> trends
#> [2026-04-10 19:06:50] - Codelist diagnostics - index event breakdown
#> Getting counts of warfarin codes for cohort warfarin
#> [2026-04-10 19:06:51] - Codelist diagnostics - drug diagnostics
#> Returning entry cohort as the size of the cohorts to be sampled is equal or
#> smaller than `n`.
#> ℹ The following estimates will be calculated:
#> • exposure_duration: min, q01, q05, q25, median, q75, q95, q99, max,
#> percentage_missing
#> • quantity: min, q01, q05, q25, median, q75, q95, q99, max, percentage_missing
#> ! Table is collected to memory as not all requested estimates are supported on
#> the database side
#> → Start summary of data, at 2026-04-10 19:06:53.705665
#> ✔ Summary finished, at 2026-04-10 19:06:54.540359
#> ℹ The following estimates will be calculated:
#> • days_to_next_record: min, q01, q05, q25, median, q75, q95, q99, max,
#> percentage_missing
#> ! Table is collected to memory as not all requested estimates are supported on
#> the database side
#> → Start summary of data, at 2026-04-10 19:06:55.186971
#> ✔ Summary finished, at 2026-04-10 19:06:55.344897
#> ! No common ingredient found for codelist: `warfarin`.
#> ℹ Change ingredient threshold with options(PhenotypeR_ingredient_threshold),
#> threshold = 0.8.
#> Warning: The CDM reference containing the cohort must also contain achilles tables.
#> Returning only index event breakdown.
#> [2026-04-10 19:06:59] - Cohort diagnostics - cohort attrition
#> [2026-04-10 19:06:59] - Cohort diagnostics - cohort count
#> ℹ summarising data
#> ℹ summarising cohort warfarin
#> ✔ summariseCharacteristics finished!
#> → Skipping cohort sampling as all cohorts have less than 20000 individuals.
#> [2026-04-10 19:07:00] - Cohort diagnostics - matched cohorts
#> → Sampling cohort `tmp_076_sampled`
#> Returning entry cohort as the size of the cohorts to be sampled is equal or
#> smaller than `n`.
#> • Generating an age and sex matched cohort for warfarin
#> Starting matching
#> ℹ Creating copy of target cohort.
#> • 1 cohort to be matched.
#> ℹ Creating controls cohorts.
#> ℹ Excluding cases from controls
#> • Matching by gender_concept_id and year_of_birth
#> • Removing controls that were not in observation at index date
#> • Excluding target records whose pair is not in observation
#> • Adjusting ratio
#> Binding cohorts
#> ✔ Done
#> → Getting cohorts and indexes
#> [2026-04-10 19:07:11] - Cohort diagnostics - cohort characteristics
#> ℹ adding demographics columns
#> ℹ adding tableIntersectCount 1/1
#> window names casted to snake_case:
#> • `-365 to -1` -> `365_to_1`
#> ℹ summarising data
#> ℹ summarising cohort warfarin
#> ℹ summarising cohort warfarin_sampled
#> ℹ summarising cohort warfarin_matched
#> ✔ summariseCharacteristics finished!
#> [2026-04-10 19:07:16] - Cohort diagnostics - age density
#> ℹ The following estimates will be calculated:
#> • age: density
#> ! Table is collected to memory as not all requested estimates are supported on
#> the database side
#> → Start summary of data, at 2026-04-10 19:07:16.977124
#> ✔ Summary finished, at 2026-04-10 19:07:17.105173
#> [2026-04-10 19:07:17] - Cohort diagnostics - large scale characteristics
#> ℹ Summarising large scale characteristics
#> - getting characteristics from table condition_occurrence (1 of 7)
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table visit_occurrence (2 of 7)
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table measurement (3 of 7)
#> - getting characteristics from table measurement (3 of 7) for time window -Inf…
#> - getting characteristics from table measurement (3 of 7) for time window -365…
#> - getting characteristics from table measurement (3 of 7) for time window -30 …
#> - getting characteristics from table measurement (3 of 7) for time window 0 an…
#> - getting characteristics from table measurement (3 of 7) for time window 1 an…
#> - getting characteristics from table measurement (3 of 7) for time window 31 a…
#> - getting characteristics from table measurement (3 of 7) for time window 366 …
#> - getting characteristics from table procedure_occurrence (4 of 7)
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table observation (5 of 7)
#> - getting characteristics from table observation (5 of 7) for time window -Inf…
#> - getting characteristics from table observation (5 of 7) for time window -365…
#> - getting characteristics from table observation (5 of 7) for time window -30 …
#> - getting characteristics from table observation (5 of 7) for time window 0 an…
#> - getting characteristics from table observation (5 of 7) for time window 1 an…
#> - getting characteristics from table observation (5 of 7) for time window 31 a…
#> - getting characteristics from table observation (5 of 7) for time window 366 …
#> - getting characteristics from table drug_exposure (6 of 7)
#> - getting characteristics from table drug_exposure (6 of 7) for time window -I…
#> - getting characteristics from table drug_exposure (6 of 7) for time window -3…
#> - getting characteristics from table drug_exposure (6 of 7) for time window -3…
#> - getting characteristics from table drug_exposure (6 of 7) for time window 0 …
#> - getting characteristics from table drug_exposure (6 of 7) for time window 1 …
#> - getting characteristics from table drug_exposure (6 of 7) for time window 31…
#> - getting characteristics from table drug_exposure (6 of 7) for time window 36…
#> - getting characteristics from table drug_era (7 of 7)
#> - getting characteristics from table drug_era (7 of 7) for time window -Inf an…
#> - getting characteristics from table drug_era (7 of 7) for time window -365 an…
#> - getting characteristics from table drug_era (7 of 7) for time window -30 and…
#> - getting characteristics from table drug_era (7 of 7) for time window 0 and 0
#> - getting characteristics from table drug_era (7 of 7) for time window 1 and 30
#> - getting characteristics from table drug_era (7 of 7) for time window 31 and …
#> - getting characteristics from table drug_era (7 of 7) for time window 366 and…
#> Formatting result
#> 466 estimates dropped as frequency less than 1%
#> ✔ Summarising large scale characteristics
#> ℹ Summarising large scale characteristics
#> - getting characteristics from table condition_occurrence (1 of 7)
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table visit_occurrence (2 of 7)
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table measurement (3 of 7)
#> - getting characteristics from table measurement (3 of 7) for time window -Inf…
#> - getting characteristics from table measurement (3 of 7) for time window -365…
#> - getting characteristics from table measurement (3 of 7) for time window -30 …
#> - getting characteristics from table measurement (3 of 7) for time window 0 an…
#> - getting characteristics from table measurement (3 of 7) for time window 1 an…
#> - getting characteristics from table measurement (3 of 7) for time window 31 a…
#> - getting characteristics from table measurement (3 of 7) for time window 366 …
#> - getting characteristics from table procedure_occurrence (4 of 7)
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table observation (5 of 7)
#> - getting characteristics from table observation (5 of 7) for time window -Inf…
#> - getting characteristics from table observation (5 of 7) for time window -365…
#> - getting characteristics from table observation (5 of 7) for time window -30 …
#> - getting characteristics from table observation (5 of 7) for time window 0 an…
#> - getting characteristics from table observation (5 of 7) for time window 1 an…
#> - getting characteristics from table observation (5 of 7) for time window 31 a…
#> - getting characteristics from table observation (5 of 7) for time window 366 …
#> - getting characteristics from table drug_exposure (6 of 7)
#> - getting characteristics from table drug_exposure (6 of 7) for time window -I…
#> - getting characteristics from table drug_exposure (6 of 7) for time window -3…
#> - getting characteristics from table drug_exposure (6 of 7) for time window -3…
#> - getting characteristics from table drug_exposure (6 of 7) for time window 0 …
#> - getting characteristics from table drug_exposure (6 of 7) for time window 1 …
#> - getting characteristics from table drug_exposure (6 of 7) for time window 31…
#> - getting characteristics from table drug_exposure (6 of 7) for time window 36…
#> - getting characteristics from table drug_era (7 of 7)
#> - getting characteristics from table drug_era (7 of 7) for time window -Inf an…
#> - getting characteristics from table drug_era (7 of 7) for time window -365 an…
#> - getting characteristics from table drug_era (7 of 7) for time window -30 and…
#> - getting characteristics from table drug_era (7 of 7) for time window 0 and 0
#> - getting characteristics from table drug_era (7 of 7) for time window 1 and 30
#> - getting characteristics from table drug_era (7 of 7) for time window 31 and …
#> - getting characteristics from table drug_era (7 of 7) for time window 366 and…
#> Formatting result
#> 466 estimates dropped as frequency less than 1%
#> ✔ Summarising large scale characteristics
#> [2026-04-10 19:08:16] - Cohort diagnostics - death cohorts
#> Warning: Death table is empty. Skipping survival analysis
#> `cohort_sample` and `matched_sample` casted to character.
#> [2026-04-10 19:08:16] - Population diagnosics - denominator cohort
#> [2026-04-10 19:08:16] - Population diagnosics - sampling person table to1e+05
#> ℹ Creating denominator cohorts
#> ✔ Cohorts created in 0 min and 5 sec
#> [2026-04-10 19:08:22] - Population diagnosics - incidence
#> ℹ Getting incidence for analysis 1 of 7
#> ℹ Getting incidence for analysis 2 of 7
#> ℹ Getting incidence for analysis 3 of 7
#> ℹ Getting incidence for analysis 4 of 7
#> ℹ Getting incidence for analysis 5 of 7
#> ℹ Getting incidence for analysis 6 of 7
#> ℹ Getting incidence for analysis 7 of 7
#> ✔ Overall time taken: 0 mins and 9 secs
#> [2026-04-10 19:08:32] - Population diagnosics - prevalence
#> ℹ Getting prevalence for analysis 1 of 7
#> ℹ Getting prevalence for analysis 2 of 7
#> ℹ Getting prevalence for analysis 3 of 7
#> ℹ Getting prevalence for analysis 4 of 7
#> ℹ Getting prevalence for analysis 5 of 7
#> ℹ Getting prevalence for analysis 6 of 7
#> ℹ Getting prevalence for analysis 7 of 7
#> ✔ Time taken: 0 mins and 6 secs
#> `populationDateStart`, `populationDateEnd`, and `populationSample` casted to
#> character.
#> `populationDateStart` and `populationDateEnd` eliminated from settings as all
#> elements are NA.
#> [2026-04-10 19:08:38] - Phenotype diagnostics - exporting results
#> [2026-04-10 19:08:38] - Exporting log file
# Run PhenotypeR with the default values, except for populationSample:
result <- phenotypeDiagnostics(cdm$warfarin,
populationDiagnostics = list("populationSample" = 1000))
#> ℹ Creating log file:
#> /tmp/Rtmpm5Ep3e/phenotypeDiagnostics_log_2026_04_10_19_08_391c8b6772c87e.txt.
#> [2026-04-10 19:08:39] - Log file created
#> [2026-04-10 19:08:39] - Database diagnostics - getting CDM Snapshot
#> [2026-04-10 19:08:39] - Database diagnostics - summarising person table
#> ℹ The following estimates will be calculated:
#> • date_of_birth: density
#> ! Table is collected to memory as not all requested estimates are supported on
#> the database side
#> → Start summary of data, at 2026-04-10 19:08:43.487386
#> ✔ Summary finished, at 2026-04-10 19:08:43.545767
#> [2026-04-10 19:08:43] - Database diagnostics - summarising observation period
#> ℹ retrieving cdm object from cdm_table.
#> Warning: ! There are 2649 individuals not included in the person table.
#> ℹ The following estimates will be calculated:
#> • observation_period_start_date: density
#> • observation_period_end_date: density
#> ! Table is collected to memory as not all requested estimates are supported on
#> the database side
#> → Start summary of data, at 2026-04-10 19:08:46.876185
#> ✔ Summary finished, at 2026-04-10 19:08:46.939251
#> [2026-04-10 19:08:47] - Database diagnostics - summarising clinical tables -
#> summary
#> ℹ Adding variables of interest to drug_exposure.
#> ℹ Summarising records per person in drug_exposure.
#> ℹ Summarising subjects not in person table in drug_exposure.
#> ℹ Summarising records in observation in drug_exposure.
#> ℹ Summarising records with start before birth date in drug_exposure.
#> ℹ Summarising records with end date before start date in drug_exposure.
#> ℹ Summarising domains in drug_exposure.
#> ℹ Summarising standard concepts in drug_exposure.
#> ℹ Summarising source vocabularies in drug_exposure.
#> ℹ Summarising concept types in drug_exposure.
#> ℹ Summarising concept class in drug_exposure.
#> ℹ Summarising missing data in drug_exposure.
#> [2026-04-10 19:08:51] - Database diagnostics - summarising clinical tables -
#> trends
#> [2026-04-10 19:08:52] - Codelist diagnostics - index event breakdown
#> Getting counts of warfarin codes for cohort warfarin
#> [2026-04-10 19:08:53] - Codelist diagnostics - drug diagnostics
#> Returning entry cohort as the size of the cohorts to be sampled is equal or
#> smaller than `n`.
#> ℹ The following estimates will be calculated:
#> • exposure_duration: min, q01, q05, q25, median, q75, q95, q99, max,
#> percentage_missing
#> • quantity: min, q01, q05, q25, median, q75, q95, q99, max, percentage_missing
#> ! Table is collected to memory as not all requested estimates are supported on
#> the database side
#> → Start summary of data, at 2026-04-10 19:08:55.274292
#> ✔ Summary finished, at 2026-04-10 19:08:56.098895
#> ℹ The following estimates will be calculated:
#> • days_to_next_record: min, q01, q05, q25, median, q75, q95, q99, max,
#> percentage_missing
#> ! Table is collected to memory as not all requested estimates are supported on
#> the database side
#> → Start summary of data, at 2026-04-10 19:08:56.749305
#> ✔ Summary finished, at 2026-04-10 19:08:56.910731
#> ! No common ingredient found for codelist: `warfarin`.
#> ℹ Change ingredient threshold with options(PhenotypeR_ingredient_threshold),
#> threshold = 0.8.
#> Warning: The CDM reference containing the cohort must also contain achilles tables.
#> Returning only index event breakdown.
#> [2026-04-10 19:09:00] - Cohort diagnostics - cohort attrition
#> [2026-04-10 19:09:00] - Cohort diagnostics - cohort count
#> ℹ summarising data
#> ℹ summarising cohort warfarin
#> ✔ summariseCharacteristics finished!
#> → Skipping cohort sampling as all cohorts have less than 20000 individuals.
#> [2026-04-10 19:09:01] - Cohort diagnostics - matched cohorts
#> → Sampling cohort `tmp_096_sampled`
#> Returning entry cohort as the size of the cohorts to be sampled is equal or
#> smaller than `n`.
#> • Generating an age and sex matched cohort for warfarin
#> Starting matching
#> ℹ Creating copy of target cohort.
#> • 1 cohort to be matched.
#> ℹ Creating controls cohorts.
#> ℹ Excluding cases from controls
#> • Matching by gender_concept_id and year_of_birth
#> • Removing controls that were not in observation at index date
#> • Excluding target records whose pair is not in observation
#> • Adjusting ratio
#> Binding cohorts
#> ✔ Done
#> → Getting cohorts and indexes
#> [2026-04-10 19:09:12] - Cohort diagnostics - cohort characteristics
#> ℹ adding demographics columns
#> ℹ adding tableIntersectCount 1/1
#> window names casted to snake_case:
#> • `-365 to -1` -> `365_to_1`
#> ℹ summarising data
#> ℹ summarising cohort warfarin
#> ℹ summarising cohort warfarin_sampled
#> ℹ summarising cohort warfarin_matched
#> ✔ summariseCharacteristics finished!
#> [2026-04-10 19:09:17] - Cohort diagnostics - age density
#> ℹ The following estimates will be calculated:
#> • age: density
#> ! Table is collected to memory as not all requested estimates are supported on
#> the database side
#> → Start summary of data, at 2026-04-10 19:09:18.102098
#> ✔ Summary finished, at 2026-04-10 19:09:18.228916
#> [2026-04-10 19:09:18] - Cohort diagnostics - large scale characteristics
#> ℹ Summarising large scale characteristics
#> - getting characteristics from table condition_occurrence (1 of 7)
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table visit_occurrence (2 of 7)
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table measurement (3 of 7)
#> - getting characteristics from table measurement (3 of 7) for time window -Inf…
#> - getting characteristics from table measurement (3 of 7) for time window -365…
#> - getting characteristics from table measurement (3 of 7) for time window -30 …
#> - getting characteristics from table measurement (3 of 7) for time window 0 an…
#> - getting characteristics from table measurement (3 of 7) for time window 1 an…
#> - getting characteristics from table measurement (3 of 7) for time window 31 a…
#> - getting characteristics from table measurement (3 of 7) for time window 366 …
#> - getting characteristics from table procedure_occurrence (4 of 7)
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table observation (5 of 7)
#> - getting characteristics from table observation (5 of 7) for time window -Inf…
#> - getting characteristics from table observation (5 of 7) for time window -365…
#> - getting characteristics from table observation (5 of 7) for time window -30 …
#> - getting characteristics from table observation (5 of 7) for time window 0 an…
#> - getting characteristics from table observation (5 of 7) for time window 1 an…
#> - getting characteristics from table observation (5 of 7) for time window 31 a…
#> - getting characteristics from table observation (5 of 7) for time window 366 …
#> - getting characteristics from table drug_exposure (6 of 7)
#> - getting characteristics from table drug_exposure (6 of 7) for time window -I…
#> - getting characteristics from table drug_exposure (6 of 7) for time window -3…
#> - getting characteristics from table drug_exposure (6 of 7) for time window -3…
#> - getting characteristics from table drug_exposure (6 of 7) for time window 0 …
#> - getting characteristics from table drug_exposure (6 of 7) for time window 1 …
#> - getting characteristics from table drug_exposure (6 of 7) for time window 31…
#> - getting characteristics from table drug_exposure (6 of 7) for time window 36…
#> - getting characteristics from table drug_era (7 of 7)
#> - getting characteristics from table drug_era (7 of 7) for time window -Inf an…
#> - getting characteristics from table drug_era (7 of 7) for time window -365 an…
#> - getting characteristics from table drug_era (7 of 7) for time window -30 and…
#> - getting characteristics from table drug_era (7 of 7) for time window 0 and 0
#> - getting characteristics from table drug_era (7 of 7) for time window 1 and 30
#> - getting characteristics from table drug_era (7 of 7) for time window 31 and …
#> - getting characteristics from table drug_era (7 of 7) for time window 366 and…
#> Formatting result
#> 464 estimates dropped as frequency less than 1%
#> ✔ Summarising large scale characteristics
#> ℹ Summarising large scale characteristics
#> - getting characteristics from table condition_occurrence (1 of 7)
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table condition_occurrence (1 of 7) for time wi…
#> - getting characteristics from table visit_occurrence (2 of 7)
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table visit_occurrence (2 of 7) for time window…
#> - getting characteristics from table measurement (3 of 7)
#> - getting characteristics from table measurement (3 of 7) for time window -Inf…
#> - getting characteristics from table measurement (3 of 7) for time window -365…
#> - getting characteristics from table measurement (3 of 7) for time window -30 …
#> - getting characteristics from table measurement (3 of 7) for time window 0 an…
#> - getting characteristics from table measurement (3 of 7) for time window 1 an…
#> - getting characteristics from table measurement (3 of 7) for time window 31 a…
#> - getting characteristics from table measurement (3 of 7) for time window 366 …
#> - getting characteristics from table procedure_occurrence (4 of 7)
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table procedure_occurrence (4 of 7) for time wi…
#> - getting characteristics from table observation (5 of 7)
#> - getting characteristics from table observation (5 of 7) for time window -Inf…
#> - getting characteristics from table observation (5 of 7) for time window -365…
#> - getting characteristics from table observation (5 of 7) for time window -30 …
#> - getting characteristics from table observation (5 of 7) for time window 0 an…
#> - getting characteristics from table observation (5 of 7) for time window 1 an…
#> - getting characteristics from table observation (5 of 7) for time window 31 a…
#> - getting characteristics from table observation (5 of 7) for time window 366 …
#> - getting characteristics from table drug_exposure (6 of 7)
#> - getting characteristics from table drug_exposure (6 of 7) for time window -I…
#> - getting characteristics from table drug_exposure (6 of 7) for time window -3…
#> - getting characteristics from table drug_exposure (6 of 7) for time window -3…
#> - getting characteristics from table drug_exposure (6 of 7) for time window 0 …
#> - getting characteristics from table drug_exposure (6 of 7) for time window 1 …
#> - getting characteristics from table drug_exposure (6 of 7) for time window 31…
#> - getting characteristics from table drug_exposure (6 of 7) for time window 36…
#> - getting characteristics from table drug_era (7 of 7)
#> - getting characteristics from table drug_era (7 of 7) for time window -Inf an…
#> - getting characteristics from table drug_era (7 of 7) for time window -365 an…
#> - getting characteristics from table drug_era (7 of 7) for time window -30 and…
#> - getting characteristics from table drug_era (7 of 7) for time window 0 and 0
#> - getting characteristics from table drug_era (7 of 7) for time window 1 and 30
#> - getting characteristics from table drug_era (7 of 7) for time window 31 and …
#> - getting characteristics from table drug_era (7 of 7) for time window 366 and…
#> Formatting result
#> 464 estimates dropped as frequency less than 1%
#> ✔ Summarising large scale characteristics
#> `cohort_sample` and `matched_sample` casted to character.
#> [2026-04-10 19:10:17] - Population diagnosics - denominator cohort
#> [2026-04-10 19:10:17] - Population diagnosics - sampling person table to1000
#> ℹ Creating denominator cohorts
#> ✔ Cohorts created in 0 min and 5 sec
#> [2026-04-10 19:10:22] - Population diagnosics - incidence
#> ℹ Getting incidence for analysis 1 of 7
#> ℹ Getting incidence for analysis 2 of 7
#> ℹ Getting incidence for analysis 3 of 7
#> ℹ Getting incidence for analysis 4 of 7
#> ℹ Getting incidence for analysis 5 of 7
#> ℹ Getting incidence for analysis 6 of 7
#> ℹ Getting incidence for analysis 7 of 7
#> ✔ Overall time taken: 0 mins and 9 secs
#> [2026-04-10 19:10:32] - Population diagnosics - prevalence
#> ℹ Getting prevalence for analysis 1 of 7
#> ℹ Getting prevalence for analysis 2 of 7
#> ℹ Getting prevalence for analysis 3 of 7
#> ℹ Getting prevalence for analysis 4 of 7
#> ℹ Getting prevalence for analysis 5 of 7
#> ℹ Getting prevalence for analysis 6 of 7
#> ℹ Getting prevalence for analysis 7 of 7
#> ✔ Time taken: 0 mins and 5 secs
#> `populationDateStart`, `populationDateEnd`, and `populationSample` casted to
#> character.
#> `populationDateStart` and `populationDateEnd` eliminated from settings as all
#> elements are NA.
#> [2026-04-10 19:10:38] - Phenotype diagnostics - exporting results
#> [2026-04-10 19:10:38] - Exporting log file
# }
