Learn R Programming

DrugUtilisation (version 1.3.1)

summariseDrugRestart: Summarise the drug restart for each follow-up period of interest.

Description

Summarise the drug restart for each follow-up period of interest.

Usage

summariseDrugRestart(
  cohort,
  cohortId = NULL,
  switchCohortTable,
  switchCohortId = NULL,
  strata = list(),
  followUpDays = Inf,
  censorDate = NULL,
  incident = TRUE,
  restrictToFirstDiscontinuation = TRUE
)

Value

A summarised_result object with the percentages of restart, switch and not exposed per follow-up period given.

Arguments

cohort

A cohort_table object.

cohortId

A cohort definition id to restrict by. If NULL, all cohorts will be included.

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.

strata

A list of variables to stratify results. These variables must have been added as additional columns in the cohort table.

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.

restrictToFirstDiscontinuation

Whether to consider only the first discontinuation episode or all of them.

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)

result <- cdm$cohort1 |>
  summariseDrugRestart(switchCohortTable = "switch_cohort")

tableDrugRestart(result)
# }

Run the code above in your browser using DataLab