Learn R Programming

TPmsm (version 1.2.12)

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

Value

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

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”.

Author

Artur Araújo, Javier Roca-Pardiñas and Luís Meira-Machado

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. tools:::Rd_expr_doi("10.18637/jss.v038.i04")

Araújo A, Meira-Machado L, Roca-Pardiñas J (2014). TPmsm: Estimation of the Transition Probabilities in 3-State Models. Journal of Statistical Software, 62(4), 1-29. tools:::Rd_expr_doi("10.18637/jss.v062.i04")

Meira-Machado L., Roca-Pardiñas J. (2011). p3state.msm: Analyzing Survival Data from an Illness-Death Model. Journal of Statistical Software, 38(3), 1-18. tools:::Rd_expr_doi("10.18637/jss.v038.i03")

See Also

as.data.frame, survTP.

Examples

Run this code
# Set the number of threads
nth <- setThreadsTP(2);

# 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);

# Restore the number of threads
setThreadsTP(nth);

Run the code above in your browser using DataLab