brainGraph_permute {brainGraph} | R Documentation |
Permutation test for group difference of graph measures
Description
brainGraph_permute
draws permutations from linear model residuals to
determine the significance of between-group differences of a global or
vertex-wise graph measure. It is intended for structural covariance networks
(in which there is only one graph per group), but can be extended to other
types of data.
Usage
brainGraph_permute(densities, resids, N = 5000, perms = NULL,
auc = FALSE, level = c("graph", "vertex", "other"),
measure = c("btwn.cent", "coreness", "degree", "eccentricity",
"clo.cent", "communicability", "ev.cent", "lev.cent", "pagerank",
"subg.cent", "E.local", "E.nodal", "knn", "Lp", "transitivity",
"vulnerability"), .function = NULL)
## S3 method for class 'brainGraph_permute'
summary(object, measure = object$measure,
alternative = c("two.sided", "less", "greater"), alpha = 0.05,
p.sig = c("p", "p.fdr"), ...)
## S3 method for class 'brainGraph_permute'
plot(x, measure = x$measure,
alternative = c("two.sided", "less", "greater"), alpha = 0.05,
p.sig = c("p", "p.fdr"), ptitle = NULL, ...)
Arguments
densities |
Numeric vector of graph densities |
resids |
An object of class |
N |
Integer; the number of permutations (default: 5e3) |
perms |
Numeric matrix of permutations, if you would like to provide
your own (default: |
auc |
Logical indicating whether or not to calculate differences in the
area-under-the-curve of metrics (default: |
level |
A character string for the attribute “level” to calculate
differences (default: |
measure |
A character string specifying the vertex-level metric to
calculate, only used if |
.function |
A custom function you can pass if |
object , x |
A |
alternative |
Character string, whether to do a two- or one-sided test.
Default: |
alpha |
Numeric; the significance level. Default: 0.05 |
p.sig |
Character string specifying which p-value to use for displaying
significant results (default: |
... |
Unused |
ptitle |
Character string specifying a title for the plot (default:
|
Details
If you would like to calculate differences in the area-under-the-curve (AUC)
across densities, then specify auc=TRUE
.
There are three possible “levels”:
-
graph Calculate modularity (Louvain algorithm), clustering coefficient, characteristic path length, degree assortativity, and global efficiency.
-
vertex Choose one of: centrality metrics (betweenness, closeness, communicability, eigenvector, leverage, pagerank, subgraph); k-core; degree; eccentricity; nodal or local efficiency; k-nearest neighbor degree; shortest path length; transitivity; or vulnerability.
-
other Supply your own function. This is useful if you want to calculate something that I haven't hard-coded. It must take as its own arguments:
g
(a list of lists ofigraph
graph objects); anddensities
(numeric vector).
Value
An object of class brainGraph_permute
with input arguments in
addition to:
DT |
A data table with permutation statistics |
obs.diff |
A data table of the observed group differences |
Group |
Group names |
The plot
method returns a list of ggplot
objects
Author(s)
Christopher G. Watson, cgwatson@bu.edu
See Also
Other Group analysis functions: Bootstrapping
,
GLM
, Mediation
,
NBS
, mtpc
Other Structural covariance network functions: Bootstrapping
,
IndividualContributions
,
Residuals
, corr.matrix
,
import_scn
, plot_volumetric
Examples
## Not run:
myResids <- get.resid(lhrh, covars)
myPerms <- shuffleSet(n=nrow(myResids$resids.all), nset=1e3)
out <- brainGraph_permute(densities, m, perms=myPerms)
out <- brainGraph_permute(densities, m, perms=myPerms, level='vertex')
out <- brainGraph_permute(densities, m, perms=myPerms,
level='other', .function=myFun)
## End(Not run)