Learn R Programming

icmstate (version 0.2.0)

probtrans_weib: Determine transition probabilities for a multi-state model with Weibull hazards for the transitions.

Description

Determine transition probabilities for a multi-state model with Weibull hazards for the transitions.

Usage

probtrans_weib(transMat, times, shapes, scales, type = c("prodint", "ODE"))

Value

An object containing the "true" transition probabilities for the specified Weibull hazards.

Arguments

transMat

A transition matrix as generated by mstate::transMat describing the possible transitions for the multi-state model.

times

The times at which the transition probabilities should be determined. Will always determine the probabilities forward in time starting from min(times).

shapes

The Weibull shapes corresponding to the numbered transitions in transMat. See ?pweibull for more info.

scales

The Weibull scales corresponding to the numbered transitions in transMat. See ?pweibull for more info.

type

Should the transition probabilities be determined using product integration "prodint" or by solving the Kolmogorov forward ordinary differential equation "ODE".

Examples

Run this code
#Illness-death model
tmat <- mstate::trans.illdeath()
IDM <- probtrans_weib(tmat, seq(0, 15, 0.01), shapes = c(0.5, 0.5, 2), 
                      scales = c(5, 10, 10/gamma(1.5)), type = "prodint")
IDM2 <- probtrans_weib(tmat, seq(0, 15, 0.01), shapes = c(0.5, 0.5, 2), 
                       scales = c(5, 10, 10/gamma(1.5)), type = "ODE")
plot(IDM)
plot(IDM2)

#Extended illness-death model
tmat <- mstate::transMat(list(c(2, 3), c(4), c(), c()))
IDM <- probtrans_weib(tmat, seq(0, 15, 0.01), shapes = c(0.5, 0.5, 2), 
                      scales = c(5, 10, 10/gamma(1.5)), type = "prodint")
IDM2 <- probtrans_weib(tmat, seq(0, 15, 0.01), shapes = c(0.5, 0.5, 2), 
                       scales = c(5, 10, 10/gamma(1.5)), type = "ODE")
plot(IDM)
plot(IDM2)


Run the code above in your browser using DataLab