simGSC {reReg} | R Documentation |
Function to generate simulated recurrent event data
Description
The function simGSC()
generates simulated recurrent event data from either
a Cox-type model, an accelerated mean model, an accelerated rate model, or a generalized scale-change model.
Usage
simGSC(
n,
summary = FALSE,
para,
xmat,
censoring,
frailty,
tau,
origin,
Lam0,
Haz0
)
Arguments
n |
number of observation. |
summary |
a logical value indicating whether a brief data summary will be printed. |
para |
a list of numerical vectors for the regression coefficients
in the joint scale-change model.
The names of the list elements are |
xmat |
an optional matrix specifying the design matrix. |
censoring |
a numeric variable specifying the censoring times for each of the
|
frailty |
a numeric variable specifying the frailty variable. |
tau |
a numeric value specifying the maximum observation time. |
origin |
a numeric value specifying the time origin. |
Lam0 |
is an optional function that specifies the baseline cumulative rate function. When left-unspecified, the recurrent events are generated using the baseline rate function of
or equivalently, the cumulative rate function of
|
Haz0 |
is an optional function that specifies the baseline hazard function. When left-unspecified, the recurrent events are generated using the baseline hazard function
or equivalently, the cumulative hazard function of
|
Details
The function simGSC()
generates simulated recurrent event data over
the interval (0, \tau)
based on the specification of the recurrent process and
the terminal events.
Specifically, the rate function, \lambda(t)
, of the recurrent process
can be specified as one of the following model:
\lambda(t) = Z \lambda_0(te^{X^\top\alpha}) e^{X^\top\beta}, h(t) = Z h_0(te^{X^\top\eta})e^{X^\top\theta},
where \lambda_0(t)
is the baseline rate function,
h_0(t)
is the baseline hazard function,
X
is a n
by p
covariate matrix and \alpha
,
Z
is an unobserved shared frailty variable, and
(\alpha, \eta)
and (\beta, \theta)
correspond to the shape and size parameters of the
rate function and the hazard function, respectively.
Under the default settings, the simGSC()
function assumes p = 2
and the regression parameters to be \alpha = \eta = (0, 0)^\top
,
and \beta = \theta = (1, 1)^\top
.
When the xmat
argument is not specified, the simGSC()
function
assumes X_i
is a two-dimensional vector X_i = (X_{i1}, X_{i2}), i = 1, \ldots, n
,
where X_{i1}
is a Bernoulli variable with rate 0.5 and
X_{i2}
is a standard normal variable.
With the default xmat
, the censoring time $C$ is generated from
an exponential distribution with mean \tau X_{i1} + Z^2\tau(1 - X_{i1})
.
Thus, the censoring distribution is covariate dependent and
is informative when Z
is not a constant.
When the frailty
argument is not specified, the frailty variable Z
is generated
from a gamma distribution with a unit mean and a variance of 0.25.
The default values for tau
and origin
are 60 and 0, respectively.
When arguments Lam0
and Haz0
are left unspecified,
the simGSC()
function uses \Lambda_0(t) = 2\log(1 + t)
and H_0(t) = \log(1 + t) / 5
, respectively.
This is equivalent to setting
Lam0 = function(x) 2 * log(1 + x)
and Haz0 = function(x) log(1 + x) / 5
.
Overall, the default specifications generate the recurrent events and the terminal events
from the model:
\lambda(t) = \displaystyle \frac{2Z}{1 + te^{-X_{i1} - X_{i2}}},
h(t) = \displaystyle \frac{Z}{5(1 + te^{X_{i1} + X_{i2}})}, t\in[0, 60].
See online vignette for more examples.
See Also
Examples
set.seed(123)
simGSC(100, summary = TRUE)