Learn R Programming

brainGraph (version 1.0.0)

plot_perm_diffs: Calculate permutation p-values and plot group differences

Description

For a given (global- or vertex-level) graph measure, determine the permutation p-value and create a plot showing group differences, either across densities or regions. You may specify the \(\alpha\)-level; a red asterisk is added if \(p < \alpha\) and a blue asterisk is added if \(\alpha < p < 0.1\) (i.e. a "trend"). You may also choose whether you want a one- or two-sided test.

Usage

plot_perm_diffs(g1, g2, perm.dt, measure, level = c("graph", "vertex"),
  auc = FALSE, alternative = c("two.sided", "less", "greater"),
  alpha = 0.05, groups = NULL, ylabel = NULL)

Arguments

g1
List of igraph graph objects for group 1
g2
List of igraph graph objects for group 2
perm.dt
Data table with the permutation results
measure
Character string for the graph measure of interest
level
Character string, either 'graph' or 'vertex'
auc
Logical indicating whether the data refer to area-under-the-curve (across all densities) (default: FALSE)
alternative
Character string, whether to do a two- or one-sided test (default: 'two.sided')
alpha
Significance level (default: 0.05)
groups
Character vector of group names (default: NULL)
ylabel
Character string for y-axis label (default: NULL)

Value

A list with three elements:
dt
A data table with p-values for each density/region
p1
A ggplot plotting object
p2
A ggplot plotting object

See Also

permute.group

Examples

Run this code
## Not run: ------------------------------------
# perms.mod.sig <- perms.sig(g[[1]], g[[2]], perms.all, 'mod', level='graph',
#   'less', groups, ylabel='Modularity')
# perms.mod.btwn <- perms.sig(g[[1]], g[[2]], perms.btwn, 'btwn.cent',
#   level='vertex')
## ---------------------------------------------

Run the code above in your browser using DataLab