Skip to contents

Landmark analysis for survival data with time-varying predictors. Provides unbiased estimates by analyzing survival from fixed landmark times.

Usage

landmarkanalysis(
  data,
  time,
  status,
  predictors,
  landmark_times = "6, 12, 24",
  prediction_window = 12,
  min_events = 10,
  include_baseline = TRUE,
  dynamic_prediction = TRUE,
  calibration_plot = TRUE,
  discrimination_plot = TRUE,
  supermodel = FALSE,
  bootstrap_validation = FALSE,
  n_bootstrap = 200
)

Arguments

data

The data as a data frame.

time

Follow-up time variable

status

Event status variable

predictors

Predictor variables for landmark analysis

landmark_times

Vector of landmark time points

prediction_window

Length of prediction window from each landmark

min_events

Minimum events threshold for landmark analysis

include_baseline

Whether to include baseline Cox model

dynamic_prediction

Calculate time-dependent risk predictions

calibration_plot

Generate calibration assessment plots

discrimination_plot

Generate discrimination assessment plots

supermodel

Combine landmark models using super model

bootstrap_validation

Use bootstrap for model validation

n_bootstrap

Number of bootstrap replications

Value

A results object containing:

results$todoa html
results$summarya html
results$baselineModela table
results$landmarkResultsa table
results$modelComparisona table
results$dynamicPredictionPlotan image
results$calibrationPlotan image
results$discriminationPlotan image
results$superModelResultsa table
results$validationResultsa html
results$clinicalGuidancea html
results$technicalNotesa html

Tables can be converted to data frames with asDF or as.data.frame. For example:

results$baselineModel$asDF

as.data.frame(results$baselineModel)

Examples

# \donttest{
# Example usage
landmarkanalysis(
    data = survival_data,
    time = followup_time,
    status = event_status,
    predictors = c(biomarker, treatment),
    landmark_times = c(6, 12, 24)
)
# }