mvna {mvna}R Documentation

Nelson-Aalen estimator in multistate models

Description

This function computes the multivariate Nelson-Aalen estimator of the cumulative transition hazards in multistate models, that is, for each possible transition, it computes an estimate of the cumulative hazard.

Usage

mvna(data, state.names, tra, cens.name)

Arguments

data A data.frame of the form data.frame(id,from,to,time) or (id,from,to,entry,exit)
id:
patient id
from:
the state from where the transition occurs
to:
the state to which a transition occurs
time:
time when a transition occurs
entry:
entry time in a state
exit:
exit time from a state
This data.frame is transition-oriented, i.e. it contains one row per transition, and possibly several rows per patient. Specifying an entry and exit time permits to take into account left-truncation.
state.names A vector of character giving the states names.
tra A quadratic matrix of logical values describing the possible transitions within the multistate model.
cens.name A character giving the code for censored observations in the column 'to' of data. If there is no censored observations in your data, put 'NULL'.

Details

This functions computes the Nelson-Aalen estimator as described in Anderson et al. (1993), along with the two variance estimators described in eq. (4.1.6) and (4.1.7) of Andersen et al. (1993) at each transition time.

Value

Returns a list named after the possible transitions, e.g. if we define a multistate model with two possible transitions: from state 0 to state 1, and from state 0 to state 2, the returned list will have two parts named "0 1" and "0 2". Each part contains a data.frame with columns:
na: Nelson-Aalen estimates at each transition times.
var1: Variance estimator given in eq. (4.1.6) of Andersen et al. (1993).
var2: Variance estimator given in eq. (4.1.7) of Andersen et al. (1993).
time: The transition times.
The list also contains:

time All the event times.
nrisk A matrix giving the number at individual at risk in the transient states just before an event.
nev An array which gives the number of transitions at each event times.
ncens A matrix giving the number a censored observations at each event times.
state.names The same as in the function call.
cens.name The same as in the function call.

Note

The variance estimator (4.1.6) may overestimate the true variance, and the one defined eq. (4.1.7) may underestimate the true variance (see Klein (1991) and Andersen et al. (example IV.1.1, 1993)), especially with small sample set. Therefore, a warning will be produced for risk-sets smaller than 5. Klein (1991) recommends the use of the variance estimator of eq. (4.1.6) because he found it less biased.

Author(s)

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

References

Andersen, P.K., Borgan, O., Gill, R.D. and Keiding, N. (1993). Statistical models based on counting processes. Springer Series in Statistics. New York, NY: Springer.

Klein, J.P. Small sample moments of some estimators of the variance of the Kaplan-Meier and Nelson-Aalen estimators. Scandinavian Journal of Statistics, 18:333–340, 1991.

See Also

sir.adm,sir.cont

Examples

data(sir.cont)

# Modification for patients entering and leaving a state
# at the same date
sir.cont <- sir.cont[order(sir.cont$id, sir.cont$time), ]
for (i in 2:nrow(sir.cont)) {
  if (sir.cont$id[i]==sir.cont$id[i-1]) {
    if (sir.cont$time[i]==sir.cont$time[i-1]) {
      sir.cont$time[i-1] <- sir.cont$time[i-1] - 0.5
    }
  }
}

# Matrix of logical giving the possible transitions
tra <- matrix(ncol=3,nrow=3,FALSE)
tra[1, 2:3] <- TRUE
tra[2, c(1, 3)] <- TRUE

# Computation of the Nelson-Aalen estimates
na <- mvna(sir.cont,c("0","1","2"),tra,"cens")

# plot
xyplot(na)


[Package mvna version 1.1-8 Index]