## Not run: ------------------------------------
#
# # Fit Mixed Graphical Model to Bootstrap Samples of the autism dataset
# rs_obj <- rs.mgm(data = autism_data$data,
# type = autism_data$type,
# lev = autism_data$lev,
# VAR = FALSE, # fit mgm model
# B = 10,
# N = nrow(autism_data$data), # for classical bootstrap
# replace=TRUE)
#
# # Summary of bootstrapped edge weights
# summary(rs_obj)
#
# # Plot bootstrapped edge weights using boxplots
# plot(rs_obj)
#
# # Pairwise scatter plots between bootstrapped edge weights to detect trade-offs
# # ... in the case of correlated predictors (negative correlation between weights)
#
# ind <- unlist(rs_obj$edgeNonZero) # only consider edges with nonzero estimates
# m_bweights <- do.call(cbind, rs_obj$edgeWeights)[, ind] # B x k matrix, with k edges
# colnames(m_bweights) <- unlist(rs_obj$edgeNames)[ind] # add edge names
#
# library(psych) # psych package for pairs
# pairs.panels(m_bweights)
# # (recommended to print a PDF, because this can be a huge plot:
# # pdf('filename.pdf', 20, 20))
# # ... plotting
# # dev.off()
#
#
#
## ---------------------------------------------
Run the code above in your browser using DataLab