Learn R Programming

TPmsm (version 1.2.1)

as.data.frame.survTP: as.data.frame method for a survTP object

Description

as.data.frame method for an object of class ‘survTP’.

Usage

# S3 method for survTP
as.data.frame(x, ..., package="TPmsm")

Arguments

x

An object of class ‘survTP’.

Additional arguments to be passed to or from method.

package

The format of the data.frame. Possible options are “TPmsm”, “p3state.msm” and “etm”. Defaults to “TPmsm”.

Value

A data.frame in the format specified by argument package.

References

Allignol A., Schumacher M., Beyersmann J. (2011) Empirical Transition Matrix of Multi-State Models: The etm Package. Journal of Statistical Software 38(4), 1--15.

Meira-Machado L., Roca-Pardi<U+00F1>as J. (2011) p3state.msm: Analyzing Survival Data from an Illness-Death Model. Journal of Statistical Software 38(3), 1--18.

See Also

as.data.frame, survTP.

Examples

Run this code
# NOT RUN {
# Example for the "TPmsm" format
weiTP <- dgpTP(n=100, corr=1, dist="weibull", dist.par=c(2, 7, 2, 7),
model.cens="exponential", cens.par = 6, state2.prob=0.6)
weidata <- as.data.frame(weiTP)
head(weidata)

# Example for the "etm" format
expTP <- dgpTP(n=100, corr=1, dist="exponential", dist.par=c(1, 1),
model.cens="uniform", cens.par=3, state2.prob=0.5)
expdata <- as.data.frame(expTP, package="etm")
head(expdata)
# }

Run the code above in your browser using DataLab