Compute significance of identified set of variables

swaglm_test(swag_obj, B = 50, verbose = FALSE)

Arguments

swag_obj

An object of class swaglm.

B

a integer specifying the number of swag procedures to generate a distribution of the network statistics under the null.

verbose

A boolean used to control verbose

Value

A swaglm_test object.

Examples

n <- 2000
p <- 50

# create design matrix and vector of coefficients
Sigma <- diag(rep(1/p, p))
X <- MASS::mvrnorm(n = n, mu = rep(0, p), Sigma = Sigma)
beta = c(-15,-10,5,10,15, rep(0,p-5))
z <- 1 + X%*%beta
pr <- 1/(1 + exp(-z))
y <- as.factor(rbinom(n, 1, pr))
y = as.numeric(y)-1
quantile_alpha = .15
p_max = 20
swag_obj = swaglm::swaglm(X=X, y = y, p_max = p_max, family = stats::binomial(),
                          alpha = quantile_alpha, verbose = TRUE, seed = 123)
#> Completed models of dimension 1
#> Completed models of dimension 2
#> Completed models of dimension 3
#> Completed models of dimension 4
#> Completed models of dimension 5
#> Completed models of dimension 6
#> Completed models of dimension 7
#> Completed models of dimension 8
swaglm::swaglm_test(swag_obj, B = 10, verbose = TRUE)
#> SWAGLM Test Results:
#> ----------------------
#> p-value (Eigen): 0.3555 
#> p-value (Freq): 0