| events {mstate} | R Documentation |
Given a dataset in long format, for instance generated by
msprep, and a transition matrix for the multi-state
model, this function counts the number of observed transitions
in the multi-state model and gives their percentages.
events(msdata,trans)
msdata |
Data frame in long format, such as output by
msprep |
trans |
The transition matrix describing the multi-state
model, see msprep |
Although msdata does not need to be the result of a call to
msprep, it does need to be a dataframe in long format,
with one row for each transition for which the subject is at risk.
The columns from, to, and status need to be
present, with appropriate meaning, see msprep.
A list containing two tables, the first, called Frequencies,
with the number of observed transitions in the multi-state model
occurring in msdata, the second, called Proportions,
with the corresponding proportions.
Hein Putter H.Putter@lumc.nl
tmat <- trans.illdeath(names=c("Tx","PR","RelDeath"))
data(ebmt3) # data from Section 4 of Putter, Fiocco & Geskus (2007)
msebmt <- msprep(time=c(NA,"prtime","rfstime"),status=c(NA,"prstat","rfsstat"),
data=ebmt3,id="patid",trans=tmat)
events(msebmt,tmat) # see Fig 13 of Putter, Fiocco & Geskus (2007)