Skip to contents

Time-updated survival estimates using time-varying regression coefficients and dynamic hazard functions. Incorporates real-time patient information updates for precision medicine and personalized survival prediction.

Usage

timeupdatesurvival(
  data,
  time,
  status,
  covariates,
  id,
  update_times = "0.5, 1, 2, 5",
  method = "aalen_additive",
  smoothing_method = "lowess",
  bandwidth = 0.5,
  degrees_freedom = 4,
  confidence_level = 0.95,
  prediction_horizon = 5,
  bootstrap_samples = 200,
  include_residuals = TRUE,
  dynamic_prediction = TRUE,
  individual_profiles = FALSE,
  significance_testing = TRUE,
  model_comparison = TRUE
)

Arguments

data

the data as a data frame

time

Time-to-event or follow-up time variable (numeric)

status

Event indicator variable (1/TRUE = event occurred, 0/FALSE = censored)

covariates

Covariates for time-varying coefficient analysis

id

Subject identifier for longitudinal data and repeated measurements

update_times

Comma-separated list of time points for coefficient updates (e.g., "0.5, 1, 2, 5")

method

Method for estimating time-varying regression coefficients

smoothing_method

Smoothing method for time-varying coefficient estimation

bandwidth

Bandwidth parameter for smoothing (0.1 to 2.0)

degrees_freedom

Degrees of freedom for spline-based methods

confidence_level

Confidence level for confidence bands

prediction_horizon

Time horizon for dynamic survival predictions

bootstrap_samples

Number of bootstrap samples for confidence band estimation

include_residuals

Include residual analysis and model diagnostics

dynamic_prediction

Enable dynamic survival prediction with updated coefficients

individual_profiles

Generate individual-level time-varying coefficient profiles

significance_testing

Perform tests for time-varying coefficients vs. constant coefficients

model_comparison

Compare time-varying models with standard Cox regression

Value

A results object containing:

results$instructionsa html
results$modelSummarya table
results$timeVaryingCoefficientsa table
results$cumulativeCoefficientsa table
results$dynamicPredictionsa table
results$significanceTestsa table
results$modelComparisona table
results$residualAnalysisa table
results$goodnessOfFita table
results$timeVaryingPlotan image
results$cumulativePlotan image
results$dynamicPredictionPlotan image
results$residualPlotsan image
results$smoothingDiagnosticsan image
results$methodExplanationa html

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

results$modelSummary$asDF

as.data.frame(results$modelSummary)

Examples