# \donttest{
library(miselect)
library(mice)
set.seed(48109)
# Using the mice defaults for sake of example only.
mids <- mice(miselect.df, m = 5, printFlag = FALSE)
dfs <- lapply(1:5, function(i) complete(mids, action = i))
# Generate list of imputed design matrices and imputed responses
x <- list()
y <- list()
for (i in 1:5) {
x[[i]] <- as.matrix(dfs[[i]][, paste0("X", 1:20)])
y[[i]] <- dfs[[i]]$Y
}
pf <- rep(1, 20)
adWeight <- rep(1, 20)
fit <- cv.galasso(x, y, pf, adWeight)
# By default 'coef' returns the betas for lambda.min.
coef(fit)
# }
Run the code above in your browser using DataLab