plot.cv.PCLasso: Plot the cross-validation curve from a 'cv.PCLasso' object

Description Usage Arguments Details Author(s) See Also Examples

View source: R/plot.cv.PCLasso.R

Description

Plot the cross-validation curve from a cv.PCLasso object, along with standard error bars.

Usage

1
2
3
## S3 method for class 'cv.PCLasso'
plot(x, type = c("cve", "rsq", "snr", "all"), 
norm = NULL, ...)

Arguments

x

Fitted cv.PCLasso model.

type

What to plot on the vertical axis. "cve" plots the cross-validation error (deviance); "rsq" plots an estimate of the fraction of the deviance explained by the model (R-squared); "snr" plots an estimate of the signal-to-noise ratio; "all" produces all of the above.

norm

If TRUE, plot the norm of each group, rather than the individual coefficients.

...

Other graphical parameters to plot

Details

Error bars representing approximate +/- 1 SE (68% confidence intervals) are plotted along with the estimates at value of lambda. See plot.cv.grpreg in the R package grpreg for details.

Author(s)

Wei Liu

See Also

cv.PCLasso

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
library("survival")

# load data
data(ExpMatrix)
data(survData)
data(PCGroup)

x <- ExpMatrix    
y <- Surv(time=survData[,"time"], event=survData[,"status"])

cv.fit1 <- cv.PCLasso(x, y, group = PCGroup, penalty = "grLasso",nfolds = 10)

# plot the norm of each group
plot(cv.fit1, norm = TRUE)

# plot the individual coefficients
plot(cv.fit1, norm = FALSE)

# plot the cross-validation error (deviance)
plot(cv.fit1, type = "cve")

weiliu123/PCLasso documentation built on March 28, 2021, 3:51 a.m.