summariseDrugRestart {DrugUtilisation} | R Documentation |
Summarise the drug restart per window.
Description
Usage
summariseDrugRestart(
cohort,
cohortId = NULL,
switchCohortTable,
switchCohortId = NULL,
strata = list(),
followUpDays = Inf,
censorDate = NULL,
incident = TRUE,
restrictToFirstDiscontinuation = TRUE
)
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 that contains possible alternative treatments. |
switchCohortId |
The cohort ids to be used from switchCohortTable. If NULL all cohort definition ids are used. |
strata |
A list of variables to stratify results. These variables must have been added as additional columns in the cohort table. |
followUpDays |
A vector of number of days to follow up. It can be multiple values. |
censorDate |
Name of a column that indicates the date to stop the analysis, if NULL end of individuals observation is used. |
incident |
Whether the switch treatment has to be incident (start after discontinuation) or not (it can start before the discontinuation and last till after). |
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)