CTP_LocalTest: A Closed Testing Procedure for any local test satisfying the...

View source: R/CTP_LocalTest.R

CTP_LocalTestR Documentation

A Closed Testing Procedure for any local test satisfying the conditions of Mogensen and Markussen (2021) using an O(n^2) shortcut.

Description

A Closed Testing Procedure for any local test satisfying the conditions of Mogensen and Markussen (2021) using an O(n^2) shortcut.

Usage

CTP_LocalTest(
  LocalTest,
  pvals,
  alpha = 0.05,
  is.sorted = FALSE,
  EarlyStop = FALSE,
  ...
)

localTest_CTP(localTest, pvals, alpha = 0.05, is.sorted = FALSE, ...)

Arguments

LocalTest

A function which defines the choice of local test to use.

pvals

A vector of p-values.

alpha

Level to perform each intersection test at. Defaults to 0.05.

is.sorted

Logical, indicating whether the supplied p-values are already is.sorted. Defaults to FALSE.

EarlyStop

Logical indicating whether to exit as soon as a non-significant p-value is found. Defaults to FALSE.

...

Additional arguments.

localTest

A function specifying a local test (deprecated).

Value

A data.frame containing adjusted p-values and the original index of the p-values.

Examples

## Simulate some p-values
## The first 10 are from false hypotheses, the next 10 are from true
pvals = c(
  rbeta(10, 1, 20), ## Mean value of .05
  runif(10)
)
## Perform the CTP using a local Bonferroni test
CTP_LocalTest(function(x) {
  min(c(length(x) * min(x), 1))
}, pvals)


TMTI documentation built on Aug. 10, 2022, 5:06 p.m.