indicationToStrata {DrugUtilisation} | R Documentation |
Create new variables summarising the data of indication that can be used as stratification columns
indicationToStrata(
cohort,
indicationVariables = indicationColumns(cohort),
keep = FALSE
)
cohort |
A cohort in the cdm |
indicationVariables |
Indication variables that we want to join |
keep |
Whether to keep the prior indication variables or not |
description The cohort with the new variable
library(DrugUtilisation)
cdm <- mockDrugUtilisation()
cdm[["cohort1"]] <- cdm[["cohort1"]] %>%
addIndication(indicationCohortName = "cohort2") %>%
indicationToStrata()