data(windspeed)
dat <- as.matrix(windspeed)
## delete some observations
set.seed(123)
dat[sample(1:length(dat), 260)] <- NA
## Impute missing values under normal model
imp <- mice(dat, method = "norm", printFlag = FALSE)
mylabels <- names(imp$imp)
out.fci <- with_graph(data = imp,
algo = "fciPlus",
args = ", indepTest = gaussCItest, verbose = FALSE,
labels = mylabels, alpha = 0.01")
out.ges <- with_graph(data = imp, algo = "ges", arg = NULL, score = TRUE)
if (requireNamespace("Rgraphviz", quietly = TRUE)){
oldpar <- par(mfrow = c(1,2))
plot(out.fci$res[[1]])
plot(out.ges$res[[1]]$essgraph)
par(oldpar)
}
Run the code above in your browser using DataLab