summariseDrugUse {DrugUtilisation} | R Documentation |
This function is used to summarise the dose table over multiple cohorts.
Description
Usage
summariseDrugUse(
cohort,
cdm = lifecycle::deprecated(),
strata = list(),
estimates = c("min", "q05", "q25", "median", "q75", "q95", "max", "mean", "sd",
"count_missing", "percentage_missing"),
minCellCount = lifecycle::deprecated()
)
Arguments
cohort |
Cohort with drug use variables and strata. |
cdm |
Deprecated. |
strata |
Stratification list. |
estimates |
Estimates that we want for the columns. |
minCellCount |
Deprecated. |
Value
A summary of the drug use stratified by cohort_name and strata_name
Examples
library(DrugUtilisation)
library(PatientProfiles)
cdm <- mockDrugUtilisation()
codelist <- CodelistGenerator::getDrugIngredientCodes(cdm, "acetaminophen")
cdm <- generateDrugUtilisationCohortSet(
cdm, "dus_cohort", codelist
)
cdm[["dus_cohort"]] <- cdm[["dus_cohort"]] |>
addDrugUse(ingredientConceptId = 1125315)
result <- summariseDrugUse(cdm[["dus_cohort"]])
print(result)
cdm[["dus_cohort"]] <- cdm[["dus_cohort"]] |>
addSex() |>
addAge(ageGroup = list("<40" = c(0, 39), ">=40" = c(40, 150)))
cdm[["dus_cohort"]] |>
summariseDrugUse(strata = list("age_group", "sex", c("age_group", "sex")))
[Package DrugUtilisation version 0.7.0 Index]