Learn R Programming

Surrogate (version 3.4.4)

fit_longitudinal_surrogate: Fit a standard bivariate longitudinal surrogate model

Description

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.

Usage

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)
)

Value

An object of class surrogate_longitudinal_fit.

Arguments

data

A data.frame in long format.

model

One of the model names accepted by longitudinal_model_spec().

formula

Fixed-effects formula written in terms of the standardized response Y.

id, treatment, time, endpoint, outcome

Column names in data.

surrogate_label, true_label

Values identifying the two endpoints.

treatment_levels

Control and active treatment values, in that order.

covariates

Optional additional covariate columns.

residual_type

Temporal residual-correlation structure.

start_fit

Optional fitted model used for initialization.

control

Control list passed to nlminb().

Details

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.