Learn R Programming

DrugUtilisation (version 1.3.1)

summariseDiscontinuationAsSurvival: Summarise discontinuation as a survival analysis

Description

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.

Usage

summariseDiscontinuationAsSurvival(
  cohort,
  cohortId = NULL,
  followUpDays = Inf,
  censorDate = NULL,
  restrictToFirstDiscontinuation = TRUE,
  strata = list(),
  competingOutcomeCohortTable = NULL,
  competingOutcomeCohortId = NULL,
  eventGap = 30,
  estimateGap = 1
)

Value

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.

Arguments

cohort

A cohort_table object.

cohortId

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

followUpDays

Number of days to follow up individuals (lower bound 1, upper bound Inf).

censorDate

if not NULL, an individual's follow up will be censored at the given date.

restrictToFirstDiscontinuation

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

strata

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

competingOutcomeCohortTable

The competing outcome cohort table of interest.

competingOutcomeCohortId

Competing outcome cohorts to include. It can either be a cohort_definition_id value or a cohort_name. Multiple ids are allowed.

eventGap

Days between time points for which to report survival events, which are grouped into the specified intervals.

estimateGap

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.

Examples

Run this code
# \donttest{
library(DrugUtilisation)

cdm <- mockDrugUtilisation()

result <- summariseDiscontinuationAsSurvival(cdm$cohort1)

plotDiscontinuationAsSurvival(result)

tableDiscontinuationAsSurvival(result)
# }

Run the code above in your browser using DataLab