Skip to contents

This function generates random number vectors of correlated survival and survival outcomes. Gaussian or Clayton copula is used to specify the correlation structure. Marginal distributions are based on a exponential distribution.

Usage

generate_srv(
  target_tau,
  num_samples,
  censoring_rate,
  censoring_ratex = NULL,
  censtype = c("univariate", "independent"),
  copula_type = c("Gaussian", "Clayton"),
  hr = 1,
  hrx = 1
)

Arguments

target_tau

the target value of the Kendall's \(\tau\)

num_samples

the number of simulation samples

censoring_rate

the censoring rate for y

censoring_ratex

the censoring rate for x

censtype

the type of censoring model for survival and survival outcomes (default = "univariate"; see Lakhal et al. (2009)).

  • univariate: univariate censoring model: \(Y = \min(T, C)\), \(X = \min(T_X, C)\)

  • independent: independent censoring model: \(Y = \min(T, C)\), \(X = \min(T_X, C_X)\)

copula_type

copula type (default = "Gaussian")

  • Gaussian: Gaussian copula

  • Clayton: Clayton copula

hr

the hazard rate for survival time y (default = 1.0)

hrx

the hazard rate for survival time x (default = 1.0)

Value

  • y: the survival time or censoring time outcome vector y

  • event: the event indicator outcome vector y

  • x: the survival time or censoring time outcome vector x

  • eventx: the event indicator outcome vector x

  • t: the true survival time vector y (for simulation)

  • c: the true censoring time vector y (for simulation)

  • tx: the true survival time vector x (for simulation)

  • cx: the true censoring time vector x (for simulation)

Examples

library(surrosurvo)
set.seed(1234)
data <- generate_srv(0.7, 500, 0.1, 0.1)
surrosurvo(data$y, data$event, data$x, data$eventx)
#>   method       tau         se       lcl       ucl
#> 1 taumo1 0.7148613 0.01714432 0.6812591 0.7484636
#> 2 taumo2 0.7145928 0.01415442 0.6868507 0.7423350
#> 3   tauo 0.6606413 0.01579222 0.6296891 0.6915935
#> 4  tauso 0.7148613 0.01714432 0.6812591 0.7484636