Learn R Programming

brainGraph (version 2.7.3)

GLMhelpers: Helper function to set-up for GLM analyses

Description

setup_glm is used to setup the data/objects for any function that uses the main GLM functionality in brainGraph.

Usage

setup_glm(covars, X, con.mat, con.type, con.name, ...)

glm_fit_helper(DT, X, con.type, con.mat, alt, measure, mykey)

Arguments

covars

A data.table of covariates

X

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

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'

con.name

Character vector of the contrast name(s); if con.mat has row names, those will be used for reporting results (default: NULL)

...

Other arguments passed to brainGraph_GLM_design

DT

A data.table with all the necessary data

measure

Character string of the graph measure of interest

mykey

The key to key by (to differentiate NBS and other GLM analyses)

Details

This function performs several tasks: it removes unused levels from covars, removes subjects with incomplete data, creates a design matrix (if not supplied), and supplies names to the contrast matrix.