LMcalPlot: Calibration plots for dynamic risk prediction landmark models

View source: R/LMcalPlot.R

LMcalPlotR Documentation

Calibration plots for dynamic risk prediction landmark models

Description

Calibration plots for dynamic risk prediction landmark models

Usage

LMcalPlot(
  preds,
  unit = "year",
  cause,
  tLM,
  formula,
  plot = T,
  main,
  sub = T,
  splitMethod = "none",
  B = 1,
  ...
)

Arguments

preds

A named list of prediction models, where allowed entries are outputs from predLMrisk

unit

The unit of w, i.e. w-unit prediction ("year","month", etc...). Used to label the plot.

cause

Cause of interest if considering competing risks

tLM

Landmark times for which calibration must be plot. These must be a subset of LM times used during the prediction

formula

A survival or event history formula. The left hand side is used to compute the expected event status. It is recommended to give a formula. If none is given, it is obtained from the prediction object.

plot

If FALSE, do not plot the results, just return a plottable object. Default is TRUE.

main

Optional title to override default.

sub

If TRUE, add a subheading with the number of individuals at risk, and the number that under the event of interest. Default is TRUE.

splitMethod

Defines the internal validation design as in pec::calPlot. Options are none/noPlan or BootCv.

B

The number of cross-validation steps.

...

Additional arguments to pass to calPlot

Details

Most errors in plotting occur when a formula is not given. Formulas can look like Surv(LM,Time,event)~1 / Surv(LM,Time,event==1)~1 / Hist(Time,event,LM)~1 / similar...

See the Github for example code on using LMcalPlot in general.

Value

List of plots of w-year risk, one entry per prediction/landmark time point


anyafries/dynLM documentation built on July 26, 2022, 12:17 a.m.