plot.tune.ahazpen | R Documentation |
Plot, as a function of the penalty parameter, the curve of tuning scores produced when tuning a penalized semiparametric additive hazards model.
## S3 method for class 'tune.ahazpen' plot(x, df = TRUE, ...)
x |
The result of a call to |
df |
Display number of nonzero parameters in top margin. Default
is |
... |
Additional graphical arguments passed to the |
A plot is produced displaying the tuning score for each value
of penalty parameter
(alongside upper and lower standard deviation curves, if cross-validation
has been used). The value of
lambda
which minimizes the estimated tuning score
is indicated with a dashed vertical line.
ahazpen
, tune.ahazpen
, print.tune.ahazpen
.
data(sorlie) # Break ties set.seed(10101) time <- sorlie$time+runif(nrow(sorlie))*1e-2 # Survival data + covariates surv <- Surv(time,sorlie$status) X <- as.matrix(sorlie[,3:ncol(sorlie)]) # Do 10 fold cross-validation set.seed(10101) tune.fit <- tune.ahazpen(surv, X, penalty="lasso", dfmax=50, tune = cv.control(nfolds=10)) plot(tune.fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.