summariseDiscontinuationAsSurvival() analyses discontinuation as a survival analysis
using the CohortSurvival
package. The function assumes that each cohort entry is a continuous
treatment era. Discontinuation will be assessed as a survival analysis with
index date: start of the drug treatment era (cohort_start_date) and event
of interest: first day without exposure (the day after
cohort_end_date). An event is only recorded if the individual remains under
observation on that day. The analysis will use
estimateSingleEventSurvival() or estimateCompetingRiskSurvival() depending
if competingOutcomeCohortTable is provided or not.
summariseDiscontinuationAsSurvival(
cohort,
cohortId = NULL,
followUpDays = Inf,
censorDate = NULL,
restrictToFirstDiscontinuation = TRUE,
strata = list(),
competingOutcomeCohortTable = NULL,
competingOutcomeCohortId = NULL,
eventGap = 30,
estimateGap = 1
)A <summarised_result> object that contains the probability to not
discontinue over time and the summary statistics. Use
tableDiscontinuationAsSurvival() and plotDiscontinuationAsSurvival() to visualise the
results.
A cohort_table object.
A cohort definition id to restrict by. If NULL, all cohorts will be included.
Number of days to follow up individuals (lower bound 1, upper bound Inf).
if not NULL, an individual's follow up will be censored at the given date.
Whether to consider only the first discontinuation episode or all of them.
A list of variables to stratify results. These variables must have been added as additional columns in the cohort table.
The competing outcome cohort table of interest.
Competing outcome cohorts to include. It can either be a cohort_definition_id value or a cohort_name. Multiple ids are allowed.
Days between time points for which to report survival events, which are grouped into the specified intervals.
Days between time points for which to report survival estimates. First day will be day zero with risk estimates provided for times up to the end of follow-up, with a gap in days equivalent to eventGap.
# \donttest{
library(DrugUtilisation)
cdm <- mockDrugUtilisation()
result <- summariseDiscontinuationAsSurvival(cdm$cohort1)
plotDiscontinuationAsSurvival(result)
tableDiscontinuationAsSurvival(result)
# }
Run the code above in your browser using DataLab