Learn R Programming

brainGraph (version 0.55.0)

group.graph.diffs: Do between-group tests at each vertex for a given graph measure

Description

This function takes two lists of graphs (the length of each equaling the number of subjects per group) and performs either a linear model, 2-sample t-test, or 2-sample Wilcoxon test at each vertex for a given network measure (e.g. vertex degree).

Usage

group.graph.diffs(g1, g2, measure, test = c("t.test", "wilcox.test", "lm"),
  covars = NULL, permute = FALSE, perm.order = NULL)

Arguments

g1
A list of igraph graph objects for group 1
g2
A list of igraph graph objects for group 2
measure
A character string of the measure to test
test
A character string for the test to use, either 't.test' (default) or 'wilcox.test'
covars
A data frame of covariates; only needed if using lm (default: NULL)
permute
Logical; should be TRUE if being called from permute.vertex (default: FALSE)
perm.order
A vector indicating the order that permuted subjects are in; only necessary if being called from permute.vertex

Value

  • A graph with vertex attributes:
  • size2equals the t-statistic
  • sizesize2 transformed to be positive values (for visualization purposes)
  • pEqual to $1-p$
  • p.fdrEqual to $1-p_{FDR}$ (the FDR-adjusted p-value)

Details

The linear model choice is currently pretty inflexible. You will need to provide a data frame of covariates, of which Study.ID and Group need to be column names. Additionally, all graphs must have a name attribute (at the graph level) which matches the Study.ID for a given subject. This function will then return the p-value, t-statistic, and parameter estimate related to the Group covariate.

See Also

t.test, wilcox.test, p.adjust, vec.transform

Examples

Run this code
g.diffs.btwn <- group.graph.diffs(g1, g2, 'btwn.cent', test='wilcox.test')
g.diffs.btwn <- group.graph.diffs(g.way[[1]][[5]], g.way[[2]][[5]], 'btwn.cent',
                                  test='lm', covars=covars.dti)

Run the code above in your browser using DataLab