perm | R Documentation |
Given a NxV imaging matrix Y (N = number of subjects, V = number of vertices in the ventricular mesh), a NxC model matrix X (N = number of subjects, C = number of variables + intercept term) and the numbers of the column variables to extract, this function computes for each variable specified in extract the TFCE derived p-values map on the mesh. The output is a matrix with a number of columns equal to the lenght of extract and a rows equal to the number of vertices.
perm(X, Y, extract, A, NNmatrix, nPermutations = 1000, HC4m = FALSE,
parallel = FALSE, nCores = 1, verbOutput = 0)
X |
is the design matrix. Number of rows = number of subjects in the study, number of columns = number of vertices in the atlas. Numerical varable must be normalized to 0-mean and unit-standard deviation. Categorical variables must be coded using dummy coding. The first column should contain the intercept (all 1s). |
Y |
is the imaging matrix. Number of rows = N. Number of columns = V. |
extract |
is an array expressing which covariates in X you want to extract. |
A |
A V-dimensional vector containing the area associated with a vertex, usually its Voronoi area. |
NNmatrix |
Nx2 matrix containing the mesh edges. Important: to speed up the execution please avoid repetitions like (A,B) and (B,A). |
nPermutations |
number of permutations in the permutation test, default is 1000. |
HC4m |
flag for triggering HC4m correction, default is FALSE. |
parallel |
flag for triggering parallel computing, default is FALSE. |
nCores |
flag for defining the number of cores to use, default is 1. |
verbOutput |
flag for activating verbose output, default is 0 (off). |
If verbOutput = 0 the output is a matrix containing in its rows the pvalues computed at each vertex and the number of colums referes to the variables specified in extract. If verbOutput = 1 the output is a list where the pval field contains the the pvalues computed at each vertex, TFCEmatrix field contains a V x nPermutations matrix containing the TFCE scores computed for each permutation and the tfceScores field is a V-dimensional vector containing the TFCE scores of the non-permuted data.
TFCEresults = perm(X, Y, extract, A, NNmatrix, nPermutations = 1000, HC4m = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.