fastPerm: Fast approximation of small permutation p-values

Description Usage Arguments Examples

View source: R/fastPermFunctions.R

Description

This function approximates the p-value (two-sided) for a two sample permutation test by partitioning the permutation space. This function is most useful for small p-values, e.g. p < 10^-6.

Usage

1
fastPerm(x, y, testStat = ratioMean, B = 1000, adjusted = FALSE)

Arguments

x

First sample

y

Second sample

testStat

Test statistic, defaults to the ratio of the means (ratioMean). Other choices are diffMean, ratioMedian, and diffMedian. In the current version, the median statistics are experimental and may not be reliable.

B

Number of Monte Carlo iterations within each partition. Defaults to 1,000.

Examples

1
2
3
4
5
6
7
8
9
x <- rexp(100, 5)
y <- rexp(100, 2)
mStopRatioMean(x, y)
fastPerm(x, y)

x <- rnorm(110, 0, 1)
y <- rnorm(110, 1, 1)
mStopDiffMean(x, y)
fastPerm(x, y, testStat = diffMean)

bdsegal/fastPerm documentation built on July 22, 2019, 1:25 p.m.