
Fits a survival model pooled across several landmark times (superlandmarking)
Source:R/superlandmarking.R
fit_superlandmark-LandmarkAnalysis-method.RdFits a survival model pooled across several landmark times (superlandmarking)
Usage
# S4 method for class 'LandmarkAnalysis'
fit_superlandmark(
x,
formula,
landmarks,
w,
dynamic_covariates = c(),
include_clusters = FALSE,
validation_fold = 0
)Arguments
- x
An object of class
LandmarkAnalysis.- formula
A formula to be used in survival submodel fitting. Must reference the
LMcolumn directly to model landmark-varying covariate effects (e.g. via an interaction with a function ofLM) or a landmark-varying baseline hazard (viastrata(LM)).- landmarks
Numeric vector of at least two landmark times, for which risk sets must already have been computed via
compute_risk_sets.- w
Scalar prediction window. Each landmark time \(s\) in
landmarksuses the (fixed) horizon \(s+w\).- dynamic_covariates
Vector of time-varying covariates to be used in the survival model.
- include_clusters
Boolean indicating whether to propagate cluster membership to survival analysis.
- validation_fold
If positive, cross-validation fold where model is fitted. If 0 (default), model fitting is performed on the complete dataset.
Value
An object of class LandmarkAnalysis.