n.events {mvna}R Documentation

Number of events for event history analysis

Description

This function gives the number of events or transitions and percentage.

Usage

n.events(object,...)

## S3 method for class 'mvna':
n.events(object,data,...)

Arguments

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

Value

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.

Author(s)

Arthur Allignol, arthur.allignol@fdm.uni-freiburg.de

See Also

mvna,sir.adm,sir.cont

Examples

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)

[Package mvna version 1.0-2 Index]