intfunc function

Execute Intervention

Execute Intervention

This internal function executes the intervention of interest on the specified intervention variable in the data table newdf.

intfunc(newdf, pool, intervention, intvar, int_time, time_name, t)

Arguments

  • newdf: Data table containing the simulated data at time tt.
  • pool: Data table containing the simulated data at times before tt.
  • intervention: List, whose elements are lists of vectors. Each vector contains a function implementing a particular intervention on a single variable, optionally followed by one or more "intervention values" (i.e., integers used to specify the treatment regime).
  • intvar: Character string specifying the name of the variable to be intervened on in each round of the simulation.
  • int_time: Vector specifying the time points in which the intervention is applied.
  • time_name: Character string specifying the name of the time variable in pool and newdf.
  • t: Integer specifying the current time index.

Returns

No value is returned. The data table newdf is modified in place.