This convenience function standardizes a long-format data set and fits one of the standard covariance models. The surrogate and true endpoints may be observed at different times.
fit_longitudinal_surrogate(
data,
model,
formula,
id,
treatment,
time,
endpoint,
outcome,
surrogate_label,
true_label,
treatment_levels = c(0, 1),
covariates = character(0),
residual_type = "exponential",
start_fit = NULL,
control = list(rel.tol = 1e-10, x.tol = 1e-10, eval.max = 5000, iter.max = 3000)
)An object of class surrogate_longitudinal_fit.
A data.frame in long format.
One of the model names accepted by
longitudinal_model_spec().
Fixed-effects formula written in terms of the standardized
response Y.
Column names in data.
Values identifying the two endpoints.
Control and active treatment values, in that order.
Optional additional covariate columns.
Temporal residual-correlation structure.
Optional fitted model used for initialization.
Control list passed to nlminb().
Baseline responses are supplied in the same long data set as the
repeated outcomes, using time = 0; no separate baseline argument is
accepted. The baseline responses contribute to estimation, but time 0 is
never part of the longitudinal ICA evaluation grid.