plot_centrality_stability: Plot centrality stability diagnostics

View source: R/plot_centrality_stability.R

plot_centrality_stabilityR Documentation

Plot centrality stability diagnostics

Description

Plot centrality stability diagnostics

Usage

plot_centrality_stability(
  caseDroppingBoot,
  nonParametricBoot,
  statistics = "bridgeStrength",
  labels = FALSE,
  color_palette = NULL
)

Arguments

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.

Value

A combined patchwork plot object.

Examples


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)


InterconectaR documentation built on Oct. 16, 2026, 1:06 a.m.