perm_test: perform permutation test

Description Usage Arguments Details Value Author(s)

Description

Perform a permutation test (stratified by stages)

Usage

1
2
3
perm_test(x1, x2, g1, g2, stat, B, x3 = NULL, g3 = NULL, restricted,
  type = c("non-randomized", "randomized", "midp", "davison_hinkley"),
  stratified = TRUE)

Arguments

x1

First stage observations

x2

Second stage observations

g1

First stage group assignments

g2

Second stage group assignments

stat

Function that computes test statistic

B

Number of permutations to use

x3

Third stage observations

g3

Third stage group assignments

restricted

Should group sizes be considered fixed

type

Type of p-value to compute (see details)

stratified

should permutation be stratified by stage

Details

type specifies which permutation p-value to use. "non-randomized" will use the p-value of the non-randomized permutation test. "randomized" will use a randomized p-value that subtracts a random quantity from the non-randomized p-value, such that the a test that rejects for p <= alhpa has size exactly alpha. "midp" computes the mid-p-value which is the expected value of the randomized p-value. Davison-Hinkley returns the fraction between the permutation test statistics larger than t plus one and the permutation test statistics different from t plus one. The latter is mostly usefull when not all possible permutations are used.

Value

p-value of the permutation test

Author(s)

Florian Klinglmueller


floatofmath/adaperm documentation built on May 16, 2019, 1:18 p.m.