gam.hp {gam.hp}R Documentation

Hierarchical Partitioning of Adjusted R2 and Explained Deviance for Generalized Additive Models

Description

Hierarchical Partitioning of Adjusted R2 and Explained Deviance for Generalized Additive Models

Usage

gam.hp(mod, type = "dev", commonality = FALSE)

Arguments

mod

Fitted "gam" model objects.

type

The type of R-square of gam, either "dev" or "adjR2", in which "dev" is explained deviance and "adjR2" is adjusted R-square, the default is "dev".

commonality

Logical; If TRUE, the result of commonality analysis (2^N-1 fractions for N predictors) is shown, the default is FALSE.

Details

This function conducts hierarchical partitioning to calculate the individual contributions of each predictor towards total adjusted R2 and explained deviance for Generalized Additive Models. The adjusted R2 and explained deviance are is the output of summary.gam()in mgcv package.

Value

dev

The R2 for the full model.

hierarchical.partitioning

A matrix containing individual effects and percentage of individual effects towards total adjusted R2 and explained deviance for each predictor.

Author(s)

Jiangshan Lai lai@njfu.edu.cn

References

Examples

library(mgcv)
mod1 <- gam(Sepal.Length ~ s(Petal.Length) + s(Petal.Width) + Sepal.Width,data = iris)
summary(mod1)
gam.hp(mod1)
gam.hp(mod1,type="adjR2")
gam.hp(mod1,commonality=TRUE)

[Package gam.hp version 0.0-1 Index]