Learn R Programming

islasso (version 1.6.0)

predict.islasso: Prediction Method for islasso Objects

Description

Computes predictions from a fitted islasso model object. Multiple output types supported, including response scale, linear predictor, and coefficient values.

Usage

# S3 method for islasso
predict(
  object,
  newdata = NULL,
  type = c("link", "response", "coefficients", "class", "terms"),
  se.fit = FALSE,
  ci = NULL,
  type.ci = c("wald", "score"),
  level = 0.95,
  terms = NULL,
  na.action = na.pass,
  ...
)

Value

A numeric vector, matrix, or list depending on type.

Arguments

object

A fitted model of class "islasso".

newdata

Optional data frame containing predictors for prediction. If omitted, the fitted model matrix is used.

type

Character. Specifies the prediction scale:

  • "link" (default): linear predictor scale;

  • "response": original response scale;

  • "coefficients": estimated coefficients;

  • "class": predicted class (only for binomial() family);

  • "terms": contribution of each term to the linear predictor.

se.fit

Logical. Whether to compute standard errors/confidence intervals.

ci

Optional. Precomputed matrix of confidence intervals (2 columns).

type.ci

Type of interval. Only "wald" is implemented.

level

Confidence level for intervals. Default is 0.95.

terms

If type = "terms", optionally specify which terms to extract.

na.action

Function to handle missing values in newdata. Default: na.pass.

...

Additional arguments passed to downstream methods.

Author

Gianluca Sottile gianluca.sottile@unipa.it

See Also

islasso, summary.islasso, logLik.islasso, residuals.islasso, deviance.islasso

Examples

Run this code
set.seed(1)
n <- 100; p <- 100
beta <- c(runif(20, -3, 3), rep(0, p - 20))
sim <- simulXy(n = n, p = p, beta = beta, seed = 1, family = gaussian())
fit <- islasso(y ~ ., data = sim$data, family = gaussian(), lambda = 2)
predict(fit, type = "response")

Run the code above in your browser using DataLab