This function assists the implementation of a restriction on a covariate in the data table newdf by setting lines where the covariate is restricted to a user-specified value.
simple_restriction(newdf, pool, restriction, time_name, t,...)
Arguments
newdf: Data table containing the simulated data at time t.
pool: Data table containing the simulated data at times before t.
restriction: List of vectors. Each vector contains as its first entry the covariate affected by the restriction; its second entry the condition that must be TRUE for the covariate to be modeled; its third entry a function that executes other specific actions based on the condition (in this case, this function); and its fourth entry some value used by the function (in this case, the value the user desires to assign to the covariate when it is not modeled).
time_name: Character string specifying the name of the time variable in pool and newdf.
t: Integer specifying the current time index.
...: This argument is not used in this function.
Returns
No value is returned. The data table newdf is modified in place.