summariseDrugUse {DrugUtilisation} | R Documentation |
This function is used to summarise the dose table over multiple cohorts.
Description
This function is used to summarise the dose table over multiple cohorts.
Usage
summariseDrugUse(
cohort,
cdm = lifecycle::deprecated(),
strata = list(),
drugUseEstimates = 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 |
cdm_reference generated by CDMConnector |
strata |
Stratification list |
drugUseEstimates |
Estimates that we want for the columns |
minCellCount |
Below this number counts will be supressed |
Value
A summary of the drug use stratified by cohort_name and strata_name
Examples
library(DrugUtilisation)
library(PatientProfiles)
library(CodelistGenerator)
cdm <- mockDrugUtilisation()
cdm <- generateDrugUtilisationCohortSet(
cdm, "dus_cohort", getDrugIngredientCodes(cdm, "acetaminophen")
)
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, 30), ">40" = c(40, 150)))
summariseDrugUse(
cdm[["dus_cohort"]], strata = list(
"age_group" = "age_group", "sex" = "sex",
"age_group and sex" = c("age_group", "sex")
)
)
[Package DrugUtilisation version 0.6.0 Index]