summariseTreatmentFromCohort {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

summariseTreatmentFromCohort(
  cohort,
  strata = list(),
  window,
  treatmentCohortName,
  treatmentCohortId = NULL,
  combination = FALSE,
  minCellCount = 5
)

Arguments

cohort

Cohort with drug use variables and strata.

strata

Stratification list.

window

Window where to summarise the treatments.

treatmentCohortName

Name of a cohort in the cdm that contains the interest treatments.

treatmentCohortId

Cohort definition id of interest from treatmentCohortName.

combination

Whether to include combination treatments.

minCellCount

Below this number counts will be suppressed.

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]