| genCPHM {genSurv} | R Documentation |
Generation of survival data from a Cox Proportional Hazard Model
Description
Generation of survival data from a Cox Proportional Hazard Model.
Usage
genCPHM(n, model.cens, cens.par, beta, covar)
Arguments
n |
Sample size. |
model.cens |
Model for censorship. Possible values are "uniform" and "exponential". |
cens.par |
Parameter for the censorship distribution. Must be greater than 0. |
beta |
Regression parameter for the time-fixed covariate. |
covar |
Parameter for generating the time-fixed covariate. An uniform distribution is used. |
Value
An object with two classes, data.frame and CPHM.
Author(s)
Artur Araújo, Luís Meira Machado and Susana Faria
References
Cox, D.R. (1972). Regression models and life tables. Journal of the Royal Statistical Society: Series B, 34(2), 187-202. doi: 10.1111/j.2517-6161.1972.tb00899.x
Meira-Machado L., Faria S. (2014). A simulation study comparing modeling approaches in an illness-death multi-state model. Communications in Statistics - Simulation and Computation, 43(5), 929-946. doi: 10.1080/03610918.2012.718841
Meira-Machado, L., Sestelo M. (2019). Estimation in the progressive illness-death model: a nonexhaustive review. Biometrical Journal, 61(2), 245–263. doi: 10.1002/bimj.201700200
See Also
Examples
cphmdata <- genCPHM(n=1000, model.cens="exponential", cens.par=2, beta= 2, covar=1)
head(cphmdata, n=20L)
library(survival)
fit<-coxph(Surv(time,status)~covariate,data=cphmdata)
summary(fit)