brainScores: Permutation t-Scores for Brain Imaging

View source: R/brainScores.R

brainScoresR Documentation

Permutation t-Scores for Brain Imaging

Description

This function computes t-scores for different permutations of brain imaging data. A voxel's score is calculated by performing the one-sample t test for the null hypothesis that its mean contrast over the different subjects is zero.

Usage

brainScores(copes, mask = NULL, alternative = "two.sided", alpha = 0.05, B = 200,
            seed = NULL, truncFrom = 3.2, truncTo = 0, squares = FALSE)

Arguments

copes

list of 3D numeric arrays (contrasts maps for each subject).

mask

3D logical array, where TRUE values correspond to voxels inside the brain, or character for a Nifti file name.

alternative

direction of the alternative hypothesis (greater, lower, two.sided).

alpha

significance level.

B

number of permutations, including the identity.

seed

seed.

truncFrom

truncation parameter: values less extreme than truncFrom are truncated. If NULL, statistics are not truncated.

truncTo

truncation parameter: truncated values are set to truncTo. If NULL, statistics are not truncated.

squares

logical, TRUE to use squared t-scores.

Details

Truncation parameters should be such that truncTo is not more extreme than truncFrom.

The significance level alpha should be in the interval [1/B, 1).

Value

brainScores returns an object of class sumBrain, containing

  • statistics: numeric matrix of t-scores, where columns correspond to voxels inside the brain, and rows to permutations. The first permutation is the identity

  • mask: 3D logical array, where TRUE values correspond to voxels inside the brain

  • alpha: significance level

  • truncFrom: transformed first truncation parameter

  • truncTo: transformed second truncation parameter

Author(s)

Anna Vesely.

References

Goeman J. J. and Solari A. (2011). Multiple testing for exploratory research. Statistical Science, doi: 10.1214/11-STS356.

Vesely A., Finos L., and Goeman J. J. (2023). Permutation-based true discovery guarantee by sum tests. Journal of the Royal Statistical Society, Series B (Statistical Methodology), doi: 10.1093/jrsssb/qkad019.

See Also

Permutation statistics for brain imaging using p-values: brainPvals

True discovery guarantee for cluster analysis: brainAnalysis

Suprathreshold clusters: brainClusters

Examples

# simulate 20 copes with dimensions 10x10x10
set.seed(42)
copes <- list()
for(i in seq(20)){copes[[i]] <- array(rnorm(10^3, mean = -10, sd = 30), dim=c(10,10,10))}

# cluster map where t scores are grater than 2.8, in absolute value
thr <- 2.8
cl <- brainClusters(copes = copes, thr = thr)

# create object of class sumBrain
res <- brainScores(copes = copes, alpha = 0.2, seed = 42, truncFrom = thr)
res
summary(res)

# confidence bound for the number of true discoveries and the TDP within clusters
out <- brainAnalysis(res, clusters = cl$clusters)
out$summary

annavesely/sumSome documentation built on Jan. 28, 2025, 8:15 a.m.