plot.grpreg {grpreg} | R Documentation |
Produces a plot of the coefficient paths for a fitted "grpreg"
object.
## S3 method for class 'grpreg': plot(x, color=TRUE, alpha=1, type="l", pch=1:p, lty=1, xlab=expression(lambda), ylab=expression(hat(beta)), legend.loc, ...)
x |
Fitted "grpreg" model. |
color |
TRUE for color plots, FALSE for black and white.
Defaults to TRUE; overridden by col if both are specified. |
alpha |
Controls alpha-blending. Default is alpha=1. |
type |
Type of plot. Default is a line plot. See matplot
for details. |
lty |
Line type. Defaults to solid. See See matplot
for details. |
pch |
Plotting character. Defaults to no plotted characters.
See matplot for details. |
xlab |
Horizontal axis label. |
ylab |
Vertical axis label. |
legend.loc |
Where should the legend go? If left unspecified, no
legend is drawn. See legend for details. |
... |
Other graphical parameters to matplot |
Patrick Breheny <patrick.breheny@uky.edu>
Breheny, P. and Huang, J. (2009) Penalized methods for bi-level variable selection. Statistics and its interface, 2: 369–380.
grpreg
data(birthwt.grpreg) X <- as.matrix(birthwt.grpreg[,-1:-2]) y <- birthwt.grpreg$bwt group <- c(1,1,1,2,2,2,3,3,4,5,5,6,7,8,8,8) fit <- grpreg(X,y,group,penalty="gMCP",lambda.min=.5) plot(fit) plot(fit,color=FALSE) plot(fit,color=TRUE,legend.loc="topleft")