brainGraph_GLM_design takes a data.table of covariates and
returns a design matrix to be used in linear model analysis.
brainGraph_GLM_design(covars, coding = c("dummy", "effects", "cell.means"),
mean.center = FALSE, binarize = NULL, int = NULL)A data.table of covariates
Character string indicating how factor variables will be coded
(default: 'dummy')
Logical indicating whether to mean center non-factor
variables (default: FALSE)
Character string specifying the column name(s) of the
covariate(s) to be converted from type factor to numeric
(default: NULL)
Character string specifying the column name(s) of the
covariate(s) to test for an interaction (default: NULL)
A numeric matrix
There are three different ways to code factors: dummy, effects,
or cell-means (chosen by the argument coding). To understand
the difference, see Chapter 7 of the User Guide.
The argument mean.center will mean-center (i.e., subtract the mean of
the entire dataset from each variable) any non-factor variables (including
any dummy/indicator covariates). binarize will convert the given
factor variable(s) into numeric variable(s), which is performed before
mean-centering.
int specifies which variables should interact with one another. This
argument accepts both numeric (e.g., Age) and factor variables (e.g.,
Sex). All interaction combinations will be generated: if you supply 3
variables, all two-way and the single three-way interaction will be
generated. This variable must have at least two elements.
Other GLM functions: GLMfit,
brainGraph_GLM, mtpc