Learn R Programming

dglars (version 1.0.2)

print.dglars: Print a dglars object

Description

Print information about the sequence of models identified by the dgLARS method.

Usage

## S3 method for class 'dglars':
print(x, digits = max(3, getOption("digits") - 3), ...)

Arguments

x
fitted dglars object
digits
significant digits in printout
...
additional print arguments

Value

  • The data.frame above is silently returned.

Details

The call that produced the object x is printed, followed by a five-column data.frame with columns Sequence, g, Dev, %Dev and df. The column named Sequence gives us information on how is changed the active set along the path. The column named g shows the sequence of the $\gamma$ values used to compute the solution curve, while the columns Dev and %Dev show the corresponding deviance and the fraction of explained deviance, respectively. Finally the df column shows the number of nonzero coefficients. The last part gives information about the algorithm and the method used to compute the solution curve. The code about the convergence of the used algorithm is also showed.

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")
fit

#############################
# Poisson regression model #

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

Run the code above in your browser using DataLab