plotLMrisk | R Documentation |
Plots the absolute w-year risk of individuals for different LM points for an event of interest within a window
plotLMrisk( supermodel, data, format, LM_col, id_col, w, cause, varying, end_time, extend = F, silence = F, unit, pch, lty, lwd, col, main, xlab, ylab, xlim, ylim, x.legend, y.legend, ... )
supermodel |
Fitted LM super model |
data |
Data frame of individuals from which to plot risk |
format |
Character string specifying whether the data are in wide (default) or in long format |
LM_col |
Character string specifying the column name in data containing the (running) time variable associated with the time-varying covariate(s); only needed if format="long" |
id_col |
Character string specifying the column name in data containing the subject id; only needed if format="long" |
w |
Prediction window, i.e., predict w-year (/month/..) risk from each of the tLMs. Defaults to the w used in model fitting. If w > than that used in model fitting, results are unreliable, but can be produced by setting extend=T. |
cause |
The cause we are looking at if considering competing risks |
varying |
Character string specifying column name in the data containing time-varying covariates; only needed if format="wide" |
end_time |
Final time point to plot risk |
extend |
Argument to allow for risk to be plot at landmark times that are later than the LMs used in model fitting. Default is FALSE. If set to TRUE, risks may be unreliable. |
silence |
Silence the message when end_time > LMs used in fitting the model |
unit |
Time unit for window of prediction, e.g., "year", "month", etc. Used for printing results. |
pch |
Passed to points |
lty |
Vector with line style |
lwd |
Vector with line widths |
col |
Vector with colors |
main |
Title for the plot |
xlab |
Label for x-axis |
ylab |
Label for y-axis |
xlim |
Limits for the x-axis |
ylim |
Limits for the y-axis |
x.legend, y.legend |
The x and y co-ordinates to be used to position the legend. They can be specified by keyword or in any way which is accepted by xy.coords. |
... |
Additional arguments passed to plot |
See the Github for example code
Single plot the absolute w-year risk of individuals
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.