visit_sum | R Documentation |
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)
pool |
Data table containing all information prior to time |
histvars |
Vector of character strings specifying the names of the variables for which lagged cumulative averages are to be created. |
time_name |
Character string specifying the name of the time variable in |
t |
Integer specifying the current time index. |
id_name |
Character string specifying the name of the ID variable in |
max_visits |
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. |
No value is returned. The data table pool
is modified in place.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.