| nct | R Documentation |
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.
nct(
data1,
data2,
iter = 1000L,
gamma = 0.5,
paired = FALSE,
abs = TRUE,
weighted = TRUE,
p_adjust = "none"
)
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 |
iter |
Integer. Number of permutation iterations. Default 1000. |
gamma |
EBIC tuning parameter for glasso. Default 0.5. |
paired |
Logical. If |
abs |
Logical. If |
weighted |
Logical. If |
p_adjust |
P-value adjustment method for the per-edge tests
(any method in |
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).
A list of class net_nct with elements:
Estimated weighted adjacency matrices.
List with observed, perm, p_value for
the global strength test.
Same structure for the maximum absolute edge difference.
Same structure for per-edge tests.
Number of permutations.
Whether a paired test was used.
## Not run:
set.seed(1)
x1 <- matrix(rnorm(200 * 5), 200, 5)
x2 <- matrix(rnorm(200 * 5), 200, 5)
colnames(x1) <- colnames(x2) <- paste0("V", 1:5)
res <- nct(x1, x2, iter = 100)
res$M$p_value
res$S$p_value
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.