
Plot longitudinal observations and predicted survival curve for one individual
Source:R/visualisation.R
plot-LandmarkAnalysis-method.RdProduces a single-panel plot with a common time axis. The left of the landmark dashed line shows the individual's observed longitudinal measurements; the right shows their predicted survival curve. The summary value at the landmark that feeds into the survival sub-model is highlighted.
Usage
# S4 method for class 'LandmarkAnalysis'
plot(x, id, landmark, dynamic_covariate, horizon = NULL, train = TRUE, ...)Arguments
- x
An object of class
LandmarkAnalysis.- id
Identifier of the individual to plot. Must match a value in the column
x@ids.- landmark
Numeric landmark time.
- dynamic_covariate
Character name of the dynamic covariate to display.
- horizon
Numeric horizon time. If
NULL(default), uses the single available horizon forlandmark; errors when multiple horizons are available.- train
Logical. If
TRUE(default), uses in-sample predictions. IfFALSE, uses out-of-sample predictions (requiresvalidation_fold > 0inpredict_survival).- ...
Additional arguments (not currently used).
Value
A ggplot object.