Description Usage Arguments Details Value Examples
This function performs the same role as msprep
from the mstate
package, except
that it accepts long data (each row corresponds to a state entry) rather
than the wide format used by msprep
(each row represents an individual with state entry
indicated in columns).
1 2 3 4 5 6 7 8 9 |
entry |
Long data frame of format |
tmat |
Transition matrix in the standard format required by |
censors |
A long data frame with 2 columns, |
start_times |
A long data frame with 2 columns, |
start_states |
A long data frame with 2 columns, |
covars |
Data frame where each row corresponds to an individual and details their
covariate values. Must contain the id column specified in |
idcol |
The column that indexes these patients, must be present in
|
The long data format required by msprep2
is a more natural way of organising
state entry data than the wide format required by msprep
.
An additional benefit of having the state entries organised in this fashion is that
it allows for the situation where an individual enters the same state multiple times,
which is not supported by msprep
.
An object of class msdata
, representing the transition data
in long format.
1 2 3 4 5 6 7 8 9 | library(multistateutils)
library(mstate)
tmat <- trans.illdeath()
entry <- data.frame(id=c(1, 2, 2),
state=c(2, 2, 3),
time=c(23, 35, 360))
msprep2(entry, tmat)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.