find_min_concentrations.Rd
The find_min_concentrations
function provides a g-computation approach to finding minimal shift interventions.
This function fits a super learner, then for a grid of exposure levels, predicts the expected outcome. It selects the exposure levels
which produce an outcome target within epsilon which are closest to the exposure averages under no shift.
find_min_concentrations(
data,
a_names,
w_names,
outcome,
outcome_type,
mu_learner,
target_outcome_lvl,
epsilon,
seed
)
A data.frame
containing all the variables needed for the analysis, including
baseline covariates, exposures, and the outcome.
A character
vector specifying the names of the exposure variables within data
.
A character
vector specifying the names of the covariate variables within data
.
The name of the outcome variable in data
.
A character
string indicating the type of the outcome variable; either "continuous",
"binary", or "count".
A list of Lrnr_sl
learners specifying the ensemble machine learning models to be used
for outcome prediction within the Super Learner framework.
An integer
value to set the seed for reproducibility.
A named list
or vector
specifying the shift in exposures to define the target parameter.
Each element should correspond to an exposure variable specified in a_names
, detailing the amount
by which that exposure is to be shifted.
An integer
specifying the number of top positive and negative effects to return.
A list containing the top effects and interactions identified and estimated by the function. It includes elements for top positive and negative individual effects as well as top synergistic and antagonistic interactions.
if (FALSE) {
data <- data.frame(matrix(rnorm(100 * 10), ncol = 10))
names(data) <- c(paste0("X", 1:8), "exposure", "outcome")
deltas <- list(exposure = 0.1)
a_names <- "exposure"
w_names <- paste0("X", 1:8)
outcome <- "outcome"
outcome_type <- "continuous"
mu_learner <- list(sl3::Lrnr_mean$new(), sl3::Lrnr_glm$new())
top_n <- 3
seed <- 123
results <- find_synergy_antagonism(data, deltas, a_names, w_names, outcome, outcome_type, mu_learner, top_n, seed)
print(results)
}