Random number generation for Correlated Survival and Survival Outcomes
generate_srv.RdThis 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.
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 copulaClayton: 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 vectoryevent: the event indicator outcome vectoryx: the survival time or censoring time outcome vectorxeventx: the event indicator outcome vectorxt: the true survival time vectory(for simulation)c: the true censoring time vectory(for simulation)tx: the true survival time vectorx(for simulation)cx: the true censoring time vectorx(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