probtrans_weib {icmstate} | R Documentation |
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"))
Arguments
transMat |
A transition matrix as generated by |
times |
The times at which the transition probabilities should be
determined. Will always determine the probabilities forward in time starting
from |
shapes |
The Weibull shapes corresponding to the numbered transitions
in |
scales |
The Weibull scales corresponding to the numbered transitions
in |
type |
Should the transition probabilities be determined using
product integration |
Value
An object containing the "true" transition probabilities for the specified Weibull hazards.
Examples
#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)