Differential centrality between two observed networks
Source:R/diff_centrality.R
diff_centrality.RdCompute per-node, per-statistic differences in centrality between two
observed networks (reported as group2 - group1) and assess
significance using a null generated by null_ggm() via either
permutation or bootstrap.
Usage
diff_centrality(
obs_networks,
dat,
group_col = "phenotype",
null_networks = NULL,
alternative = c("two.sided", "greater", "less"),
inference_method = c("D-S_NW_SL", "B_NW_SL"),
shuffle_method = c("permutation", "bootstrap"),
shuffle_iter = 100,
balanced = FALSE,
filter = c("pval", "fdr", "none"),
threshold = 0.05,
n_cores = NULL,
seed = NULL
)Arguments
- obs_networks
A *named* list of length 2 containing two igraph objects. The names (for example
c("healthy", "disease")) must match values present indat[[group_col]].- dat
A data frame passed to
null_ggm()to construct the null.- group_col
Character scalar; name of the column in
datindicating group labels. Default is"phenotype".- null_networks
A list of null networks from
null_ggm().- alternative
Character; one of
"two.sided","greater", or"less"defining the alternative hypothesis.- inference_method
Character; forwarded to
null_ggm()(for example"D-S_NW_SL"or"B_NW_SL").- shuffle_method
Character; one of
"permutation"or"bootstrap"specifying how the null is generated bynull_ggm().- shuffle_iter
Integer; number of null replicates to generate. Default is
100.- balanced
Logical; forwarded to
null_ggm().- filter
Character; one of
"pval","fdr", or"none", forwarded tonull_ggm().- threshold
Numeric; forwarded to
null_ggm().- n_cores
Integer or
NULL; forwarded tonull_ggm().- seed
Optional seed; forwarded to
null_ggm().
Value
A data.frame with rows corresponding to nodes (row names taken
from the centrality matrices) and columns interleaved by statistic:
If
shuffle_method == "permutation": \(p x (2k)\) with columns<stat>_diff,<stat>_pval.If
shuffle_method == "bootstrap": \(p x (3k)\) with columns<stat>_diff,<stat>_pval,<stat>_95pct_CI. (The CI level is fixed at 95 percent in the current implementation.)