Fits a two-stage random effects model for recurrent events with a terminal event. Marginal models (Cox or Ghosh-Lin) are fitted first and passed to this function.
twostageREC(
margsurv,
recurrent,
data = parent.frame(),
theta = NULL,
model = c("full", "shared", "non-shared"),
ghosh.lin = NULL,
theta.des = NULL,
var.link = 0,
method = "NR",
no.opt = FALSE,
weights = NULL,
se.cluster = NULL,
fnu = NULL,
nufix = 0,
nu = NULL,
numderiv = 1,
derivmethod = c("simple", "Richardson"),
...
)An object of class "twostageREC" containing:
Estimated coefficients.
Variance-covariance matrix.
Dependence parameters.
Model type.
Marginal model for the terminal event (object of class "phreg").
Marginal model for recurrent events (object of class "phreg" or "recreg").
Data frame used for fitting.
Starting value for total variance of gamma frailty.
Model type: "full" (fully shared), "shared" (partly shared), or "non-shared".
Logical; if TRUE, forces use of Ghosh-Lin marginals based on the recurrent model.
Regression design for variance parameters.
Link function for variance (1 for exponential).
Optimization method (default "NR").
Logical; if TRUE, skips optimization.
Weights.
Clusters for SE calculation (GEE style).
Function to transform \(\nu\) (amount shared).
Logical; if TRUE, fixes the amount shared.
Starting value for the amount shared.
Logical; if TRUE, uses numerical derivatives.
Method for numerical derivative.
Arguments for the optimizer.
Thomas Scheike
Supports:
Cox/Cox marginals.
Cox/Ghosh-Lin marginals.
Fully shared, partly shared, or non-shared random effects.
Scheike (2026), Two-stage recurrent events random effects models, LIDA, to appear.