Learn R Programming

brainGraph (version 2.7.3)

setup_randomise: Helper function to setup for randomise

Description

setup_randomise is used to setup the data/objects for any function that does permutations for GLM-based analysis.

Usage

setup_randomise(X, con.mat, con.type, nC)

randomise(ctype, N, perms, DT, nC, measure, X, con.mat, alternative)

Arguments

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'

nC

Integer; the number of contrasts

N

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

perms

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

DT

data.table with outcome variables

measure

Character string of the graph measure of interest

alternative

Character string, whether to do a two- or one-sided test (default: 'two.sided')

Value

A list containing:

Mp

The full partitioned model, joined

Rz

The residual-forming matrix

MtM

The inverse of the cross product of the full model

eC

The effective contrast, equivalent to the original, for the partitioned model [X, Z] and considering all covariates

dfR

The residual degrees of freedom of the full partitioned model

CMtM

(only for F-contrasts) The effective contrast multiplied by the inverse of the cross-product of the full model.

rkC

(only for F-contrasts) The rank of the effective contrast matrix.