make_mstate_refpat: Prepare reference patient to predict with probtrans

View source: R/illustrative-analysis-helpers.R

make_mstate_refpatR Documentation

Prepare reference patient to predict with probtrans

Description

Utility function which allows to prepare one row of data.frame to be fed into mstate::msfit for prediction.

Usage

make_mstate_refpat(refpat, tmat, covs)

Arguments

refpat

A single-row data.frane containing the covariate values to predict

tmat

Transition matrix

covs

Covariates used in the cause-specific Cox models

Examples

tmat <- mstate::trans.comprisk(2, c("REL", "NRM"))
covs <- c("age_allo1_decades", "mdsclass")

ref_pat <- dat_mds_synth[1, ]
ref_pat[]
make_mstate_refpat(ref_pat, tmat, covs)


survival-lumc/CauseSpecCovarMI documentation built on June 16, 2022, 9:51 a.m.