boot.pval {wbsd}R Documentation

Bootstrap p-value

Description

This function computes a bootstrap p-value as discussed in the article Pötscher and Preinerstorfer (2020).

Usage

boot.pval(y, X, R, r, hcmethod, restr.cov, wilddist, wildmult, 
wildmult.restr, boot.res.restr, boot.center.restr,    
tol = 1e-07, comp.meth = "exact", Boot.supp = NULL, 
checks = TRUE, cores = 1)

Arguments

y

Matrix (n rows)

X

Matrix (n times k, rank k).

R

Matrix (q times k, rank q).

r

Vector (q dimensional).

hcmethod

Integer in [-1, 4]. Determines the method used in the construction of the covariance estimator used in the test statistic. The value -1 corresponds to uncorrected F statistic without df adjustment; the value 0 corresponds to the HC0 estimator; ...; the value 4 corresponds to the HC4 estimator. Cf. Pötscher and Preinerstorfer (2020) and the references there for details.

restr.cov

TRUE or FALSE. Covariance matrix estimator based on null-restricted (TRUE) or unrestricted (FALSE) residuals.

wilddist

Auxiliary distribution used to generate the bootstrap sample. Either “rademacher” or “mammen”. This is only used in case comp.meth = exact.

wildmult

Integer in [0, 4]. Determines the wild-bootstrap multiplier weights used. The value 0 corresponds to constant multipliers of 1; the value 1 corresponds to multipliers that are obtained by taking the square of the HC1 weights; ...; the value 4 corresonds to multipliers that are obtained by taking the square of the HC4 weights.

wildmult.restr

TRUE or FALSE. Bootstrap multiplier weights computed on null-restricted (TRUE) or unrestricted (FALSE) projection matrix.

boot.res.restr

TRUE or FALSE. Bootstrap residuals based on null-restricted sample residuals (TRUE) or unrestricted sample residuals (FALSE)

boot.center.restr

TRUE or FALSE. Bootstrap sample centered at null-restricted predictor (TRUE) or at the unrestricted predictor (FALSE).

tol

Real number. Tolerance parameter used in checking invertibility of the covariance matrix in the test statistic. Default is 1e-07. A negativ input value will be converted to the machine epsilon. To check the stability of the numerical computations, it is recommended to try different values of tol and compare the obtained value of theta. Larger values of tol will lead to larger theta.

comp.meth

“exact” or “approximation”. Determines whether probabilities over the bootstrap distribution are computed exactly or approximately (the latter requires input Boot.supp). Exact computations are only feasible for small sample sizes.

Boot.supp

Bootstrap approximation distribution (e.g., obtained by drawing vectors each with n independent entries distributed according to a Rademacher or Mammen distribution); (matrix, n rows, columns = number of bootstrap samples). This is only used if comp.meth = “approximation”; note that these vectors are further multiplied by wildmult weights.

checks

TRUE (default) or FALSE. Determines whether input checks are conducted (TRUE) or not (FALSE).

cores

Positive integer. Maximal number of cores used in the computations.

Details

For details see the relevant sections in Pötscher and Preinerstorfer (2020).

Value

p

Bootstrap p-value.

References

Pötscher, B. M. and Preinerstorfer, D. (2020). How Reliable are Bootstrap-based Heteroskedasticity Robust Tests? <arXiv:2005.04089>

Examples

y <- matrix(rnorm(10), ncol = 1)
X <- cbind(rep(1, 10), rnorm(10))                         
R <- matrix(c(0, 1), nrow = 1, ncol = 2)
r <- 0

boot.pval(y, X, R, r, 3, FALSE, "rademacher", 3, FALSE, TRUE, TRUE)

[Package wbsd version 1.0.0 Index]