View source: R/populationDiagnostics.R
populationDiagnostics | R Documentation |
phenotypeR diagnostics on the cohort of input with relation to a denomination population. Diagnostics include:
* Incidence * Prevalence
populationDiagnostics(
cohort,
populationSample = 1e+06,
populationDateRange = as.Date(c(NA, NA))
)
cohort |
Cohort table in a cdm reference |
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. |
A summarised result
library(PhenotypeR)
library(dplyr)
cdm <- mockPhenotypeR()
dateStart <- cdm$my_cohort |>
summarise(start = min(cohort_start_date, na.rm = TRUE)) |>
pull("start")
dateEnd <- cdm$my_cohort |>
summarise(start = max(cohort_start_date, na.rm = TRUE)) |>
pull("start")
result <- cdm$my_cohort |>
populationDiagnostics(populationDateRange = c(dateStart, dateEnd))
CDMConnector::cdmDisconnect(cdm = cdm)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.