Learn R Programming

DrugUtilisation (version 1.3.1)

addDrugRestart: Add drug restart information as a column per follow-up period of interest.

Description

Add drug restart information as a column per follow-up period of interest.

Usage

addDrugRestart(
  cohort,
  switchCohortTable,
  switchCohortId = NULL,
  followUpDays = Inf,
  censorDate = NULL,
  incident = TRUE,
  nameStyle = "drug_restart_{follow_up_days}"
)

Value

The cohort table given with additional columns with information on the restart, switch and not exposed per follow-up period of interest.

Arguments

cohort

A cohort_table object.

switchCohortTable

A cohort table in the CDM containing possible alternative treatments.

switchCohortId

Cohort definition IDs to use from switchCohortTable. If NULL, all cohort definition IDs are included.

followUpDays

Number of days to follow up. Multiple values are allowed.

censorDate

Name of a column that indicates the date to stop the analysis, if NULL end of individuals observation is used.

incident

Whether switch treatment must be incident, starting after discontinuation. If FALSE, it may start before discontinuation and continue beyond it.

nameStyle

Character string to specify the nameStyle of the new columns.

Examples

Run this code
# \donttest{
library(DrugUtilisation)

cdm <- mockDrugUtilisation()

conceptlist <- list(acetaminophen = 1125360, metformin = c(1503297, 1503327))
cdm <- generateDrugUtilisationCohortSet(cdm = cdm,
                                        name = "switch_cohort",
                                        conceptSet = conceptlist)

cdm$cohort1 |>
  addDrugRestart(switchCohortTable = "switch_cohort")
# }

Run the code above in your browser using DataLab