| probtrans {mstate} | R Documentation |
This function computes subject-specific or overall transition probabilities in multi-state models. If requested, also standard errors are calculated.
probtrans(object, trans, predt, direction=c("forward","backward"),
method=c("aalen","greenwood"), variance=TRUE, covariance=FALSE)
object |
msfit object containing estimated cumulative hazards for each of the transitions in the multi-state model and, if standard errors are requested, (co)variances of these cumulative hazards for each pair of transitions |
trans |
Only required if vartype="greenwood".
Transition matrix describing the states and transitions in the multi-state
model, see the trans argument in msprep |
predt |
A positive number indicating the prediction time. This is
either the time at which the prediction is made (if direction=
"forward") or the time for which the prediction is to be made (if
direction="backward") |
direction |
One of "forward" (default) or "backward",
indicating whether prediction is forward or backward in time |
method |
A character string specifying the type of variances
to be computed (so only needed if either variance or covariance
is TRUE). Possible values are "aalen" or "greenwood" |
variance |
Logical value indicating whether standard errors are
to be calculated (default is TRUE) |
covariance |
Logical value indicating whether covariances of
transition probabilities for different states are to be calculated
(default is FALSE) |
For details refer to de Wreede, Fiocco & Putter (2009).
A list containing S (if covariance=FALSE) or
S+1 items (if covariance=TRUE), S being the number of states
in the multi-state model. Item [[s]] contains a dataframe with
the estimated transition probabilities from state s.
If covariance=TRUE, item [[S+1]] contains an array
with all the covariances of the estimated transition probabilities.
Liesbeth de Wreede and Hein Putter H.Putter@lumc.nl
Andersen PK, Borgan O, Gill RD, Keiding N (1993). Statistical Models Based on Counting Processes. Springer, New York.
Putter H, Fiocco M, Geskus RB (2007). Tutorial in biostatistics: Competing risks and multi-state models. Statistics in Medicine 26, 2389–2430.
Therneau TM, Grambsch PM (2000). Modeling Survival Data: Extending the Cox Model. Springer, New York.
de Wreede L, Fiocco M, Putter H (2009). The mstate package for estimation and prediction in non- and semi-parametric multi-state models. Submitted. www.msbi.nl/multistate.
# transition matrix for illness-death model
tmat <- trans.illdeath()
# data in wide format, for transition 1 this is dataset E1 of
# Therneau & Grambsch (2000)
tg <- data.frame(illt=c(1,1,6,6,8,9),ills=c(1,0,1,1,0,1),
dt=c(5,1,9,7,8,12),ds=c(1,1,1,1,1,1),
x1=c(1,1,1,0,0,0),x2=c(6:1))
# data in long format using msprep
tglong <- msprep(time=c(NA,"illt","dt"),status=c(NA,"ills","ds"),
data=tg,keep=c("x1","x2"),trans=tmat)
# events
events(tglong,tmat)
table(tglong$status,tglong$to,tglong$from)
# expanded covariates
tglong <- expand.covs(tglong,tmat,c("x1","x2"))
# Cox model with different covariate
cx <- coxph(Surv(Tstart,Tstop,status)~x1.1+x2.2+strata(trans),
data=tglong,method="breslow")
summary(cx)
# new data, to check whether results are the same for transition 1 as
# those in appendix E.1 of Therneau & Grambsch (2000)
newdata <- data.frame(trans=1:3,x1.1=c(0,0,0),x2.2=c(0,1,0),strata=1:3)
HvH <- msfit(cx,newdata)
# probtrans
pt <- probtrans(HvH,tmat,predt=0)
# predictions from state 1
pt[[1]]