plot.coxpath: Plots the regularization path computed from coxpath

Description Usage Arguments Author(s) References See Also Examples

View source: R/coxpath.97.R

Description

This function takes a coxpath object and visualizes the regularization path. The horizontal axis can be norm, lambda or step. The vertical axis can be coefficients, aic or bic.

Usage

1
2
3
4
5
6
  ## S3 method for class 'coxpath'
plot(x, xvar = c("norm", "lambda", "step"),
     type = c("coefficients", "aic", "bic"),
     plot.all.steps = FALSE, xlimit = NULL, predictor = FALSE,
     omit.zero = TRUE, breaks = TRUE, mar = NULL, main = NULL,
     eps = .Machine$double.eps, ...)

Arguments

x

a coxpath object

xvar

horizontal axis. xvar=norm plots against the L1 norm of the coefficients (to which L1 norm penalty was applied); xvar=lambda plots against λ; and xvar=step plots against the number of steps taken. Default is norm.

type

type of the plot, or the vertical axis. Default is coefficients.

plot.all.steps

If TRUE, all the steps taken along the path are marked on the plot. If FALSE, which is the default, only the steps at which the active set changed are shown on the plot.

xlimit

When the user wants to visualize a (beginning) sub-part of the plot, xlimit sets an upper limit to the L1 norm or the number of steps, or a lower limit to λ.

predictor

If TRUE and type=coefficients, the predictor step estimates are connected with dotted lines. If FALSE, only the corrector step estimates are connected with solid lines.

omit.zero

If TRUE, the predictors that were never in the active set are omitted.

breaks

If TRUE, vertical lines are drawn at the points where the active set changes and numbered with the degrees of freedom.

mar

margin relative to the current font size

main

title of the plot

eps

an effective zero

...

other options for the plot

Author(s)

Mee Young Park and Trevor Hastie

References

Mee Young Park and Trevor Hastie (2007) L1 regularization path algorithm for generalized linear models. J. R. Statist. Soc. B, 69, 659-677.

See Also

cv.coxpath, coxpath, predict.coxpath

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(lung.data)
attach(lung.data)
fit <- coxpath(lung.data)
par(mfrow=c(3, 2))
plot(fit)
plot(fit, xvar="lambda")
plot(fit, xvar="step")
plot(fit, xvar="step", xlimit=8)
plot(fit, type="aic")
plot(fit, type="bic")
detach(lung.data)

Example output

Loading required package: survival

glmpath documentation built on May 2, 2019, 4 p.m.