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.numbers, tra, cens.name, tr.choice = "all")

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.numbers 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 'NA'.
tr.choice A vector of character specifying which transitions are to be computed, e.g. c("0 1","0 2") for transitions from state named '0' to state named '1', and from state '0' to state '2'. Default is "all".

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:

state.numbers The same as in the function call.
cens.name The same as in the function call.
n.cens Number of censored observations

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. We suggest that bootstrapping this variance estimator may improve on this problem (see sir.cont for an example of bootstrap).

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

xyplot.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")

# plot
xyplot(na)

### See the example in the data sets help pages
### help(sir.adm) and help(sir.cont)
### for more detailed examples

[Package mvna version 1.0-2 Index]