The function simSC
generates simulated recurrent event data from either
a Cox-type model, an accelerated mean model, or a scale-change model.
The censoring time could be either independent (given covariates) or informative.
The simulated data is used for illustration.
simSC(n, a, b, indCen = TRUE, type = c("cox", "am", "sc"), tau = 60,
zVar = 0.25, summary = FALSE)
number of observation.
a numeric vector of parameter of length 2.
a numeric vector of parameter of length 2.
a logical value indicating whether the censoring assumption is imposed.
When indCen = TRUE
, we set \(Z = 1\).
Otherwise, \(Z\) is generated from a unit-mean gamma distribution
See Details.
a character string specifying the underlying model. See Details
a numeric value specifying the maximum observation time.
a numeric variable specifying the variance of \(Z\). This is only needed when \(indCen\) is TRUE. The default value is 0.25.
a logical value indicating whether a brief data summary will be printed.
The function simSC
generates simulated recurrent event data under different
scenarios based on the following assumptions.
See Details in reReg
for a more complete model assumptions.
type = "cox"
generates recurrent event data from a Cox-type model with $$\lambda(t) = Z \lambda_0(t) e^{X^\top a}, h(t) = Zh_0(t)e^{X^\top b}.$$
type = "am"
generates recurrent event data from an accelerated mean model with $$\lambda(t) = Z \lambda_0(te^{X^\top a}) e^{X^\top a}, h(t) = Zh_0(te^{X^\top b})e^{X^\top b}.$$
type = "sc"
generates recurrent event data from a generalized scale-change model with $$\lambda(t) = Z \lambda_0(te^{X^\top a}) e^{X^\top b}, h(t) = Zh_0(te^{X^\top a})e^{X^\top b}.$$
Let \(D\) be the informative failure time with the above hazard function.
An non-informative failure time, \(C\), is generated separately from an
exponential distribution with mean 80.
The observed follow-up time is then taken to be \(min(D, C, \tau)\).
We further assume
$$\lambda_0(t) = \frac{2}{1 + t}, h_0(t) = \frac{1}{8(1 + t)}.$$
Two covariates are considered; x1
follows a Bernoulli distribution
with probability 0.5 and x2
follows a standard normal distribution.
# NOT RUN {
set.seed(123)
simSC(200, c(-1, 1), c(-1, 1), summary = TRUE)
# }
Run the code above in your browser using DataLab