Learn R Programming

Biograph (version 1.0)

Biograph.mvna: 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(survey)

Arguments

survey
Biograph object

Value

  • DData in mvna format (only variables that are required)
  • D.covData in mvna format, including covariates and some other variables
  • parObject produced by Parameters function, including par$trans_possible: possible transitions
  • censCharacter string denoting censoring (it is "cens")

Details

The function performs four operations on data in Biograph format. First it checks whether intrastate transitions are omiited, i.e. that the diagonal elements are NA. If that is not the case, then it calls the Remove.intrastate function to remove the intrastate moves. Second, it calls the Parameters function to determine the parameters associated with the Biograph object with diagonal elements removed. Third, it calls the Biograph.long function to create an object having the data in the long format. Fourth, 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

For mvna package: ADD

Examples

Run this code
data(GLHS)
  D <- Biograph.mvna (GLHS)
  # Run mvna:
  namstates.numeric <- as.character(1:length(namstates))
  require (mvna)
  na <- mvna(data=D$D,state.names=namstates.numeric,tra=D$par$trans_possible,cens.name=D$cens)

Run the code above in your browser using DataLab