data_sim_copula {CopulaCenR}R Documentation

Simulate bivariate time-to-event times based on specific copula and marginal distributions

Description

To generate a sample of subjects with two correlated event times based on specific copula and marginal models

Usage

data_sim_copula(n, copula, eta, dist, baseline, var_list, COV_beta, x1, x2)

Arguments

n

sample size

copula

types of copula, including "Clayton", "Gumbel", "Frank", "AMH", "Joe"

eta

copula parameter η\eta

dist

marginal distributions, including "Weibull", "Gompertz", "Loglogistic"

baseline

marginal distribution parameters. For Weibull and Loglogistic, it shall be λ\lambda (scale) and kk (shape); for Gompertz, it shall be aa (shape) and bb (rate)

var_list

a vector of covariate names; assume the same covariates for two margins

COV_beta

a vector of regression coefficients corresponding to var_list; assume the same coefficients between two margins

x1

a data frame of covariates for margin 1; it shall have n rows, with columns corresponding to the var_list

x2

a data frame of covariates for margin 2

Details

The parametric generator functions of copula functions are list below:

The Clayton copula has a generator

ϕη(t)=(1+t)1/η,\phi_{\eta}(t) = (1+t)^{-1/\eta},

with η>0\eta > 0 and Kendall's τ=η/(2+η)\tau = \eta/(2+\eta).

The Gumbel copula has a generator

ϕη(t)=exp(t1/η),\phi_{\eta}(t) = \exp(-t^{1/\eta}),

with η1\eta \geq 1 and Kendall's τ=11/η\tau = 1 - 1/\eta.

The Frank copula has a generator

ϕη(t)=η1log{1+et(eη1)},\phi_{\eta}(t) = -\eta^{-1}\log \{1+e^{-t}(e^{-\eta}-1)\},

with η0\eta \geq 0 and Kendall's τ=1+4{D1(η)1}/η\tau = 1+4\{D_1(\eta)-1\}/\eta, in which D1(η)=1η0ηtet1dtD_1(\eta) = \frac{1}{\eta} \int_{0}^{\eta} \frac{t}{e^t-1}dt.

The AMH copula has a generator

ϕη(t)=(1η)/(etη),\phi_{\eta}(t) = (1-\eta)/(e^{t}-\eta),

with η[0,1)\eta \in [0,1) and Kendall's τ=12{(1η)2log(1η)+η}/(3η2)\tau = 1-2\{(1-\eta)^2 \log (1-\eta) + \eta\}/(3\eta^2).

The Joe copula has a generator

ϕη(t)=1(1et)1/η,\phi_{\eta}(t) = 1-(1-e^{-t})^{1/\eta},

with η1\eta \geq 1 and Kendall's τ=14k=11k(ηk+2){η(k1)+2}\tau = 1 - 4 \sum_{k=1}^{\infty} \frac{1}{k(\eta k+2)\{\eta(k-1)+2\}}.

The marginal survival distributions are listed below:

The Weibull (PH) survival distribution is

exp{(t/λ)keZβ},\exp \{-(t/\lambda)^k e^{Z^{\top}\beta}\},

with λ>0\lambda > 0 as scale and k>0k > 0 as shape.

The Gompertz (PH) survival distribution is

exp{ba(eat1)eZβ},\exp \{-\frac{b}{a}(e^{at}-1) e^{Z^{\top}\beta}\},

with a>0a > 0 as shape and b>0b > 0 as rate

The Loglogistic (PO) survival distribution is

{1+(t/λ)keZβ}1,\{1+(t/\lambda)^{k} e^{Z^{\top}\beta} \}^{-1},

with λ>0\lambda > 0 as scale and k>0k > 0 as shape.

Value

a data frame of bivariate time-to-event data with covariates

Examples

library(CopulaCenR)
set.seed(1)
dat <- data_sim_copula(n = 500, copula = "Clayton", eta = 3,
                       dist = "Weibull", baseline = c(0.1,2),
                       var_list = c("var1", "var2"),
                       COV_beta = c(0.1, 0.1),
                       x1 = cbind(rnorm(500, 6, 2),
                                  rbinom(500, 1, 0.5)),
                       x2 =  cbind(rnorm(500, 6, 2),
                                   rbinom(500, 1, 0.5)))
plot(x = dat$time[dat$ind == 1], y = dat$time[dat$ind == 2],
     xlab = expression(t[1]), ylab = expression(t[2]),
     cex.axis = 1, cex.lab = 1.3)

[Package CopulaCenR version 1.2.3 Index]