Description Usage Arguments Details Value Author(s) See Also

View source: R/brainGraph_GLM.R

`brainGraph_GLM_design`

takes a `data.table`

of covariates and
returns a *design matrix* to be used in linear model analysis.

1 2 |

`covars` |
A |

`coding` |
Character string indicating how factor variables will be coded
(default: |

`factorize` |
Logical indicating whether to convert |

`mean.center` |
Logical indicating whether to mean center non-factor
variables (default: |

`binarize` |
Character vector specifying the column name(s) of the
covariate(s) to be converted from type |

`int` |
Character vector specifying the column name(s) of the
covariate(s) to test for an interaction (default: |

There are three different ways to code factors: *dummy*, *effects*,
or *cell-means* (chosen by the argument `coding`

). To understand
the difference, see Chapter 8 of the User Guide.

Importantly, the default behavior (as of v2.1.0) is to convert all character
columns (excluding the Study ID column and any that you list in the
`binarize`

argument) to factor variables. To change this, set
`factorize=FALSE`

. So, if your covariates include multiple character
columns, but you want to convert *Scanner* to binary instead of a
factor, you may still specify `binarize='Scanner'`

and get the expected
result. `binarize`

will convert the given
factor variable(s) into numeric variable(s), which is performed *before*
mean-centering.

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). This is done *after* "factorizing" and
"binarizing".

`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.

A numeric matrix

Christopher G. Watson, [email protected]

Other GLM functions: `GLMfit`

,
`brainGraph_GLM`

, `mtpc`

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.