stepm: Romano and Wolf's (2005) StepM

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Implements Romano and Wolf's StepM, a stepdown procedure for multiple hypothesis testing.

Usage

1
stepm(teststatistics, bootmatrix, lefttail, righttail)

Arguments

teststatistics

A numeric vector, containing test statistics.

bootmatrix

A matrix with length(teststatistics) rows and an arbitrary number of columns. Each column is a different draw from the bootstrap-induced distribution of teststatistics.

lefttail

The mass to be left in the left tail of the distribution. Setting this to NA imposes a one-sided alternative.

righttail

The mass to be left in the right tail of the distribution. Setting this to NA imposes a one-sided alternative.

Details

This function assumes that each element of teststatistics tests (say) mu[i] = 0 against the alternative mu[i] > 0, for i = 1,...,length(teststatistics). Romano and Wolf's (2005) StepM procedure estimates a critical value such that the probability that it is smaller than at least one statistic corresponding to a true null hypothesis is controlled at level level.

Value

A list with the following elements:

criticalvalues

The estimated critical values.

rejected

A logical vector indicating which statistcs fall outside the critical values.

Author(s)

Gray Calhoun gcalhoun@iastate.edu

References

Calhoun, G. 2011, Documentation appendix: An asymptotically normal out-of-sample test of equal predictive accuracy for nested models. Unpublished manuscript.

Calhoun, G. 2012, A comment on "Stepwise multiple testing as formalized data snooping." Unpublished manuscript.

Romano, J. P., and Wolf, M. 2005, Stepwise multiple testing as formalized data snooping. Econometrica, 73(4), pages 1237–1292.

See Also

boot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
n <- 50
nboot <- 99
d <- data.frame(x1 = rnorm(n), x2 = rnorm(n) + 1, x3 = rnorm(n))

dottests <- function(dataset)
  sapply(dataset, function(x) t.test(x)$statistic)

stepm(teststatistics = dottests(d),
      bootmatrix = replicate(nboot, dottests(d[sample(1:n, n, replace = TRUE),])),
      lefttail = NA, righttail = 0.05)

grayclhn/oosanalysis-R-library documentation built on May 17, 2019, 8:33 a.m.