Learn R Programming

islasso (version 1.6.2)

relax.islasso: Relaxed islasso model fitting

Description

Fits a relaxed islasso model by unpenalizing a subset of variables selected either by statistical significance or by explicit user specification.

Usage

relax.islasso(fit, id = NULL, pval = 0.05, ...)

Value

An object of class islasso, representing the updated relaxed model.

Arguments

fit

An object of class islasso, representing a fitted model.

id

Optional. Either:

  • A numeric vector of indices referring to variables to be kept unpenalized, or

  • A character vector of variable names to be kept unpenalized.

If not provided, selection is based on the significance level given in alpha.

pval

Significance threshold (default 0.05). Variables with p-values less than or equal to pval are selected if id is missing.

...

Further arguments passed to update.

Details

The function creates a new islasso model where the selected variables are excluded from penalization. Selection can be made either through explicit variable indices/names via id, or automatically by thresholding p-values using alpha.

Examples

Run this code
if (FALSE) {
fit <- islasso(y ~ x1 + x2 + x3, data = dat)
# Relaxed model keeping only variables with p <= 0.01
fit_relaxed <- relax.islasso(fit, alpha = 0.01)

# Relaxed model keeping variable "x1" unpenalized
fit_relaxed2 <- relax.islasso(fit, id = "x1")
}

Run the code above in your browser using DataLab