smry_ssnet | R Documentation |
Using the tidyverse to summarize simulation results.
smry_ssnet(sim.data, output = "raw")
sim.data |
A data frame containing simulation resuls. The data is
intended to be generated from stacking multiple |
output |
When |
A data frame.
## number of simulations
M <- 2
## subj/sim
N <- 30
## image resolution for spatial predictors
ir <- c(5, 5)
L <- sim2Dpredictr::chol_s2Dp(im.res = ir, rho = 0.90,
corr.structure = "ar1",
triangle = "lower")
## generate non-zero parameters with spatial clustering
betas <- sim2Dpredictr::beta_builder(index.type = "ellipse",
w = 2, h = 2,
row.index = 3, col.index = 3,
B.values = 0.5, im.res = ir)
## generate data
set.seed(68741)
for (m in 1:M) {
datm <- sim2Dpredictr::sim_Y_MVN_X(N = N, dist = "gaussian",
L = L$L, S = L$S,
B = betas$B)
mod.out.m <- compare_ssnet(
x = as.matrix(datm[, grep("X.*", names(datm), perl = TRUE)]),
y = datm$Y, models = c("glmnet", "ss"),
s0 = seq(0.01, 0.05), nfolds = 3,
family = "gaussian", model_fit = "all",
variable_selection = TRUE,
B = betas$B[-1],
iar.data = model_info
)
if (m > 1) {
mod.out <- rbind(mod.out, mod.out.m)
} else {
mod.out <- mod.out.m
}
}
## summarize measures of model fitness
smry_ssnet(mod.out)
## just means
smry_ssnet(mod.out, output = "mean")
## just sd
smry_ssnet(mod.out, output = "sd")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.