genCPHM {genSurv} | R Documentation |
Generation of survival data from a Cox Proportional Hazard Model.
genCPHM(n, model.cens, cens.par, beta, covar)
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. |
An object with two classes, data.frame
and CPHM
.
Artur Araújo, Luís Meira Machado and Susana Faria
Cox, D.R. (1972). Regression models and life tables (with discussion). Journal of the Royal Statistical Society, Series B 34:187-220.
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)