coef.cornet: Extract estimated coefficients

View source: R/functions.R

coef.cornetR Documentation

Extract estimated coefficients

Description

Extracts estimated coefficients from linear and logistic regression, under the penalty parameter that minimises the cross-validated loss.

Usage

## S3 method for class 'cornet'
coef(object, ...)

Arguments

object

cornet object

...

further arguments (not applicable)

Value

This function returns a matrix with n rows and two columns, where n is the sample size. It includes the estimated coefficients from linear regression (1st column: "beta") and logistic regression (2nd column: "gamma").

Examples

n <- 100; p <- 200
y <- rnorm(n)
X <- matrix(rnorm(n*p),nrow=n,ncol=p)
net <- cornet(y=y,cutoff=0,X=X)
coef(net)


cornet documentation built on Aug. 17, 2022, 5:06 p.m.