phenotypeDiagnostics {PhenotypeR} | R Documentation |
Phenotype a cohort
Description
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'. * A diagnostics on the matched cohort via 'matchedDiagnostics'.
Usage
phenotypeDiagnostics(
cohort,
databaseDiagnostics = TRUE,
codelistDiagnostics = TRUE,
cohortDiagnostics = TRUE,
populationDiagnostics = TRUE,
populationSample = 1e+06,
populationDateRange = as.Date(c(NA, NA)),
matchedDiagnostics = TRUE,
matchedSample = 1000
)
Arguments
cohort |
Cohort table in a cdm reference |
databaseDiagnostics |
If TRUE, database diagnostics will be run. |
codelistDiagnostics |
If TRUE, codelist diagnostics will be run. |
cohortDiagnostics |
If TRUE, cohort diagnostics will be run. |
populationDiagnostics |
If TRUE, population diagnostics will be run. |
populationSample |
Number of people from the cdm to sample. If NULL no sampling will be performed |
populationDateRange |
Two dates. The first indicating the earliest cohort start date and the second indicating the latest possible cohort end date. If NULL or the first date is set as missing, the earliest observation_start_date in the observation_period table will be used for the former. If NULL or the second date is set as missing, the latest observation_end_date in the observation_period table will be used for the latter. |
matchedDiagnostics |
If TRUE, cohort to population diagnostics will be run. |
matchedSample |
The number of people to take a random sample for matching. If NULL, no sampling will be performed. |
Value
A summarised result
Examples
cdm_local <- omock::mockCdmReference() |>
omock::mockPerson(nPerson = 100) |>
omock::mockObservationPeriod() |>
omock::mockConditionOccurrence() |>
omock::mockDrugExposure() |>
omock::mockObservation() |>
omock::mockMeasurement() |>
omock::mockVisitOccurrence() |>
omock::mockProcedureOccurrence() |>
omock::mockCohort(name = "my_cohort")
db <- DBI::dbConnect(duckdb::duckdb())
cdm <- CDMConnector::copyCdmTo(con = db,
cdm = cdm_local,
schema ="main",
overwrite = TRUE)
phenotypeDiagnostics(cdm$my_cohort)
CDMConnector::cdm_disconnect(cdm)