merge_vim | R Documentation |
vim
objects into oneTake the output from multiple different calls to vimp_regression
and
merge into a single vim
object; mostly used for plotting results.
merge_vim(...)
... |
an arbitrary number of |
an object of class vim
containing all of the output
from the individual vim
objects. This results in a list containing:
s - a list of the column(s) to calculate variable importance for
SL.library - a list of the libraries of learners passed to SuperLearner
full_fit - a list of the fitted values of the chosen method fit to the full data
red_fit - a list of the fitted values of the chosen method fit to the reduced data
est- a vector with the corrected estimates
naive- a vector with the naive estimates
eif- a list with the influence curve-based updates
se- a vector with the standard errors
ci- a matrix with the CIs
mat - a tibble with the estimated variable importance, the standard errors, and the (1-α) \times 100% confidence intervals
full_mod - a list of the objects returned by the estimation procedure for the full data regression (if applicable)
red_mod - a list of the objects returned by the estimation procedure for the reduced data regression (if applicable)
alpha - a list of the levels, for confidence interval calculation
# generate the data # generate X p <- 2 n <- 100 x <- data.frame(replicate(p, stats::runif(n, -5, 5))) # apply the function to the x's smooth <- (x[,1]/5)^2*(x[,1]+7)/5 + (x[,2]/3)^2 # generate Y ~ Normal (smooth, 1) y <- smooth + stats::rnorm(n, 0, 1) # set up a library for SuperLearner; note simple library for speed library("SuperLearner") learners <- c("SL.glm", "SL.mean") # using Super Learner (with a small number of folds, for illustration only) est_2 <- vimp_regression(Y = y, X = x, indx = 2, V = 2, run_regression = TRUE, alpha = 0.05, SL.library = learners, cvControl = list(V = 2)) est_1 <- vimp_regression(Y = y, X = x, indx = 1, V = 2, run_regression = TRUE, alpha = 0.05, SL.library = learners, cvControl = list(V = 2)) ests <- merge_vim(est_1, est_2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.