Learn R Programming

brainGraph (version 1.0.0)

brainGraph_GLM: Run linear models at each vertex of a graph

Description

This function takes a list of igraph graphs and specifies a linear model at each vertex for a given vertex measure (e.g. degree).

Usage

brainGraph_GLM(g, covars, measure, con.vec, outcome = measure, X = NULL,
  con.name = NULL, alternative = c("two.sided", "less", "greater"),
  alpha = 0.05, permute = FALSE, N = 5000, ...)

Arguments

g
A list of igraph graph objects for all subjects (if you have multiple groups, you must concatenate the separate group lists)
covars
A data.table of covariates
measure
A character string of the vertex measure of interest
con.vec
A numeric vector specifying the contrast of interest
outcome
A character string of the name of the outcome variable; by default, it is ignored
X
A numeric matrix, if you wish to supply your own design matrix (default: NULL)
con.name
Character string of the contrast name (default: NULL)
alternative
Character string, whether to do a two- or one-sided test (default: 'two.sided')
alpha
Numeric; the significance level (default: 0.05)
permute
Logical indicating whether or not to permute group labels (default: FALSE)
N
Integer; number of permutations to create (default: 5e3)
...
Other arguments passed to brainGraph_GLM_design

Value

A list containing:
g
A graph with vertex attributes: size2 (t-statistic), size (the t-stat transformed for visualization purposes), p (equal to \(1-p\)), p.fdr (equal to \(1-p_{FDR}\), the FDR-adjusted p-value), gamma (the contrast of parameter estimaties, se (the standard error of gamma); and graph attributes: df (degrees of freedom), name (contrast name), outcome (the outcome variable)
DT
A data table with an entry for each vertex (region)
X
A numeric matrix; a copy of the design matrix
perm
A list containing: null.dist (the null distribution of maximum t-statistics), thresh (the t-statistic value corresponding to \(100 \times (1 - \alpha)\)% of the null distribution)

Details

You will need to provide a data.table of covariates, of which Study.ID needs to be the first column. Additionally, all graphs must have a name attribute (at the graph level) which matches the Study.ID for a given subject. If you do not provide covariates, the code will pull group membership from the graphs' Group attributes and do a test of group differences. This function returns, for each region, the contrast of parameter estimates (i.e., \(\gamma\)), standard error of the contrast, t-statistic, \(100 (1 - \alpha)\)% confidence interval, p-value, and FDR-adjusted p-value. To test whether a vertex attribute is associated with a different outcome (e.g., betweenness centrality and full-scale IQ), then specify the relevant outcome variable in the function call, and provide the data in the covariates table. You may optionally do permutation testing by permuting the labels for subject group. This is the same principle as that of Nichols & Holmes (2001) used in voxelwise MRI analyses and implemented in FSL's randomise.

References

Nichols TE & Holmes AP (2001). Nonparametric permutation tests for functional neuroimaging: A primer with examples. Human Brain Mapping, 15(1):1-25.

See Also

Other GLM functions: brainGraph_GLM_design, brainGraph_GLM_fit

Examples

Run this code
## Not run: ------------------------------------
# g.lm <- brainGraph_GLM(c(g.norm[[1]][[6]], g.norm[[2]][[6]]),
#   measure='strength',
#   covars=covars.all[Group == groups[2],
#                     c(names(covars.dti)[-2], 'Age.Fontan'),
#                     with=F]
#   con.vec=c(0, 0, 0, 1))
# 
# # Test for the group diff between "Neonate" and "Non-Neonate" in nodal eff.
# covars <- covars.all[Group == groups[2] & tract == 1,
#   c(names(covars.dti)[-2], 'Age.op1.cat'), with=F]
# covars[, Age.op1.cat := factor(Age.op1.cat)]
# g.lm <- brainGraph_GLM(g.norm[[2]][[6]], measure='E.nodal.wt',
#   covars=covars, con.vec=c(0, 0, 0, 0, 1))
## ---------------------------------------------

Run the code above in your browser using DataLab