Learn R Programming

Biograph (version 2.0.6)

Biograph.mvna: Converts Biograph object to input data for mvna package

Description

Converts Biograph object to long format used as input data in mvna package.

Usage

Biograph.mvna(Bdata)

Arguments

Bdata
Biograph object

Value

D
Data frame of class "mvna" (only variables that are required)
D.cov
Data in mvna format, including covariates and some other variables
par
Object produced by Parameters function, including the object trans_possible: possible transitions
cens
Character string denoting censoring (it is "cens")

Details

The function performs four operations on data in Biograph format: a. It checks whether intrastate transitions are omitted, i.e. that the diagonal elements are zero. If that is not the case, then it calls the Remove.intrastate function to remove the intrastate moves. b. It calls the Parameters function to determine the parameters associated with the Biograph object with diagonal elements removed. c. It calls the Biograph.long function to create an object having the data in long format. d. It adds to the data frame the variables entry and exit and it changes the variable name of the subject identification number from ID to id.

References

Allignol, A., J. Beyersmann and M. Schumacher (2008) mvna: An R package for the Nelson-Aalen estimator in multistate models. R Newsletter, 8(2):48-50

Allignol, A., M. Schumacher and J. Beyersmann (2011). Empirical transition matrix of multistate models: the etm package. Journal of Statistical Software, 38(4), 15 pp.

Examples

Run this code
  data(GLHS)
  D <- Biograph.mvna (GLHS)
  # Run mvna:
  require (mvna)
  zz <- attr(D$D,"param")$namstates
  zzz <- attr(D$D,"param")$trans_possible
  na <- mvna(data=D$D,state.names=zz,tra=zzz,cens.name=D$cens)
  

Run the code above in your browser using DataLab