Given a dataset of class "survIDM", this function counts the number of observed transitions in the multi-state model.
nevents(dataidm, state.names=NULL)
A dataframe including at least four columns named
time1
, event1
, Stime
and event
, which correspond
to disease free survival time, disease free survival indicator, time to death
or censoring, and death indicator, respectively.
Names for the transition states. If NULL
(default),
transition states are named by "healthy"
, "illness"
and "death"
.
The colums of the dataset needs to have the format of class "survIDM",
which holds the transition matrix of the multi-state model. The arguments time1
and Stime
must be numeric and nonnegative; event1
and event
must
be 0 or 1 if numeric and TRUE or FALSE if logical. Stime
must be greater or
equal to argument arguments time1
. Stime
and time1
must be equal
when argument event1
equals 0 or FALSE. Argument event
must be equal
to 0 or FALSE when argument event1
equals 0 or FALSE. When arguments
Stime
and time1
are equal and argument event1
equals 1 or
TRUE, argument event
must be equal to 1 or TRUE.
L. Meira-Machado, J. de Una-Alvarez, C. Cadarso-Suarez, and P. Andersen. Multi-state models for the analysis of time to event data. Statistical Methods in Medical Research, 18:195-222, 2009.
J. de Una-Alvarez and L. Meira-Machado. Nonparametric estimation of transition probabilities in the non-markov illness-death model: A comparative study. Biometrics, 71(2):364-375, 2015.
L. Meira-Machado and M. Sestelo. Estimation in the progressive illness-death model: A nonexhaustive review. Biometrical Journal, 2018.
# NOT RUN {
nevents(colonIDM)
nevents(colonIDM, c('State0','State1', 'State2'))
# }
Run the code above in your browser using DataLab