lassocoef: Plot Lasso coefficients

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/lassocoef.R

Description

Plots the coefficients of Lasso regression

Usage

1
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

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.

Value

coefficients

regression coefficients for the optimal Lasso parameter

sopt

optimal value for fraction

numb.zero

number of zero coefficients for optimal fraction

numb.nonzero

number of nonzero coefficients for optimal fraction

ind

index of fraction with optimal choice for fraction

Author(s)

Peter Filzmoser <[email protected]>

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

1
2
data(PAC)
res=lassocoef(y~X,data=PAC,sopt=0.3)

chemometrics documentation built on May 29, 2017, 10:42 a.m.