simfdata | R Documentation |
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", ...)
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 |
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:
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
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: h_0(t)=\lambda
and H_0(t)=\lambda t
\;\lambda>0
Gompertz: h_0(t)=\lambda exp(\gamma t)
and H_0(t)=\frac{\lambda}{\gamma}(exp(\gamma t)-1)
;\lambda,\gamma>0
simulated survival data for a single transition
Atanu Bhattacharjee, Bhrigu Kumar Rajbongshi and Gajendra K. Vishwakarma
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.
cphGM
##
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)
##
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.