Learn R Programming

CopulaCenR (version 1.2.3)

rc_spCox_copula: Copula regression models with Cox semiparametric margins for bivariate right-censored data

Description

Fits a copula model with Cox semiparametric margins for bivariate right-censored data.

Usage

rc_spCox_copula(
  data,
  var_list,
  copula = "Clayton",
  method = "BFGS",
  iter = 500,
  stepsize = 1e-06,
  control = list(),
  B = 100,
  seed = 1
)

Value

a CopulaCenR object summarizing the model. Can be used as an input to general S3 methods including summary, print, plot, lines, coef, logLik, AIC, BIC, fitted, predict.

Arguments

data

a data frame; must have id (subject id), ind (1,2 for two margins), obs_time, status (0 for right-censoring, 1 for event).

var_list

the list of covariates to be fitted into the model.

copula

specify the copula family.

method

optimization method (see ?optim); default is "BFGS"; also can be "Newton" (see ?nlm).

iter

number of iterations when method = "Newton"; default is 500.

stepsize

size of optimization step when method = "Newton"; default is 1e-6.

control

a list of control parameters for methods other than "Newton"; see ?optim.

B

number of bootstraps for estimating standard errors with default 100;

seed

the bootstrap seed; default is 1

Details

The input data must be a data frame with columns id (subject id), ind (1,2 for two margins; each id must have both ind = 1 and 2), obs_time, status (0 for right-censoring, 1 for event) and covariates.

The supported copula models are "Clayton", "Gumbel", "Frank", "AMH", "Joe" and "Copula2". The "Copula2" model is a two-parameter copula model that incorporates Clayton and Gumbel as special cases. The parametric generator functions of copula functions are list below:

The Clayton copula has a generator $$\phi_{\eta}(t) = (1+t)^{-1/\eta},$$ with \(\eta > 0\) and Kendall's \(\tau = \eta/(2+\eta)\).

The Gumbel copula has a generator $$\phi_{\eta}(t) = \exp(-t^{1/\eta}),$$ with \(\eta \geq 1\) and Kendall's \(\tau = 1 - 1/\eta\).

The Frank copula has a generator $$\phi_{\eta}(t) = -\eta^{-1}\log \{1+e^{-t}(e^{-\eta}-1)\},$$ with \(\eta \geq 0\) and Kendall's \(\tau = 1+4\{D_1(\eta)-1\}/\eta\), in which \(D_1(\eta) = \frac{1}{\eta} \int_{0}^{\eta} \frac{t}{e^t-1}dt\).

The AMH copula has a generator $$\phi_{\eta}(t) = (1-\eta)/(e^{t}-\eta),$$ with \(\eta \in [0,1)\) and Kendall's \(\tau = 1-2\{(1-\eta)^2 \log (1-\eta) + \eta\}/(3\eta^2)\).

The Joe copula has a generator $$\phi_{\eta}(t) = 1-(1-e^{-t})^{1/\eta},$$ with \(\eta \geq 1\) and Kendall's \(\tau = 1 - 4 \sum_{k=1}^{\infty} \frac{1}{k(\eta k+2)\{\eta(k-1)+2\}}\).

The Two-parameter copula (Copula2) has a generator $$\phi_{\eta}(t) = \{1/(1+t^{\alpha})\}^{\kappa},$$ with \(\alpha \in (0,1], \kappa > 0\) and Kendall's \(\tau = 1-2\alpha\kappa/(2\kappa+1)\).

The marginal distribution is a Cox semiparametric proportional hazards model. The copula parameter and coefficient standard errors are estimated from bootstrap.

Optimization methods can be all methods (except "Brent") from optim, such as "Nelder-Mead", "BFGS", "CG", "L-BFGS-B", "SANN". Users can also use "Newton" (from nlm).

Examples

Run this code
# fit a Clayton-Cox model
data(DRS)
clayton_cox <- rc_spCox_copula(data = DRS, var_list = "treat",
                            copula = "Clayton", B = 2)
summary(clayton_cox)

Run the code above in your browser using DataLab