find_synergy_antagonism.Rd
The find_synergy_antagonism
function provides a g-computation approach to finding interactions.
This implementation fits an SL and then predicts two way joint shifts in exposures and compares this to individual shifts,
ranks the interactions based on the difference and then this becomes the interactions we want to estimate
using CV-TMLE.
find_synergy_antagonism(
data,
deltas,
a_names,
w_names,
outcome,
outcome_type,
mu_learner,
top_n = 3,
seed
)
A data.frame
containing all the variables needed for the analysis, including
baseline covariates, exposures, and the outcome.
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.
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
specifying the number of top positive and negative effects to return.
An integer
value to set the seed for reproducibility.
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)
}