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.
brainGraph_permute(densities, resids, N = 5000, perms = NULL,
auc = FALSE, level = c("graph", "vertex", "other"),
measure = c("btwn.cent", "degree", "E.nodal", "ev.cent", "knn",
"transitivity", "vulnerability"), atlas = NULL, .function = NULL)# S3 method for brainGraph_permute
summary(object, measure = NULL,
alternative = c("two.sided", "less", "greater"), alpha = 0.05,
p.sig = c("p", "p.fdr"), ...)
# S3 method for brainGraph_permute
plot(x, measure = NULL,
alternative = c("two.sided", "less", "greater"), alpha = 0.05,
p.sig = c("p", "p.fdr"), ptitle = NULL, ...)
Numeric vector of graph densities
An object of class brainGraph_resids
(the output from
get.resid
)
Integer; the number of permutations (default: 5e3)
Numeric matrix of permutations, if you would like to provide
your own (default: NULL
)
Logical indicating whether or not to calculate differences in the
area-under-the-curve of metrics (default: FALSE
)
A character string for the attribute "level" to calculate
differences (default: graph
)
A character string specifying the vertex-level metric to
calculate, only used if level='vertex'
(default: btwn.cent
).
For the summary
method, this is to focus on a single
graph-level measure (since multiple are calculated at once).
Character string of the atlas name; required if
level='graph'
(default: NULL
)
A custom function you can pass if level='other'
A brainGraph_permute
object (output by
brainGraph_permute
).
Character string, whether to do a two- or one-sided test
(default: 'two.sided'
)
Numeric; the significance level (default: 0.05)
Character string specifying which p-value to use for displaying
significant results (default: p
)
Unused
A brainGraph_permute
object (output by
brainGraph_permute
).
Character string specifying a title for the plot (default:
NULL
)
An object of class brainGraph_permute
with input arguments in
addition to:
A data table with permutation statistics
A data table of the observed group differences
Group names
The plot method returns a list of ggplot objects
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, global efficiency, lobe assortativity, and edge asymmetry.
vertex Choose one of: betweenness centrality, degree, nodal efficiency, k-nearest neighbor degree, 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 of igraph
graph objects); and
densities
(numeric vector).
Other Group analysis functions: Bootstrapping
,
GLM
, IndividualContributions
,
MediationAnalysis
, NBS
,
mtpc
Other Structural covariance network functions: Bootstrapping
,
IndividualContributions
,
Residuals
, corr.matrix
,
import_scn
, plot_volumetric
# NOT RUN {
myResids <- get.resid(lhrh, covars)
myPerms <- shuffleSet(n=nrow(myResids$resids.all), nset=1e3)
out <- brainGraph_permute(densities, m, perms=myPerms, atlas='dk')
out <- brainGraph_permute(densities, m, perms=myPerms, level='vertex')
out <- brainGraph_permute(densities, m, perms=myPerms,
level='other', .function=myFun)
# }
Run the code above in your browser using DataLab