Learn R Programming

TMTI (version 1.0.1)

kFWER_LocalTest: kFWER_LocalTest. Computes the largest rejection set possible with kFWER control.

Description

kFWER_LocalTest. Computes the largest rejection set possible with kFWER control.

Usage

kFWER_LocalTest(LocalTest, pvals, k, alpha = 0.05, verbose = FALSE)

Value

The number of marginal hypotheses that can be rejected with kFWER control.

Arguments

LocalTest

A function that returns a p-value for a joint hypothesis test.

pvals

A vector p-values.

k

An integer denoting the desired k at which to control the kFWER.

alpha

Significance level.

verbose

Logical, indicating whether or not to print progress.

Examples

Run this code
nfalse = 50
m = 100
pvals = c (
  sort(runif(nfalse, 0, 0.05 / m)),
  sort(runif(m - nfalse, 0.1, 1))
)
kFWER_LocalTest (
  LocalTest = function (x) min(x) * length(x),
  pvals = pvals,
  k = 5,
  alpha = 0.05,
  verbose = FALSE
)

Run the code above in your browser using DataLab