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 based on the specification of the recurrent process and
the terminal events.
Specifically, the rate function,
, of the recurrent process
can be specified as one of the following model:
where is the baseline rate function,
is the baseline hazard function,
is a
by
covariate matrix and
,
is an unobserved shared frailty variable, and
and
correspond to the shape and size parameters of the
rate function and the hazard function, respectively.
Under the default settings, the simGSC()
function assumes
and the regression parameters to be
,
and
.
When the
xmat
argument is not specified, the simGSC()
function
assumes is a two-dimensional vector
,
where
is a Bernoulli variable with rate 0.5 and
is a standard normal variable.
With the default
xmat
, the censoring time $C$ is generated from
an exponential distribution with mean .
Thus, the censoring distribution is covariate dependent and
is informative when
is not a constant.
When the
frailty
argument is not specified, the frailty variable 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
and
, 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:
See online vignette for more examples.
See Also
Examples
set.seed(123)
simGSC(100, summary = TRUE)