Learn R Programming

mvna (version 1.0-2)

n.events: 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,\dots)

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.transA 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.
  • percentA matrix whose cells give the transition percentage. To be read as n.trans.
  • censoringA vector of 2 elements. The first one gives the number of censored observations, the second one its percentage.

See Also

mvna,sir.adm,sir.cont

Examples

Run this code
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)

Run the code above in your browser using DataLab