| build_mcml_pc | R Documentation |
Experimental. Aggregates a node-level psychometric network
(correlation, partial correlation, or EBICglasso) into a cluster-level
macro network plus per-cluster within networks - the MCML view that
build_mcml provides for transition networks, adapted to
the statistics of undirected association networks. The API and the
exact aggregation formulas may change between releases.
Unlike transition counts, partial correlations do not aggregate by
arithmetic: the submatrix of a pcor matrix is not the pcor
network of the subsystem (the conditioning set changes), and averaging
pcor entries across blocks is descriptive only. The five
aggregation methods therefore have explicitly different
statuses:
"average" (descriptive)Macro edge A–B = mean of the signed node-level weights between members of A and members of B; macro diagonal = mean within-block off-diagonal weight. Needs only the weight matrix (works on data-less netobjects). Caveat: signed averaging can cancel opposite-sign edges; interpret as net average association, not connectivity strength.
"composite" (re-estimated)Per-observation cluster
scores = (optionally standardized) mean of member variables; the
chosen method is then re-fit on the k composite columns,
so the macro network is a genuine correlation / pcor / EBICglasso
network among clusters. Requires raw data.
"loadings" (re-estimated, connectivity-weighted)As
"composite", but member variables are weighted by their
within-cluster connection strength in the node-level network (the
absolute summed weight to the other members of their own cluster,
normalized to sum to 1 per cluster). Nodes that anchor their
cluster contribute more to its composite. This is Nestimate's own
weighting - related in spirit to network loadings
(Christensen & Golino 2021) but not a reimplementation of any
EGA-family estimator. Requires raw data.
"rv" (descriptive, multivariate)Macro edge A–B =
Escoufier's RV coefficient between the member blocks - a matrix
correlation in [0, 1] computed from the block covariance
structure. No composites are formed and no estimator is re-fit,
so nothing is lost to averaging; signs are not represented.
Requires raw data.
"canonical" (descriptive, multivariate)Macro edge A–B = the first canonical correlation between the member blocks: the strongest linear relationship any weighting of A's items can have with any weighting of B's items - an upper bound on what composite methods can recover. Requires raw data.
build_mcml_pc(
x,
clusters,
aggregation = c("scaled", "composite", "mean", "median", "loadings", "average",
"escoufier", "cancor"),
method = c("pcor", "glasso", "cor"),
within = c("reestimate", "subnetwork"),
weighting = c("equal", "strength", "eigen", "closeness", "betweenness",
"expected_influence", "specificity", "pca", "factor", "item_total"),
cor_method = c("pearson", "spearman", "polychoric"),
signed = TRUE,
id_col = NULL,
fa_method = c("ml", "paf", "minres", "cfa"),
...
)
x |
A |
clusters |
Cluster membership in any of three forms: a named list of
node-label vectors (names = cluster labels); a two-column
|
aggregation |
Character. How clusters are collapsed to the macro
network. Default
|
method |
Character. Network estimator for the re-estimation
paths and for data.frame input: |
within |
Character. |
weighting |
Character. How items are weighted inside their
cluster score (the score paths
Custom weightings: Network-based and data-based weightings answer different questions; comparing them is informative - divergence means the network's view of the cluster differs from its latent-variable view. Schemes with inherently non-negative weights (equal, closeness, betweenness, specificity) keep the eigenvector-based item signs; sign-carrying schemes (eigen, pca, factor, expected_influence, item_total, custom) use their own. |
cor_method |
Character. Correlation type for estimation from raw
data: |
signed |
Logical. Flip reverse-keyed items in composites
(default |
id_col |
Character vector or NULL. Identifier column(s) to drop
from data.frame input before analysis (e.g., the |
fa_method |
Character. Extraction method for
On well-behaved unidimensional clusters the four agree closely; divergence indicates Heywood-prone or non-unidimensional clusters. |
... |
Further arguments forwarded directly to the
|
Item diagnostics. Whenever raw data or a node-level network
is available, every item's connection strength to every cluster
is computed. The $loadings table reports, per item: its signed
own-cluster loading, its composite weight, its strongest cross-cluster
loading, and a misfit flag set when the cross-cluster loading
exceeds the own-cluster loading - evidence the item is assigned to the
wrong cluster. Misfit items trigger a warning; every aggregation
silently inherits a bad membership, so fix the assignment rather than
ignoring the flag.
Reverse-keyed items. With signed = TRUE (default),
items whose summed within-cluster association is negative are flipped
(their standardized values enter composites with weight sign -1), so a
reverse-keyed item reinforces its cluster composite instead of
cancelling it. Flips are reported in the sign column and via a
warning.
Missing data. Composites are per-row weighted means over the
observed members (weights renormalized per row); rows with no
observed member yield NA and are dropped by the estimator with
a message. Node-level estimation applies the estimators' own
complete-case handling.
Ordinal items. cor_method = "polychoric" (requires the
lavaan package) estimates the node-level and within-cluster
networks from polychoric correlations - appropriate for Likert items.
Composites are continuous sums, so the macro re-estimation uses
Pearson correlations of the composites regardless.
Within-cluster networks follow within:
"reestimate" (default) re-fits the estimator on the member
columns alone - the honest conditional structure of the subsystem;
"subnetwork" slices the node-level weight matrix and is
descriptive (for pcor/glasso it retains conditioning on
out-of-cluster nodes). Modes without raw data force
"subnetwork". Singleton clusters get no within network
(NULL).
Uncertainty. The composite/loadings macro network is a full
netobject carrying its composite data, so
bootstrap_network(fit$macro) (edge-weight CIs) and
vertex_bootstrap(fit$macro) (network-level CIs) work
directly; vertex_compare(fit1$macro, fit2$macro)
compares two groups. loading_stability quantifies how
stable the composite weights themselves are under case resampling.
All constituent networks are undirected
(meta$directed = FALSE), so renderers that auto-detect
directedness (e.g. cograph::plot_mcml()) draw the result
without arrowheads.
An object of class "mcml_pc" containing:
Cluster-level netobject (k x k, undirected).
Named list of within-cluster netobjects
(NULL for singleton clusters).
Named list of member node labels.
Tidy item-diagnostic data frame (one row per node):
node, cluster, loading (signed own-cluster),
weight, sign, max_cross,
cross_cluster, misfit. NULL only when no
node-level network is available.
The node-level netobject the aggregation was
based on (kept for diagnostics and loading_stability).
The raw data (data.frame) when available, else
NULL.
List: aggregation, method,
within, scale, cor_method, signed,
n_nodes, n_clusters, cluster_sizes,
n_misfit, n_flipped, directed = FALSE,
source = "pc", experimental = TRUE.
Escoufier, Y. (1973). Le traitement des variables vectorielles. Biometrics, 29(4), 751-760.
Hotelling, H. (1936). Relations between two sets of variates. Biometrika, 28(3/4), 321-377.
Robinaugh, D. J., Millner, A. J., & McNally, R. J. (2016). Identifying highly influential nodes in the complicated grief network. Journal of Abnormal Psychology, 125(6), 747-757.
Christensen, A. P., & Golino, H. (2021). On the equivalency of factor and network loadings. Behavior Research Methods, 53, 1563-1580.
Epskamp, S., & Fried, E. I. (2018). A tutorial on regularized partial correlation networks. Psychological Methods, 23(4), 617-634.
build_mcml for transition networks,
loading_stability for composite-weight stability,
bootstrap_network and vertex_bootstrap
for uncertainty on the macro network.
set.seed(1)
n <- 200
sigma <- matrix(0.15, 6, 6)
sigma[1:3, 1:3] <- 0.5
sigma[4:6, 4:6] <- 0.5
diag(sigma) <- 1
z <- matrix(rnorm(n * 6), n, 6) %*% chol(sigma)
df <- as.data.frame(z)
names(df) <- c("a1", "a2", "a3", "b1", "b2", "b3")
clusters <- list(A = c("a1", "a2", "a3"), B = c("b1", "b2", "b3"))
fit <- build_mcml_pc(df, clusters, aggregation = "composite",
method = "cor")
fit$macro$weights
fit$loadings
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.