Simulation of two-stage recurrent events data based on Cox/Cox or Cox/Ghosh-Lin structure. type=3 will generate Cox/Cox twostage mode, type=2 will generate Ghosh-Lin/Cox model. If the variance is var.z=0, then generates data without any dependence or frailty. If model="twostage" then default is to generate data from Ghosh-Lin/Cox model, and if type=3 then will generate data with marginal Cox models (Cox/Cox). Simulation based on linear aproximation of hazard for two-stage models based on grid on time-scale. Must be sufficientyly fine.
simGLcox(
n,
base1,
drcumhaz,
var.z = 0,
r1 = NULL,
rd = NULL,
rc = NULL,
fz = NULL,
fdz = NULL,
model = c("twostage", "frailty", "shared"),
type = NULL,
share = 1,
cens = NULL,
nmin = 100,
nmax = 1000
)
number of id's
baseline for cox/ghosh-lin models
baseline for terminal event
variance of gamma frailty
relative risk term for baseline
relative risk term for terminal event
relative risk term for censorings
possible transformation (function) of frailty term
possible transformation (function) of frailty term for death
twostage, frailty, shared (partly shared two-stage model)
type of simulation, default is decided based on model
to fit patly shared random effects model
censoring rate for exponential censoring
default 100, at least nmin or number of rows of the two-baselines max(nmin,nrow(base1),nrow(drcumhaz)) points in time-grid from 0 to maximum time for base1
default 1000, at most nmax points in time-grid
Must specify baselines of recurrent events and terminal event and possible covariate effects.
Scheike (2024), Twostage recurrent events models, under review.