This internal function assists in the implementation of a visit process by creating a covariate,
ts_visit
, that counts the number of visits in the past max_visits
time points. If this
number is greater than 0, then the individual has not missed more than the maximum number
of visits.
visit_sum(pool, histvars, time_name, t, id_name, max_visits)
No value is returned. The data table pool
is modified in place.
Data table containing all information prior to time \(t\) (\(t\) noninclusive).
Vector of character strings specifying the names of the variables for which lagged cumulative averages are to be created.
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.