R/predict-cv.R

Defines functions coef.cv.grpreg predict.cv.grpreg

Documented in coef.cv.grpreg predict.cv.grpreg

predict.cv.grpreg <- function(object, X, lambda=object$lambda.min, which=object$min, type=c("link", "response", "class", "coefficients", "vars", "groups", "nvars", "ngroups", "norm"), ...) {
  type <- match.arg(type)
  if (inherits(object, 'cv.grpsurv')) {
    return(predict.grpsurv(object$fit, X=X, lambda=lambda, which=which, type=type, ...))
  } else {
    return(predict.grpreg(object$fit, X=X, lambda=lambda, which=which, type=type, ...))
  }
}
coef.cv.grpreg <- function(object, lambda=object$lambda.min, which=object$min, ...) {
  coef.grpreg(object$fit, lambda=lambda, which=which, ...)
}

Try the grpreg package in your browser

Any scripts or data that you put into this service are public.

grpreg documentation built on July 27, 2021, 1:08 a.m.