genCPHM: Generation of survival data from a Cox Proportional Hazard...

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/genCPHM.R

Description

Generation of survival data from a Cox Proportional Hazard Model.

Usage

1
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

genCMM, genTDCM, genTHMM.

Examples

1
2
3
4
5
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)

Example output

          time status  covariate
1  0.093355060      1 0.74591486
2  0.483316419      1 0.54393098
3  0.310921504      0 0.32592446
4  0.170772120      0 0.83541308
5  0.290645495      0 0.02046933
6  0.062827879      1 0.96561525
7  0.228600540      1 0.37468999
8  0.821627631      1 0.16619197
9  0.150632126      1 0.57336521
10 0.181897536      1 0.66088332
11 0.299761568      0 0.53281876
12 0.176367153      1 0.91747491
13 0.130438638      0 0.21726206
14 0.007421759      1 0.84614525
15 0.117738733      1 0.68191348
16 0.098838590      1 0.46421456
17 0.438045850      1 0.18512968
18 0.453673607      1 0.53478101
19 0.353637146      0 0.40440112
20 1.400246214      1 0.16540133
Call:
coxph(formula = Surv(time, status) ~ covariate, data = cphmdata)

  n= 1000, number of events= 806 

             coef exp(coef) se(coef)     z Pr(>|z|)    
covariate  2.4044   11.0713   0.1419 16.95   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

          exp(coef) exp(-coef) lower .95 upper .95
covariate     11.07    0.09032     8.384     14.62

Concordance= 0.679  (se = 0.01 )
Likelihood ratio test= 296.6  on 1 df,   p=<2e-16
Wald test            = 287.3  on 1 df,   p=<2e-16
Score (logrank) test = 307.4  on 1 df,   p=<2e-16

genSurv documentation built on Oct. 20, 2021, 1:07 a.m.