loading_stability: Composite-Weight Stability Under Case Resampling

View source: R/mcml_pc.R

loading_stabilityR Documentation

Composite-Weight Stability Under Case Resampling

Description

Experimental. Bootstraps the item weights of a build_mcml_pc fit: rows of the raw data are resampled, the node-level network is re-estimated each time, and the connectivity-based composite weights are recomputed. Wide intervals mean the weighting (and therefore the "loadings" macro network) should not be over-interpreted.

Usage

loading_stability(x, iter = 200L, ci_level = 0.05, seed = NULL)

Arguments

x

An mcml_pc object that carries raw data.

iter

Integer. Bootstrap replicates (default 200; node-level re-estimation makes this heavier than a plain bootstrap).

ci_level

Numeric. Significance level for percentile CIs (default 0.05).

seed

Integer or NULL. RNG seed.

Value

An object of class "pc_loading_stability": a list with summary (tidy data frame: node, cluster, weight, boot_mean, boot_sd, ci_lower, ci_upper, sign_flips - the proportion of replicates in which the item's sign differed from the observed one), boot_weights (iter x n_nodes matrix), iter, and ci_level. Has print and plot methods.

Examples


set.seed(1)
df <- as.data.frame(matrix(rnorm(600), 100, 6))
names(df) <- c("a1", "a2", "a3", "b1", "b2", "b3")
cl <- list(A = c("a1", "a2", "a3"), B = c("b1", "b2", "b3"))
fit <- build_mcml_pc(df, cl, aggregation = "loadings",
                     method = "cor")
ls <- loading_stability(fit, iter = 50, seed = 1)
ls$summary



Nestimate documentation built on July 11, 2026, 1:09 a.m.