Learn R Programming

broom (version 0.3.7)

gam_tidiers: Tidying methods for a generalized additive model (gam)

Description

These methods tidy the coefficients of a "gam" object (generalized additive model) into a summary, augment the original data with information on the fitted values and residuals, and construct a one-row glance of the model's statistics.

Usage

## S3 method for class 'gam':
tidy(x, ...)

## S3 method for class 'gam': glance(x, ...)

Arguments

x
gam object
...
extra arguments (not used)

Value

  • All tidying methods return a data.frame without rownames, whose structure depends on the method chosen.

    tidy.gam returns the tidied output of the parametric ANOVA, with one row for each term in the formula. The columns match those in anova_tidiers.

    glance.gam returns a one-row data.frame with the columns

  • dfDegrees of freedom used by the coefficients
  • logLikthe data's log-likelihood under the model
  • AICthe Akaike Information Criterion
  • BICthe Bayesian Information Criterion
  • deviancedeviance
  • df.residualresidual degrees of freedom

Details

The "augment" method is handled by lm_tidiers.

See Also

lm_tidiers, anova_tidiers

Examples

Run this code
if (require("gam", quietly = TRUE)) {
    data(kyphosis)
    g <- gam(Kyphosis ~ s(Age,4) + Number, family = binomial, data = kyphosis)
    tidy(g)
    augment(g)
    glance(g)
}

Run the code above in your browser using DataLab