# \donttest{
# note: iter = 250 for demonstrative purposes
# need this package
library(mice, warn.conflicts = FALSE)
# data
Y <- ptsd[,1:5]
# matrix for indices
mat <- matrix(0, nrow = 221, ncol = 5)
# indices
indices <- which(mat == 0, arr.ind = TRUE)
# Introduce 50 NAs
Y[indices[sample(1:nrow(indices), 50),]] <- NA
# impute
x <- mice(Y, m = 5, print = FALSE)
#########################
####### copula #####
#########################
# rank based parital correlations
# estimate the model
fit_est <- bggm_missing(x,
method = "estimate",
type = "mixed",
iter = 250,
progress = FALSE,
seed = 1234)
# select edge set
E <- select(fit_est)
# plot E
plt_E <- plot(E)$plt
plt_E
# }
Run the code above in your browser using DataLab