marginal.test: Tests for signal detection via marginal approach

Description Usage Arguments Details Value References Examples

Description

Conduct the sum-test, max-test and adaptive-test for testing beta = 0 in a linear model y = x^T beta + epsilon.

Usage

1
marginal.test(x, y, num_sim = 5000L)

Arguments

x

the predictors, an n by p matrix

y

the responses, a vector of length n

num_sim

the number of resampling simulations to obtain the null distribution of the test statistic

Details

See the reference for a detailed description of the method.

Value

marginal.test returns a self-explanatory named vector.

References

Zhang, Y., Laber E. B. (2015). Comment on "An adaptive resampling test for detecting the presence of signifficant predictors". Journal of the American Statistical Association, 110(512), 1451-1454.

Examples

1
2
3
4
5
6
7
n <- 100
p <- 10
x <- matrix(rnorm(n * p), n, p)
y <- 0.3 * x[, 1] + rnorm(n)
result <- marginal.test(x, y)
result[1 : 3]  # gives p-values of max-test, sum-test and adaptive-test
result[4]      # gives running time in seconds

sdat documentation built on May 2, 2019, 8:50 a.m.