Function that computes the optimal combination of multiple outcomes and a predictor of the optimal combination using Super Learning.

optWeightEff(Y, X, Z, SL.library.Q, SL.library.g, V = 10,
  return.SuperLearner = FALSE, select = "effect", seed = 12345,
  SuperLearner.V = 10, return.IC = TRUE, parallel = FALSE,
  family = "gaussian", n.cores = parallel::detectCores(), ...)

Arguments

Y

A data.frame of outcomes with each column representing a different outcome

X

A data.frame that will be used to predict each outcome.

Z

A vector of binary treatment assignments (= 0 or 1)

SL.library.Q

A vector or list of the Super Learner library to be used for the outcome regression. See ?SuperLearner for more details. For now the same SL.library is used for prediction of each outcome.

SL.library.g

A vector or list of the Super Learner library to be used for the propensity score. See ?SuperLearner for more details. For now the same SL.library is used for prediction of each outcome.

V

The number of cross validation folds to use to define parameter.

return.SuperLearner

A boolean indicating whether to return the fitted SuperLearner objects for each outcome. Default is TRUE, as these fits are needed for later predictions.

select

A character indicating whether or not to select weights based on the estimated p-value of the effect ("pvalue") or the absolute value of the estimated effect size ("effect").

seed

The seed to set before each internal call to CV.SuperLearner

SuperLearner.V

The number of CV folds for the SuperLearner.

return.IC

A boolean indicating whether to return vectors of cross validated influence curve estimates at the observed data.

parallel

Not developed yet

family

An object of class family equal to either "gaussian" for continuous outcomes or "binomial" for binary outcomes.

n.cores

A numeric indicating how many cores to use if parallel = TRUE. By default will use parallel::detectCores(). Not developed yet.

...

Other arguments

Value

TO DO: Add return documentation.

Examples

# Example 1 -- simple fit set.seed(1234) X <- data.frame(x1=runif(n=500,0,5), x2=runif(n=500,0,5)) Z <- rbinom(500, 1, plogis(-2 + X$x1 + X$x2)) Y1 <- rnorm(500, X$x1 + X$x2 + 1*Z, 1) Y2 <- rnorm(500, X$x1 + X$x2 + 0.25*Z, 1) Y <- data.frame(Y1 = Y1, Y2 = Y2) #example not working yet #fit <- optWeightEff(Y = Y, X = X, Z=Z, SL.library.Q = c("SL.glm","SL.mean"), # SL.library.g = c("SL.glm","SL.mean"))