Learn R Programming

flexOR (version 1.0.0)

AICc: AICc: Calculation for GAM Models

Description

Calculates AICc (Akaike Information Criterion corrected for small sample sizes) for Generalized Additive Models (GAM).

Usage

AICc(object)

Value

A numeric value representing the AICc for the GAM model.

Arguments

object

An object of class "Gam" or "gam" representing a fitted GAM model.

Details

This function calculates the AICc value (Akaike Information Criterion corrected for small sample sizes) for a given GAM model. AICc is a measure of model fit that penalizes the number of parameters in the model to avoid overfitting.

See Also

gam, logLik, AIC

Examples

Run this code
# Load dataset
data(PimaIndiansDiabetes2, package="mlbench");

# Fit GAM model
fit <- mgcv::gam(
  diabetes ~ s(age) + s(mass) + s(pedigree) + pressure + glucose,
  data=PimaIndiansDiabetes2,
  family=binomial
);

# Calculate AICc
AICc(fit);

Run the code above in your browser using DataLab