hdm (version 0.3.1)

p_adjust: Multiple Testing Adjustment of p-values for S3 objects rlassoEffects and lm

Description

Multiple hypotheses testing adjustment of p-values from a high-dimensional linear model.

Usage

p_adjust(x, ...)

# S3 method for rlassoEffects p_adjust(x, method = "RW", B = 1000, ...)

# S3 method for lm p_adjust(x, method = "RW", B = 1000, test.index = NULL, ...)

Value

A matrix with the estimated coefficients and the p-values that are adjusted according to the specified method.

Arguments

x

an object of S3 class rlassoEffects or lm.

...

further arguments passed on to methods.

method

the method of p-value adjustment for multiple testing. Romano-Wolf stepdown ('RW') is chosen by default.

B

number of bootstrap repetitions (default 1000).

test.index

vector of integers, logicals or variables names indicating the position of coefficients (integer case), logical vector of length of the coefficients (TRUE or FALSE) or the coefficient names of x which should be tested simultaneously (only for S3 class lm). If missing, all coefficients are considered.

Methods (by class)

  • rlassoEffects: rlassoEffects.

  • lm: lm.

Details

Multiple testing adjustment is performed for S3 objects of class rlassoEffects and lm. Implemented methods for multiple testing adjustment are Romano-Wolf stepdown 'RW' (default) and the adjustment methods available in the p.adjust function of the stats package, including the Bonferroni, Bonferroni-Holm, and Benjamini-Hochberg corrections, see p.adjust.methods.

Objects of class rlassoEffects are constructed by rlassoEffects.

References

J.P. Romano, M. Wolf (2005). Exact and approximate stepdown methods for multiple hypothesis testing. Journal of the American Statistical Association, 100(469), 94-108.

J.P. Romano, M. Wolf (2016). Efficient computation of adjusted p-values for resampling-based stepdown multiple testing. Statistics and Probability Letters, (113), 38-40.

A. Belloni, V. Chernozhukov, K. Kato (2015). Uniform post-selection inference for least absolute deviation regression and other Z-estimation problems. Biometrika, 102(1), 77-94.

Examples

Run this code
library(hdm);
set.seed(1)
n = 100 #sample size
p = 25 # number of variables
s = 3 # nubmer of non-zero variables
X = matrix(rnorm(n*p), ncol=p)
colnames(X) <- paste("X", 1:p, sep="")
beta = c(rep(3,s), rep(0,p-s))
y = 1 + X%*%beta + rnorm(n)
data = data.frame(cbind(y,X))
colnames(data)[1] <- "y"
lasso.effect = rlassoEffects(X, y, index=c(1:20))
pvals.lasso.effect = p_adjust(lasso.effect, method = "RW", B = 1000)
ols = lm(y ~ -1 + X, data)
pvals.ols = p_adjust(ols, method = "RW", B = 1000)
pvals.ols = p_adjust(ols, method = "RW", B = 1000, test.index = c(1,2,5))
pvals.ols = p_adjust(ols, method = "RW", B = 1000, test.index = c(rep(TRUE, 5), rep(FALSE, p-5)))

Run the code above in your browser using DataCamp Workspace