View source: R/S3methods_islasso.R
predict.islasso | R Documentation |
Computes predictions from a fitted islasso
model object. Multiple output types supported, including response scale, linear predictor, and coefficient values.
## S3 method for class '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,
...
)
object |
A fitted model of class |
newdata |
Optional data frame containing predictors for prediction. If omitted, the fitted model matrix is used. |
type |
Character. Specifies the prediction scale:
|
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 |
level |
Confidence level for intervals. Default is |
terms |
If |
na.action |
Function to handle missing values in |
... |
Additional arguments passed to downstream methods. |
A numeric vector, matrix, or list depending on type
.
Gianluca Sottile gianluca.sottile@unipa.it
islasso
, summary.islasso
, logLik.islasso
, residuals.islasso
, deviance.islasso
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.