MyNixOS website logo
Description

Calibration Plots for the Transition Probabilities from Multistate Models.

Assess the calibration of an existing (i.e. previously developed) multistate model through calibration plots. Calibration is assessed using one of three methods. 1) Calibration methods for binary logistic regression models applied at a fixed time point in conjunction with inverse probability of censoring weights. 2) Calibration methods for multinomial logistic regression models applied at a fixed time point in conjunction with inverse probability of censoring weights. 3) Pseudo-values estimated using the Aalen-Johansen estimator of observed risk. All methods are applied in conjunction with landmarking when required. These calibration plots evaluate the calibration (in a validation cohort of interest) of the transition probabilities estimated from an existing multistate model. While package development has focused on multistate models, calibration plots can be produced for any model which utilises information post baseline to update predictions (e.g. dynamic models); competing risks models; or standard single outcome survival models, where predictions can be made at any landmark time. Please see Pate et al. (2024) <doi:10.1002/sim.10094> and Pate et al. (2024) <https://alexpate30.github.io/calibmsm/articles/Overview.html>.

calibmsm

R-CMD-check Codecov testcoverage CRANstatus metacrandownloads

The goal of calibmsm is to provide a set of tools for estimating calibration plots when validating an existing (i.e. previously developed) multistate model. While the vignettes and articles for this package focus on assessing the calibration of a multistate model, calibration plots can also be produced for predicted risks from dynamic models, landmark super models, competing risks models and standard single outcome survival models, where predictions can be made at any landmark time.

For a detailed guide on how to use calibmsm please see the Overview vignette.

Installation

The package can be installed from CRAN as follows:

install.packages("calibmsm")

You can install the development version of calibmsm from GitHub with:

# install.packages("devtools")
devtools::install_github("alexpate30/calibmsm")

Example

This is a basic example which shows you how to assess the calibration of the transition probabilities at 5 years follow up for individuals out of state j = 1 at time s = 0 using the BLR-IPCW approach. Please see the Overview vignette for examples of how to assess calibration using the pseudo-value and MLR-IPCW approaches, as well as details of the methodology.

The predicted transition probabilities are stored in tps0, the individuals data are stored in ebmtcal, and the data in msdata format are stored in msebmtcal. Calibration curves are estimated using calib_msm using the BLR-IPCW method (calib.type = 'blr') with inverse probability of censoring weights are calculated based on variables year, age, prophylaxis and donor gender match. The calibration curves are estimated using restricted cubic splines with 3 knots. A 95% confidence interval is calculated using bootstrapping with 200 bootstrap replicates.

## Load calibmsm
library(calibmsm)
#> Warning: package 'calibmsm' was built under R version 4.3.3

## Extract relevant predicted risks from tps0
tp.pred <- dplyr::select(dplyr::filter(tps0, j == 1), any_of(paste("pstate", 1:6, sep = "")))

## Calculate observed event probabilities
dat.calib.blr <-
  calib_msm(data.mstate = msebmtcal,
          data.raw = ebmtcal,
          j = 1,
          s = 0,
          t = 1826,
          tp.pred = tp.pred,
          calib.type = "blr",
          curve.type = "rcs",
          rcs.nk = 3,
          w.covs = c("year", "agecl", "proph", "match"),
          CI = 95,
          CI.R.boot = 200)


## Plot calibration plots
plot(dat.calib.blr, combine = TRUE, nrow = 2, ncol = 3)

Getting help

If you encounter a bug, please file an issue with a minimal reproducible example on GitHub.

Metadata

Version

1.1.1

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows