Skip to contents

gof_RPtest uses the RPtest package to compute a goodness-of-fit test.

Usage

gof_RPtest(x, y, m = 2, b = 1)

Arguments

x

A matrix of predictors.

y

A vector of outcomes.

m

Multiplier of null model sparsity.

b

Additive increase to alternative sparsity.

Value

A p-value computed using RPtest.

Details

First uses cv.glmnet to select a model with lambda.1se, then tests the selected model against one with a value of lambda chosen to increase the model sparsity.

Examples

n <- 100
p <- 200
s0 <- 5
sim_data <- rXb(n, p, s0)
#> Error in rXb(n, p, s0): could not find function "rXb"
x <- sim_data$x
#> Error in eval(expr, envir, enclos): object 'sim_data' not found
beta <- sim_data$beta
#> Error in eval(expr, envir, enclos): object 'sim_data' not found
y <- x %*% beta + rnorm(n)
#> Error in eval(expr, envir, enclos): object 'x' not found
gof_RPtest(x, y)
#> Error in nrow(x): object 'x' not found