coef.cornet: Extract estimated coefficients

Description Usage Arguments Value Examples

View source: R/functions.R

Description

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

Usage

1
2
## 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

1
2
3
4
5
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 April 19, 2021, 9:07 a.m.