Learn R Programming

BeSS (version 2.0.2)

coef.bess: Provides estimated coefficients from a fitted "bess" object.

Description

This function provides estimated coefficients from a fitted "bess" object.

Usage

# S3 method for bess
coef(object, sparse = TRUE, ...)

Arguments

object

A "bess" project.

sparse

Logical or NULL, specifying whether the coefficients should be presented as sparse matrix or not.

Other arguments.

References

Wen, C., Zhang, A., Quan, S. and Wang, X. (2020). BeSS: An R Package for Best Subset Selection in Linear, Logistic and Cox Proportional Hazards Models, Journal of Statistical Software, Vol. 94(4). doi:10.18637/jss.v094.i04.

See Also

bess, print.bess.

Examples

Run this code
# NOT RUN {
# Generate simulated data
n <- 200
p <- 20
k <- 5
rho <- 0.4
seed <- 10
Tbeta <- rep(0, p)
Tbeta[1:k*floor(p/k):floor(p/k)] <- rep(1, k)
Data <- gen.data(n, p, k, rho, family = "gaussian", beta = Tbeta, seed = seed)
lm.bss <- bess(Data$x, Data$y, method = "sequential")
lambda.list <- exp(seq(log(5), log(0.1), length.out = 10))
lm.bsrr <- bess(Data$x, Data$y, type = "bsrr", method = "pgsection")
coef(lm.bss)
coef(lm.bsrr)
# }

Run the code above in your browser using DataLab