This function is a helper function for fit_LOCF_landmark
.
fit_LOCF_longitudinal(
data_long,
x_L,
covariates,
covariates_time,
cv_name = NA,
individual_id
)
Data frame in long format i.e. there may be more than one row per individual
Numeric specifying the landmark time(s)
Vector of character strings specifying the column names in data_long
which correspond to the covariates
Vector of character strings specifying the column names in data_long
which contain the times at which covariates
were recorded. This should either be length 1 or
the same length as covariates
. In the latter case the order of elements must correspond to the
order of elements in covariates
.
Character string specifying the column name in data_long
that indicates cross-validation fold
Character string specifying the column name in data_long
which contains the individual identifiers
List containing data_longitudinal
, model_longitudinal
, and call
.
data_longitudinal
has one row for each individual in data_long
and
contains the LOCF value of covariates
at the landmark time x_L
.
model_longitudinal
indicates that the LOCF approach is used.
call
contains the call of the function.
This function extracts the LOCF value for each of the covariates
in data_long
up to (and including) time x_L
.