residuals.ncvreg | R Documentation |
Currently, only deviance residuals are supported.
## S3 method for class 'ncvreg'
residuals(object, lambda, which = 1:length(object$lambda), drop = TRUE, ...)
object |
Object of class |
lambda |
Values of the regularization parameter at which residuals are requested (numeric vector). For values of lambda not in the sequence of fitted models, linear interpolation is used. |
which |
Index of the penalty parameter at which residuals are requested (default = all indices). If |
drop |
By default, if a single value of lambda is supplied, a vector of residuals is returned (logical; default= |
... |
Not used. |
data(Prostate)
X <- Prostate$X
y <- Prostate$y
fit <- ncvreg(X, y)
residuals(fit)[1:5, 1:5]
head(residuals(fit, lambda=0.1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.