Select_link_BivCop: Select Best Link Function for Bivariate Copula Survival...

View source: R/LinkFunction_Selection.R

Select_link_BivCopR Documentation

Description

Selects the best link function for bivariate copula survival models based on AIC or BIC measures. It evaluates different margins (link functions) for the survival models and selects the one with the lowest AIC or BIC.

Usage

Select_link_BivCop(
  data,
  cens1,
  cens2,
  lowerBt1 = "t11",
  lowerBt2 = "t21",
  upperBt1 = "t12",
  upperBt2 = "t22",
  measure = "AIC",
  eta1 = NULL,
  eta2 = NULL,
  input_equation = FALSE
)

Arguments

data

A data frame containing the dataset.

cens1

Censoring indicator for the first time to event.

cens2

Censoring indicator for the second time to event.

lowerBt1

Character. Name of the lower bound for the first time to event.

lowerBt2

Character. Name of the lower bound for the second time to event.

upperBt1

Character. Name of the upper bound for the first time to event.

upperBt2

Character. Name of the upper bound for the second time to event.

measure

Character. Measure to be minimized during the selection process. Either 'AIC' or 'BIC'. Default is 'AIC'.

eta1

Formula for the first survival model equation. Default is NULL.

eta2

Formula for the second survival model equation. Default is NULL.

input_equation

Logical. If TRUE, uses the provided eta1 and eta2 formulas. If FALSE, generates formulas using all predictors in data. Default is FALSE.

Value

A list containing:

  • best_margin_S1: The best margin (link function) for the first survival model.

  • measure: The AIC or BIC value for the best margin of the first survival model.

  • model_S1: The fitted model for the first survival model with the best margin.

  • best_margin_S2: The best margin (link function) for the second survival model.

  • measure_S2: The AIC or BIC value for the best margin of the second survival model.

  • model_S2: The fitted model for the second survival model with the best margin.

Examples


###############################################
# Example based on AREDS dataset
# This analysis serves solely as a
# demonstration of the function's capabilities.
###############################################
data(AREDS)

results <- Select_link_BivCop(data = AREDS, cens1 = AREDS$cens1,
                              lowerBt1 = 't11', lowerBt2 = 't21',
                              upperBt1 = 't12', upperBt2 = 't22',
                              cens2 = AREDS$cens2, measure = 'AIC')
print(results)



BRBVS documentation built on June 27, 2024, 5:13 p.m.