% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mcml_pc.R
\name{loading_stability}
\alias{loading_stability}
\title{Composite-Weight Stability Under Case Resampling}
\usage{
loading_stability(x, iter = 200L, ci_level = 0.05, seed = NULL)
}
\arguments{
\item{x}{An \code{mcml_pc} object that carries raw data.}

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

\item{ci_level}{Numeric. Significance level for percentile CIs
(default 0.05).}

\item{seed}{Integer or NULL. RNG seed.}
}
\value{
An object of class \code{"pc_loading_stability"}: a list with
\code{summary} (tidy data frame: \code{node}, \code{cluster},
\code{weight}, \code{boot_mean}, \code{boot_sd}, \code{ci_lower},
\code{ci_upper}, \code{sign_flips} - the proportion of replicates
in which the item's sign differed from the observed one),
\code{boot_weights} (iter x n_nodes matrix), \code{iter}, and
\code{ci_level}. Has print and plot methods.
}
\description{
\strong{Experimental.} Bootstraps the item weights of a
\code{\link{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 \code{"loadings"} macro
network) should not be over-interpreted.
}
\examples{
\donttest{
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
}

}
