sim.ltrc {plac} | R Documentation |
Various baseline survival functions and truncation distribution are
available. Censoring rate can be designated through tuning the parameter
Cmax
; Cmas = Inf
means no censoring.
sim.ltrc(n = 200, b = c(1, 1), time.dep = FALSE, Zv.depA = FALSE, distr.T = "weibull", shape.T = 2, scale.T = 1, meanlog.T = 0, sdlog.T = 1, distr.A = "weibull", shape.A = 1, scale.A = 5, p.A = 0.3, Cmax = Inf, fix.seed = NULL)
n |
the sample size. |
b |
a numeric vector for true regression coefficients. |
time.dep |
logical, whether there is the time-dependent covariate (only one indicator function Zv = I(t >= zeta) is supported); the default is FALSE. |
Zv.depA |
logical, whether the time-dependent covariate |
distr.T |
the baseline survival time (T*) distribution ("exp" or "weibull"). |
shape.T |
the shape parameter for the Weibull distribution of T*. |
scale.T |
the scale parameter for the Weibull distributiof of T*. |
meanlog.T |
the mean for the log-normal distribution of T*. |
sdlog.T |
the sd for the log-normal distribution of T*. |
distr.A |
the baseline truncation time (A*) distribution: either of
|
shape.A |
the shape parameter for the Weibull distribution of A*. |
scale.A |
the scale parameter for the Weibull distribution of A*. |
p.A |
the success probability for the binomial distribution of A*. |
Cmax |
the upper bound of the uniform distribution of the censoring time (C). |
fix.seed |
an optional random seed for simulation. |
a list with a data.frame containing the observed survival times
(Ys
), the observed truncation times (As
), the event indicator
(Ds
) and the covariates (Zs
); a vector of certain quantiles
of Ys (taus
); the censoring proportion (PC
) and the
truncation proportiona (PT
).
# With time-invariant covariates only sim1 = sim.ltrc(n = 100) head(sim1$dat) # With one time-dependent covariate sim2 = sim.ltrc(n = 100, time.dep = TRUE, distr.A = "binomial", p.A = 0.8, Cmax = 5) head(sim2$dat) # With one time-dependent covariate with dependence on the truncation time sim3 = sim.ltrc(n = 100, time.dep = TRUE, Zv.depA = TRUE, Cmax = 5) head(sim3$dat)