Simulate single-event survival data with informative censoring
Source:R/single-event.R
sim_data_se.RdGenerates a dataset where event times follow a Weibull distribution
parameterized by a binary treatment covariate x, and censoring depends
on an ancillary biomarker W2 through a shared gamma frailty, inducing
informative censoring using Clayton's copula.
This is the data-generating mechanism used in the
single-event guided example.
Usage
sim_data_se(
n = 500,
alpha = 0.05,
x_prop = 0.5,
a = 2,
sigma = 500,
beta = log(0.25),
lambda = 0.01,
phi = -5
)Arguments
- n
Integer. Number of subjects to simulate. Default is 500.
- alpha
Numeric. Shape parameter for the gamma frailty distribution, which has a fixed rate of 1. Here,
alphadenotes the level of dependence between the survival time and the covariate that drives censoring. A smalleralphaleads to a stronger dependence. This parameter is also related to Kendall's correlation coefficient, \(\tau\), such that \(\tau = (1/\alpha)/(1/\alpha + 2)\). Default is0.05.- x_prop
Numeric in (0, 1). Probability of treatment (
x = 1). Default is0.5.- a
Numeric. Weibull shape parameter for the event time distribution. Default is
2.- sigma
Numeric. Weibull scale parameter for the event time distribution. Default is
500.- beta
Numeric. Log hazard ratio for the treatment effect on event time. Default is
log(0.25).- lambda
Numeric. Baseline censoring rate when W2=0. Default is
0.01.- phi
Numeric. The log hazard ratio for the association between a one-unit increase in
W2and censoring time. Negative values mean higherW2leads to a lower censoring rate (i.e., longer follow-up for high-W2subjects). Default is-5.