mc_integrand_q_g_r.Rd
This function computes the Monte Carlo integrand for double integration in the InterXshift package. It combines the models for the outcome given mediator and exposure (q_model), the density of the mediator given exposure and covariates (r_model), and the density of the exposure given covariates (g_model).
mc_integrand_q_g_r(
sample_a,
sample_z,
row_data,
covars,
w_names,
q_model,
g_model,
r_model,
exposure,
mediator,
delta,
upper_a,
density_type
)
A vector of sampled exposure values.
A vector of sampled mediator values.
A single row of data containing covariates and outcome.
A character vector of covariate names.
A character vector of baseline covariate names.
An SL object representing the outcome model.
An SL object representing the density model of exposure given covariates.
An SL object representing the density model of mediator given exposure and covariates.
The name of the exposure variable.
The name of the mediator variable.
The exposure shift for the counterfactual calculation.
The upper bound for the exposure.
A string indicating the density estimation method, either "sl" or "nonparametric".
A numeric vector representing the Monte Carlo integrand values for the given sample points.