Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

coefvgam

Extract Model Coefficients of a vgam() Object


Description

Extracts the estimated coefficients from vgam() objects.

Usage

coefvgam(object, type = c("linear", "nonlinear"), ...)

Arguments

object

A vgam object.

type

Character. The default is the first choice.

...

Optional arguments fed into coefvlm.

Details

For VGAMs, because modified backfitting is performed, each fitted function is decomposed into a linear and nonlinear (smooth) part. The argument type is used to return which one is wanted.

Value

A vector if type = "linear". A list if type = "nonlinear", and each component of this list corresponds to an s term; the component contains an S4 object with slot names such as "Bcoefficients", "knots", "xmin", "xmax".

Author(s)

Thomas W. Yee

See Also

Examples

fit <- vgam(agaaus ~ s(altitude, df = 2), binomialff, data = hunua)
coef(fit)  # Same as coef(fit, type = "linear")
(ii <- coef(fit, type = "nonlinear"))
is.list(ii)
names(ii)
slotNames(ii[[1]])

VGAM

Vector Generalized Linear and Additive Models

v1.1-5
GPL-3
Authors
Thomas Yee [aut, cre], Cleve Moler [ctb] (author of several LINPACK routines)
Initial release
2021-01-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.