simfdata function

simulation of survival data

simulation of survival data

function for simulation of survival data assuming the data comes from a parametric coxph model with gamma frailty distribution

simfdata(n, beta, fvar, bhdist = "weibull", X, fdist = "gamma", ...)

Arguments

  • n: number of individual
  • beta: vector of regression coefficient for coxph model
  • fvar: frailty variance value(currently the function works for gamma frailty only)
  • bhdist: distribution of survival time at baseline e.g. "weibull","exponential","llogistic"
  • X: model matrix for the coxPH model with particular choice of beta
  • fdist: distribution of frailty terms e.g. "gamma"
  • ...: user can assume the shape and scale parameter of baseline survival distribution

Returns

simulated survival data for a single transition

Details

The process for simulation of multistate survival data is described in our manuscript. As the process includes transition through different states and it involves simulating survival time in different transition. So we have demonstrated the code for simulation of simple survival model. Suppose we want to simulate a survival data with parametric baseline hazard and parametric frailty model. The hazard model is as follows:

hi(t)=zih0(t)exp(xiβ)  ;i=1,2,3,...,n h_i(t)=z_ih_0(t)exp(\textbf{x}_i\beta)\;;i=1,2,3,...,n

where the baseline survival time follow Weibull distribution and the hazard is

h0(t)=ρλtρ1 h_0(t)=\rho \lambda t^{\rho-1}

. Similarly we can have Gompertz, log logistic distribution. The following are the formula for hazard and cummulative hazard function For exponential: h0(t)=λh_0(t)=\lambda and H0(t)=λtH_0(t)=\lambda t;λ>0\lambda>0

Gompertz: h0(t)=λexp(γt)h_0(t)=\lambda exp(\gamma t) and H0(t)=λγ(exp(γt)1)H_0(t)=\frac{\lambda}{\gamma}(exp(\gamma t)-1);λ,γ>0\lambda,\gamma>0

Examples

## n1<-1000 p1<-2 X1<-matrix(rnorm(n1*p1),n1,p1) simulated_data<-simfdata(n=1000,beta=c(0.5,0.5),fvar=0.5, X=X1) ##

References

Vishwakarma, G. K., Bhattacherjee, A., Rajbongshi, B. K., & Tripathy, A. (2024). Censored imputation of time to event outcome through survival proximity score method. Journal of Computational and Applied Mathematics, 116103;

Bhattacharjee, A., Vishwakarma, G. K., Tripathy, A., & Rajbongshi, B. K. (2024). Competing risk multistate censored data modeling by propensity score matching method. Scientific Reports, 14(1), 4368.

See Also

cphGM

Author(s)

Atanu Bhattacharjee, Bhrigu Kumar Rajbongshi and Gajendra K. Vishwakarma

  • Maintainer: Atanu Bhattacharjee
  • License: GPL-3
  • Last published: 2024-12-13

Useful links