RPtest_single: Test significance of single predictors
Description
Compute p-values for the significance of each variable in x.
Usage
RPtest_single(x, y, x_alt, B = 100L, rand_gen = rnorm, mc.cores = 1L)
Arguments
x
Input matrix with nobs rows, each an observation vector.
y
Response variable; shoud be a numeric vector.
x_alt
Optional: a matrix with jth column the sparse projection of the
jth column of x on all its other columns i.e. the output of
sparse_proj. If not supplied this is computed by the
function.
B
Number of bootstrap samples. If set to 0, the asymptotic ditribution
is used for calibration.
rand_gen
A function to generate the simulated errors up to an unknown
scale factor. It must permit calling as rand_gen(nobs*B). Determines
the form of errors in each of the null models, though the results are
broadly insensitive to this choice. The default rnorm equates to
null hypotheses of (sparse) Gaussian linear models. Setting
rand_gen=NULL resamples residuals to generate simulated errors and
approximates nulls of i.i.d. errors with unknown distributions.