summariseDrugRestart {DrugUtilisation}R Documentation

Summarise the drug restart per window.

Description

[Experimental]

Usage

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

Arguments

cohort

A cohort table.

switchCohortTable

A cohort table in the cdm that contains possible alternative treatments.

switchCohortId

The cohort ids to be used from switchCohortTable. If NULL all cohort definition ids are used.

strata

List with column names or vectors of column names groups to stratify results by.

followUpDays

A vector of number of days to follow up. It can be multiple values.

censorDate

Date of censoring. Individuals are always censored at the end of observation.

restrictToFirstDiscontinuation

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

Value

A summarised_result object with the percentages of restart, switch and not exposed per window.

Examples


library(DrugUtilisation)

cdm <- mockDrugUtilisation()

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

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

tableDrugRestart(result)

CDMConnector::cdmDisconnect(cdm = cdm)


[Package DrugUtilisation version 0.7.0 Index]