coef.compCL: extracts model estimated coefficients from a '"compCL"'...

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

View source: R/tools.R

Description

gets the coefficients at the requested values for lam from a fitted "compCL" object.

Usage

1
2
## S3 method for class 'compCL'
coef(object, s = NULL, ...)

Arguments

object

fitted "compCL" object.

s

value(s) of the penalty parameter lam at which coefficients are requested. Default (NULL) is the entire sequence used to create the model.

...

Not used.

Details

s is a vector of lambda values at which the coefficients are requested. If s is not in the lam sequence used for fitting the model, the coef function will use linear interpolation, so the function should be used with caution.

Value

The coefficients at the requested tuning parameter values in s.

Author(s)

Zhe Sun and Kun Chen

References

Lin, W., Shi, P., Peng, R. and Li, H. (2014) Variable selection in regression with compositional covariates, https://academic.oup.com/biomet/article/101/4/785/1775476. Biometrika 101 785-979.

See Also

compCL and predict, plot and print methods for "compCL" object.

Examples

1
2
3
4
5
6
Comp_data = comp_Model(n = 50, p = 30)
Comp_fit = compCL(y = Comp_data$y, Z = Comp_data$X.comp, Zc = Comp_data$Zc,
                  intercept = Comp_data$intercept)
coef(Comp_fit)
coef(Comp_fit, s = Comp_fit$lam[50])
coef(Comp_fit, s = c(1, 0.5, 0.1))

Compack documentation built on July 1, 2020, 10:26 p.m.