intfunc: Execute Intervention

View source: R/interventions.R

intfuncR Documentation

Execute Intervention

Description

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

Usage

intfunc(newdf, pool, intervention, intvar, int_time, 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.

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.

Value

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


CausalInference/gfoRmula documentation built on Oct. 1, 2024, 8:36 p.m.