Integrate functions m and g using monte carlo method

integrate_q_g(
  av,
  at,
  covars,
  w_names,
  q_model,
  g_model,
  exposure,
  g_delta,
  m_delta,
  n_samples,
  density_type,
  lower_bound,
  upper_bound,
  integration_method = "MC"
)

Arguments

av

Validation data

at

Training data

covars

The mediator variable

w_names

Covariate names

q_model

A character vector covariates to adjust for.

g_model

The training data

exposure

A numeric indicating the magnitude of the shift to be computed for the exposure A. This is passed to the internal

g_delta

Shift in exposure in the g model

m_delta

Shift in exposure in the m model

n_samples

Number of samples for MC integration

density_type

Type of density estimation

lower_bound

Lower bound of exposure

upper_bound

Upper bound of exposure

integration_method

Type of integration method to use

Value

A data.table with two columns, containing estimates of the outcome mechanism at the natural value of the exposure Q(A, W) and an upshift of the exposure Q(A + delta, W).

Details

Does the double integration as described in lemma 1