penAFT.plot: Plot cross-validation curves

View source: R/penAFT.aux.R

penAFT.plotR Documentation

Plot cross-validation curves

Description

A function for plotting the cross-validation curves for the regularized semiparametric accelerated failure time model estimator.

Usage

penAFT.plot(fit)

Arguments

fit

A fitted model from penAFT.cv.

Details

This function returns a plot with the cross-validation curves for the regularized Gehan estimator. The vertical blue line indicates the tuning parameter which minimized cross-validated linear predictor scores and the vertical black line indicates the tuning parameter which minimized the cross-validated Gehan loss according to the one-standard-error rule. The vertical axis (and blue line) denotes the cross-validated linear predictor scores whereas the right vertical axis (and black line) denotes cross-validated Gehan loss and standard errors). To make matters simple, we do not allow for customization of the plot: please refer to the source code if extensive customization is desired.

Value

No return value; prints a plot of cross-validation curves as described in Details.

Examples


  # --------------------------------------
  # Generate data  
  # --------------------------------------
  set.seed(1)
  genData <- genSurvData(n = 50, p = 100, s = 10, mag = 2, cens.quant = 0.6)
  X <- genData$X
  logY <- genData$logY
  delta <- genData$status
  
  
  # ------------------------------------------
  # Fit elastic net penalized estimator with CV
  # -------------------------------------------
  fit.cv <- penAFT.cv(X = X, logY = logY, delta = delta,
                    nlambda = 50,
                    penalty = "EN", tol.rel = 1e-5,
                    alpha = 1, nfolds = 10)
  penAFT.plot(fit.cv)



penAFT documentation built on April 18, 2023, 9:10 a.m.