BMperm.Rd
Takes a binary matrix of voxels and a vector of behavior and runs Brunner-Munzel tests on each voxel. This is a fast function that corrects for infinite values with a similar approach as the nparcomp package. It calculates p-values by running permutations of each voxel and using the ratio of times the real BM score exceeds the permuted BM score.
BMperm(X, y, computeDOF = TRUE, npermBM = 20000L, alternative = 1L)
X | binary matrix ov voxlels (columns) for all subjects (rows) |
---|---|
y | vector of behavioral scores. |
computeDOF | (default true) chooses whether to compute degrees of freedom. Set to false to save time during permutations. |
npermBM | (default 20000) number of permutations to run at each voxel |
alternative | (default 1) integer to select the tail of pvalues. 1-greater, 2-less, 3-two.sided |
List with these objects:
statistic
- BM values
dfbm
- degrees of freedom
pvalue
- permutation-based probability value
set.seed(1234) lesmat = matrix(rbinom(40,1,0.2), ncol=2) set.seed(1234) behavior = rnorm(20) test = LESYMAP::BMperm(lesmat, behavior, alternative=3) test$statistic[,1] # -2.0571825 -0.8259754#> [1] -2.0571825 -0.8259754test$dfbm[,1] # 16.927348 7.563432#> [1] 16.927348 7.563432test$pvalue[,1] # 0.1427929 0.4102795#> [1] 0.1427929 0.4102795