Converts the input survival data with one row or element corresponding to a
single observation or subject into a long-form dataset where one observation or subject
contributes j
rows, where j
is the number of time intervals that
a subject survived at least part-way through.
survival_data(y, X, Z, group, offset_fit = NULL, survival_options)
response, which must be a Surv
object (see
Surv
from the survival
package)
matrix of fixed effects covariates
matrix of random effects covariates
vector specifying the group assignment for each subject
vector specifying the offset.
This can be used to specify an a priori known component to be included in the
linear predictor during fitting. Default set to NULL
(no offset). If the data
argument is not NULL
, this should be a numeric vector of length equal to the
number of cases (the length of the response vector).
a structure of class "survivalControl" created
from function survivalControl
that specifies several parameters needed to
properly fit the input survival data using a piecewise constant hazard mixed model. See the
documentation for survivalControl
for more details on defaults.