plot.grpreg {grpreg} | R Documentation |
Produces a plot of the coefficient paths for a fitted "grpreg"
object.
## S3 method for class 'grpreg': plot(x,col=NULL,alpha=FALSE,color=TRUE,type="l",lty=1,pch=NULL,xlab=expression(lambda),ylab=expression(hat(beta)),...)
x |
Fitted "grpreg" model. |
col |
A vector of colors with length equal to the number of penalized coefficients in the model. By default, coefficients will be colored by group, with colors equally spaced in the HSV color space. |
alpha |
Controls alpha-blending. Can be: FALSE, which turns off alpha-blending; TRUE, causing the function to automatically generate a reasonable level of alpha-blending depending on the number of coefficients; or a numeric vector of user-supplied alpha values. The usual recycling rules apply. |
color |
TRUE for color plots, FALSE for black and white.
Defaults to TRUE; overrides col if both are specified. |
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. |
... |
Other graphical parameters to matplot |
Patrick Breheny <patrick-breheny@uiowa.edu>
Breheny, P. and Huang, J. (2008) Penalized Methods for Bi-level variable selection. Tech report No. 393, Department of Statistics and Actuarial Science, University of Iowa.http://www.stat.uiowa.edu/techrep/tr393.pdf
grpreg
data(birthwt.grpreg) Data.gaussian <- list(y=birthwt.grpreg$bwt, X=as.matrix(birthwt.grpreg[,c(-1,-2)]), family="gaussian", group=c(1,1,1,2,2,2,3,3,4,5,5,6,7,8,8,8)) fit <- grpreg(Data.gaussian,"gMCP") plot(fit) plot(fit,color=FALSE,lty=rep(1:8,table(Data.gaussian$group))) plot(fit,col=rep(c("red","blue","black","green","yellow","brown","purple","gray"),table(Data.gaussian$group)))