brainGraph_GLM: Fit linear models at each vertex of a graph

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/brainGraph_GLM.R

Description

brainGraph_GLM specifies and fits a linear model at each vertex for a given vertex measure (e.g. degree) or at the graph-level (e.g., global efficiency). Given a contrast matrix, it will calculate the associated statistics.

Usage

1
2
3
4
brainGraph_GLM(g.list, covars, measure, con.mat, con.type = c("t", "f"),
  X = NULL, con.name = NULL, alternative = c("two.sided", "less",
  "greater"), alpha = 0.05, level = c("vertex", "graph"), permute = FALSE,
  N = 5000, perms = NULL, long = FALSE, ...)

Arguments

g.list

A list of igraph graph objects for all subjects

covars

A data.table of covariates

measure

Character string of the graph measure of interest

con.mat

Numeric matrix specifying the contrast(s) of interest; if only one contrast is desired, you can supply a vector

con.type

Character string; either 't' or 'f' (for t or F-statistics). Default: 't'

X

Numeric matrix, if you wish to supply your own design matrix (default: NULL)

con.name

Character vector of the contrast name(s); if con.mat has row names, those will be used for reporting results (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)

level

Character string; either vertex (default) or graph

permute

Logical indicating whether or not to permute group labels (default: FALSE)

N

Integer; number of permutations to create (default: 5e3)

perms

Matrix of permutations, if you would like to provide your own (default: NULL)

long

Logical indicating whether or not to return all permutation results (default: FALSE)

...

Other arguments passed to brainGraph_GLM_design

Details

The input list of graphs g.list must not be nested; i.e., if you have multiple groups, they will have to be combined into one list. See the code in the Examples below.

A data.table of covariates is required input; the first column must be named Study.ID. Additionally, all graphs must have a name attribute (at the graph level) which matches the Study.ID for a given subject. If you create the design matrix X yourself, you still must supply the covariates table so that subjects can be correctly matched with their network data.

Both t- and F-contrasts are allowed. You may supply a matrix to the argument con.mat. If you supply a multi-row matrix and you choose con.type="t", then statistics will be calculated for each contrast individually. If you choose con.type="f", in the result data table, ESS stands for "extra sum of squares", the additional variance explained for by the model parameters of interest (as determined by the contrast matrix). Finally, the standard error in these tables is the sum of squared errors of the full model.

Finally, you can calculate permutations of the data to build a null distribution of the maximum statistic, to provide control over false positives. The permutation strategy is that of Freedman & Lane (1983), and is the same as that in FSL's randomise.

Value

An object of class bg_GLM containing some input-specific variables, in addition to:

X

A numeric matrix; a copy of the design matrix

y

A numeric vector or matrix of the outcome variable

DT

A data table with an entry for each vertex (region) containing statistics of interest

removed

A character vector of Study.ID's removed due to incomplete data (if any)

perm

A list containing: null.dist (the null distribution of maximum statistics), thresh (the statistic value corresponding to the 100 \times (1 - α)th% percentile of the null distribution)

.

Author(s)

Christopher G. Watson, [email protected]

References

Freedman D & Lane D (1983). A nonstochastic interpretation of reported significance levels. J Bus Econ Stat, 1(4):292-298.

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

Winkler AM, Ridgway GR, Webster MA, Smith SM, Nichols TE (2014). Permutation inference for the general linear model. NeuroImage, 92:381-397.

See Also

Other GLM functions: GLMfit, brainGraph_GLM_design, mtpc

Other Group analysis functions: IndividualContributions, NBS, brainGraph_boot, brainGraph_mediate, brainGraph_permute, mtpc

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
conmat <- matrix(c(0, 0, 0, 1), nrow=1)
rownames(conmat) <- 'Control > Patient'

## Note that I concatenate the graphs from each group's 6th threshold
g.lm <- brainGraph_GLM(g.list=do.call(Map, c(c, g))[[6]],
  covars=covars.all[tract == 1],
  measure='strength', con.mat=conmat, alt='greater',
  permute=TRUE, long=TRUE)

## End(Not run)

brainGraph documentation built on May 29, 2018, 9:03 a.m.