Learn R Programming

chemometrics (version 1.4.1)

lassocoef: Plot Lasso coefficients

Description

Plots the coefficients of Lasso regression

Usage

lassocoef(formula, data, sopt, plot.opt = TRUE, ...)

Arguments

formula
formula, like y~X, i.e., dependent~response variables
data
data frame to be analyzed
sopt
optimal fraction from Lasso regression, see details
plot.opt
if TRUE a plot will be generated
...
additional plot arguments

Value

Details

Using the function lassoCV for cross-validation, the optimal fraction sopt can be determined. Besides a plot for the Lasso coefficients for all values of fraction, the optimal fraction is taken to compute the number of coefficients that are exactly zero.

References

K. Varmuza and P. Filzmoser: Introduction to Multivariate Statistical Analysis in Chemometrics. CRC Press, Boca Raton, FL, 2009.

See Also

cv.lars, lassoCV

Examples

Run this code
data(PAC)
res=lassocoef(y~X,data=PAC,sopt=0.3)

Run the code above in your browser using DataLab