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.
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