p_adjust | R Documentation |
rlassoEffects
and lm
Multiple hypotheses testing adjustment of p-values from a high-dimensional linear model.
p_adjust(x, ...)
## S3 method for class 'rlassoEffects'
p_adjust(x, method = "RW", B = 1000, ...)
## S3 method for class 'lm'
p_adjust(x, method = "RW", B = 1000, test.index = NULL, ...)
x |
an object of S3 class |
... |
further arguments passed on to methods. |
method |
the method of p-value adjustment for multiple testing.
Romano-Wolf stepdown (' |
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 |
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
.
A matrix with the estimated coefficients and the p-values that are adjusted according to the specified method.
p_adjust(rlassoEffects)
: rlassoEffects
.
p_adjust(lm)
: lm
.
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.
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)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.