Learn R Programming

dglars (version 1.0.5)

coef.dglars: Extract the path of the coefficients

Description

coef.dglars is used to extract the path of the coefficients computed using the dgLARS method.

Usage

"coef"(object, ...)

Arguments

object
fitted dglars object
...
additional arguments

Value

coef.dglars returns a matrix with the solution path computed using the dgLARS method.

See Also

dglars function.

Examples

Run this code
######################
# Logistic regression model

set.seed(123)

n <- 100
p <- 10
X <- matrix(rnorm(n*p), n, p)
b <- 1:2
eta <- b[1] + X[,1] * b[2]
mu <- binomial()$linkinv(eta)
y <- rbinom(n, 1, mu)
fit <- dglars.fit(X, y, family = "binomial")
coef(fit)

Run the code above in your browser using DataLab