Learn R Programming

PCLassoReg (version 1.0.0)

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

Description

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

Usage

# S3 method for cv.PCLasso2
plot(x, type = c("cve", "rsq", "snr", "all"), norm = NULL, ...)

Arguments

x

Fitted cv.PCLasso2 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

Value

No return value, called for plotting of cv.PCLasso2 objects.

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.

See Also

cv.PCLasso2

Examples

Run this code
# NOT RUN {
# load data
data(classData)
data(PCGroups)

x = classData$Exp
y = classData$Label

PC.Human <- getPCGroups(Groups = PCGroups, Organism = "Human",
Type = "GeneSymbol")

# fit model
cv.fit1 <- cv.PCLasso2(x, y, group = PC.Human, penalty = "grLasso",
family = "binomial", 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")
# }

Run the code above in your browser using DataLab