getPermutePval: Permutation p-value

Description Usage Arguments Value See Also

Description

Obtain the p-value using permutation test.

Usage

1
2
getPermutePval(X, Y, testFunction, npermute = 100, useMC = FALSE,
  mc.cores = 1, seeds = NULL)

Arguments

X

n1 by p matrix of the first population

Y

n2 by p matrix of the second population

testFunction

a function that takes in two arguments, X and Y, and returns a list including the field test.stat for test statistic

npermute

the number of permutations to conduct

useMC

logical variable indicating whether to use multicore parallelization. R packages parallel and doParallel are required if set to TRUE.

mc.cores

decide the number of cores to use when useMC is set to TRUE.

seeds

a numeric vector with length npermute, where seeds[i] specifies the seeding for the i-th permutation. Set to NULL if do not want to specify.

Value

A list containing the following components:

test.res

the results of the original test, including test statistic, sometimes also include the p-values calculated using the limiting distribution

test.stat.permute

a numeric vector with length permute, for the test statsitics in permutations

pVal

the permutation pvalue, calculated as the fraction of test.stat.permute being larger than test.res$test.stat

See Also

Cai.max.test(), Chang.maxBoot.test(), LC.U.test(), WL.randProj.test(), Schott.Frob.test().


lingxuez/sLED documentation built on May 7, 2019, 2:55 a.m.