Learn R Programming

LongDecompHE (version 0.1.0)

copula_additive: Copula regression models with semiparametric additive hazards margins for bivariate interval censoring and semi-competing risks.

Description

Fits a copula model with semiparametric additive hazards marginsfor bivariate interval censoring and semi-competing risks.

Usage

copula_additive(
  data,
  var_list,
  l1 = 0,
  u1,
  m1 = 3,
  l2 = 0,
  u2,
  m2 = 3,
  method = "Newton",
  iter = 1000,
  stepsize = 1e-05,
  hes = TRUE,
  control = list(),
  eta_ini = NULL
)

Value

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

Arguments

data

a data frame; must have id (subject id), visit (the visit number for the subject), visit_time (the time for each visit in years), status (the disability status at visit_time, 1 for disability, 0 for non-disability), statusD (the death status at visit_time, 1 for dead, 0 for alive), and weight sampling weight and each subject received the same weight across visits.

var_list

the list of covariates to be fitted into the copula model.

l1

Left boundary of event 1 time interval.

u1

Right boundary of event 1 time interval.

m1

Degree of Bernstein polynomial for event 1.

l2

Left boundary of event 2 time interval.

u2

Right boundary of event 2 time interval.

m2

Degree of Bernstein polynomial for event 2.

method

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

iter

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

stepsize

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

hes

default is TRUE for hessian calculation; if LRT is desired, can set hes = FALSE to save time.

control

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

eta_ini

Optional initial values for copula parameters.

Details

must have id (subject id), visit (the visit number for the subject), visit_time (the time for each visit in years), status (the disability status at visit_time, 1 for disability, 0 for non-disability), statusD (the death status at visit_time, 1 for dead, 0 for alive), and weight sampling weight and each subject received the same weight across visits.

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 Copula2-Semiparametric additive hazards model
data(simulated_dataA)
u1 = u2 = max(simulated_dataA$visit_time)
var_list = c("Z1", "Z2", "Z3")
copula_additive_model <-  copula_additive(data = simulated_dataA,
                                        var_list = var_list,
                                        l1=0, u1 = u1, m1 = 3,
                                        l2=0, u2 = u2, m2 = 3,
                                        method = "combined", iter=1000,
                                        stepsize=1e-6,
                                        hes = TRUE,
                                        control = list(maxit = 10000))
summary(copula_additive_model)



Run the code above in your browser using DataLab