Skip to contents

Convenience wrapper that runs AIC/BIC/AICc stepwise, GAMLSS LASSO (and ENet when available), and the pure glmnet IRLS selector, then collates coefficients into a long table for comparison. Observations containing NA in either X or Y are removed prior to fitting. Column names are temporarily shortened to satisfy selector requirements and avoid clashes; the outputs remap them to the original labels before returning so the reported variables always match the input design.

Usage

compare_selectors_single(X, Y, include_enet = TRUE)

Arguments

X

Numeric matrix (n × p) of mean-submodel predictors.

Y

Numeric response in (0,1). Values are squeezed to (0,1) internally.

include_enet

Logical; include ENet if gamlss.lasso is installed.

Value

A list with:

coefs

Named coefficient vectors for each selector.

table

Long data frame with columns selector, variable, coef, selected.

Examples

set.seed(1)
X <- matrix(rnorm(300), 100, 3); Y <- plogis(X[, 1])
Y <- rbeta(100, Y * 30, (1 - Y) * 30)
single <- compare_selectors_single(X, Y, include_enet = FALSE)
head(single$table)
#>     selector variable      coef selected
#> X1       AIC       X1 0.9325061     TRUE
#> X2       AIC       X2 0.0000000    FALSE
#> X3       AIC       X3 0.0000000    FALSE
#> X11      BIC       X1 0.9325061     TRUE
#> X21      BIC       X2 0.0000000    FALSE
#> X31      BIC       X3 0.0000000    FALSE