This internal function applies the history functions to create new columns in an input data table containing new variables that are functions of the histories of existing variables in the dataset.
make_histories(
pool,
histvars,
histvals,
histories,
time_name,
t,
id,
max_visits,
baselags,
below_zero_indicator
)
No value is returned. The data table pool
is modified in place.
Data table containing all information prior to time \(t\) (\(t\) noninclusive).
List of vectors. The kth vector specifies the names of the variables for which the kth history function
in histories
is to be applied.
List of length two. The first element is a numeric vector specifying the lags used in the model statements (e.g., if lag1_varname
and lag2_varname
were included in the model statements, this vector would be c(1,2)
). The second element is a numeric vector specifying the lag averages used in the model statements.
Vector of history functions to apply to the variables specified in histvars
.
Character string specifying the name of the time variable in pool
.
Integer specifying the current time index.
Character string specifying the name of the ID variable in pool
.
A vector of one or more values denoting the maximum number of times
a binary covariate representing a visit process may be missed before
the individual is censored from the data (in the observed data) or
a visit is forced (in the simulated data). Multiple values exist in the
vector when the modeling of more than covariate is attached to a visit
process. A value of NA
should be provided when there is no visit process.
Logical scalar for specifying the convention used for lagi and lag_cumavgi terms in the model statements when pre-baseline times are not
included in obs_data
and when the current time index, \(t\), is such that \(t < i\). If this argument is set to FALSE
, the value
of all lagi and lag_cumavgi terms in this context are set to 0 (for non-categorical covariates) or the reference
level (for categorical covariates). If this argument is set to TRUE
, the value of lagi and lag_cumavgi terms
are set to their values at time 0. The default is FALSE
.
Logical scalar indicating whether the observed data set contains rows for time \(t < 0\).