Learn R Programming

spareg (version 1.1.1)

get_coef: Extractor for Model Coefficients from 'coefspar' Object

Description

Extractor for Model Coefficients from 'coefspar' Object

Usage

get_coef(x)

Value

A numeric vector or matrix of coefficients.

Arguments

x

A `coefspar' object.

See Also

coef.spar, coef.spar.cv, print.coefspar, summary.coefspar

Examples

Run this code
example_data <- simulate_spareg_data(n = 100, p = 400, ntest = 100)
spar_res <- spar(example_data$x, example_data$y, xval = example_data$xtest,
  yval = example_data$ytest, nummods=c(5, 10))
coefs <- coef(spar_res)
get_coef(coefs)

Run the code above in your browser using DataLab