filterSurvivalChanges: Keep survival estimates only when the probability changes

View source: R/filterSurvivalChanges.R

filterSurvivalChangesR Documentation

Keep survival estimates only when the probability changes

Description

Reduce the size of a survival result by removing time points at which the reported survival or cumulative-incidence probability is unchanged from the previous reported time. The first time point in every curve is always kept. Confidence limits for a retained time point are kept with its estimate.

Usage

filterSurvivalChanges(result)

Arguments

result

A summarised_result produced by CohortSurvival.

Details

Only survival_estimates rows are filtered. Event counts, summaries, attrition, settings, and other result types are returned unchanged. This makes the result suitable for plotSurvival(), while tables requesting an exact removed time point will not be able to display that time.

Value

A summarised_result with unchanged probabilities removed.

Examples


cdm <- mockMGUS2cdm()
result <- estimateSingleEventSurvival(
  cdm,
  targetCohortTable = "mgus_diagnosis",
  outcomeCohortTable = "death_cohort"
)
compactResult <- filterSurvivalChanges(result)


CohortSurvival documentation built on Oct. 21, 2026, 5:09 p.m.