View source: R/plot_centrality_stability.R
| plot_centrality_stability | R Documentation |
Plot centrality stability diagnostics
plot_centrality_stability(
caseDroppingBoot,
nonParametricBoot,
statistics = "bridgeStrength",
labels = FALSE,
color_palette = NULL
)
caseDroppingBoot |
Case-dropping bootstrap result object. |
nonParametricBoot |
Non-parametric bootstrap result object. |
statistics |
Character string specifying the statistic (default: "bridgeStrength"). |
labels |
Logical; whether to show labels (default: FALSE). |
color_palette |
Optional character vector of colors for the statistics. If NULL (default), uses bootnet's default colors. Length should match the number of statistics being plotted. |
A combined patchwork plot object.
set.seed(123)
n <- 300
f1 <- rnorm(n)
f2 <- 0.3 * f1 + rnorm(n)
items <- data.frame(
sapply(1:4, function(i) 0.7 * f1 + rnorm(n, 0, 0.7)),
sapply(1:4, function(i) 0.7 * f2 + rnorm(n, 0, 0.7))
)
names(items) <- c(paste0("A", 1:4), paste0("B", 1:4))
net <- bootnet::estimateNetwork(items, default = "EBICglasso")
case_boot <- bootnet::bootnet(net, nBoots = 20, type = "case",
statistics = c("bridgeStrength", "strength"),
communities = rep(c("A", "B"), each = 4),
nCores = 1, verbose = FALSE)
edge_boot <- bootnet::bootnet(net, nBoots = 20, nCores = 1, verbose = FALSE)
plot_centrality_stability(case_boot, edge_boot)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.