permTest: Permutation Test

View source: R/permTest.R

permTestR Documentation

Permutation Test

Description

Performs permutation-based two-sample t-tests.

Usage

permTest(X, B = 1000, alternative = "two.sided", seed = NULL, 
mask = NULL, rand = FALSE, label = NULL)

Arguments

X

Data matrix where rows represent the m variables and columns the n observations.

B

Numeric value. Number of permutations, default to 1000.

alternative

Character string. It refers to the alternative hypothesis, must be one of "two.sided" (default), "greater" or "lower".

seed

Integer value. If you want to specify the seed. Default to to NULL

mask

NIfTI file or character string. 3D array of logical values (i.e. TRUE/FALSE in/out of the brain). Alternatively it may be a (character) NIfTI file name. If mask=NULL, it is assumed that none of the voxels have to be excluded.

rand

Boolean value. Default to FALSE. If rand = TRUE, the p-values are computed by rowRanks.

label

Numeric/character vector. Labels of the observations, if NULL the columns's name are considered. Default to NULL.

Value

Returns a list with the following objects:

Test

Vector with length equals m. Observed two-samples t-tests, one for each m variable

Test_H0

Matrix with dimensions m \times B-1. Test statistics under the null hypothesis

pv

Vector with length equals m. Observed p-values, one for each m variable

pv_H0

Matrix with dimensions m \times B-1. p-values under the null hypothesis

Author(s)

Angela Andreella

Examples

X <- matrix(rnorm(100*20), ncol=20)
X[,1:10] <- X[,1:10] + rnorm(100*10, mean = 5)
out <- permTest(X = X, alternative = "two.sided", label = c(rep(1,10),rep(0,10)))

angeella/ARIpermutation documentation built on Sept. 12, 2024, 5:37 p.m.