Description Usage Arguments Details Value Author(s) References See Also Examples
Implements Romano and Wolf's StepM, a stepdown procedure for multiple hypothesis testing.
1 | stepm(teststatistics, bootmatrix, lefttail, righttail)
|
teststatistics |
A numeric vector, containing test statistics. |
bootmatrix |
A matrix with |
lefttail |
The mass to be left in the left tail of the
distribution. Setting this to |
righttail |
The mass to be left in the right tail of the
distribution. Setting this to |
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
.
A list with the following elements:
criticalvalues |
The estimated critical values. |
rejected |
A logical vector indicating which statistcs fall outside the critical values. |
Gray Calhoun gcalhoun@iastate.edu
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.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.