| n.events {mvna} | R Documentation |
This function gives the number of events or transitions and percentage.
n.events(object,...) ## S3 method for class 'mvna': n.events(object,data,...)
object |
The object on which method dispatch is carried out.
For "mvna" methods, object must be of class 'mvna' |
data |
A data.frame as in mvna, corresponding to
object |
... |
Further arguments for the n.events method |
For n.events.mvna, returns a list with components:
n.trans |
A matrix whose cells give the number of transitions from one state to another. The starting state is given by the row names, the column names give the arrival state. |
percent |
A matrix whose cells give the transition percentage. To
be read as n.trans. |
censoring |
A vector of 2 elements. The first one gives the number of censored observations, the second one its percentage. |
Arthur Allignol, arthur.allignol@fdm.uni-freiburg.de
data(sir.cont)
# Matrix of logical giving the possible transitions
tra <- matrix(ncol=3,nrow=3,TRUE)
tra[3,1:2] <- FALSE
diag(tra) <- FALSE # doesn't change much
# Computation of the Nelson-Aalen estimates
na <- mvna(sir.cont,c("0","1","2"),tra,"cens")
n.events(na,sir.cont)