Tests whether two networks estimated from independent samples differ at three levels: global strength (M-statistic), network structure (S-statistic, max absolute edge difference), and individual edges (E-statistic per edge). Inference is via permutation of group labels.
Usage
nct(
data1,
data2,
iter = 1000L,
gamma = 0.5,
paired = FALSE,
abs = TRUE,
weighted = TRUE,
p_adjust = "none"
)Arguments
- data1
A numeric matrix or data.frame of observations from group 1.
- data2
A numeric matrix or data.frame of observations from group 2. Same number of columns as
data1.- iter
Integer. Number of permutation iterations. Default 1000.
- gamma
EBIC tuning parameter for glasso. Default 0.5.
- paired
Logical. If
TRUE, perform a paired permutation (within-subject swap). DefaultFALSE.- abs
Logical. If
TRUE, compute global strength on absolute edge weights. DefaultTRUE.- weighted
Logical. If
TRUE, use weighted networks for the tests. IfFALSE, binarize before computing statistics. DefaultTRUE.- p_adjust
P-value adjustment method for the per-edge tests (any method in
stats::p.adjust.methods). Default"none".
Value
A list of class net_nct with elements:
- nw1, nw2
Estimated weighted adjacency matrices.
- M
List with
observed,perm,p_valuefor the global strength test.- S
Same structure for the maximum absolute edge difference.
- E
Same structure for per-edge tests.
- n_iter
Number of permutations.
- paired
Whether a paired test was used.
Details
Implementation matches NetworkComparisonTest::NCT() with defaults
abs = TRUE, weighted = TRUE, paired = FALSE at
machine precision when the same seed is used. The network estimator is
EBIC-selected glasso applied to a Pearson correlation matrix, with
Matrix::nearPD symmetrization (matching NCT's
NCT_estimator_GGM default).