permu.gamhp {gam.hp} | R Documentation |
Permutation Test of Hierarchical Partitioning for GAM Analysis
permu.gamhp(mod = NULL, type = "dev", permutations = 10)
mod |
gam model generated by mgcv::gam() |
type |
The type of total explained variation, either "dev" or "adjR2", in which "dev" is deviance explained and "adjR2" is adjusted R-square, the default is "adjR2". |
permutations |
An integer; Number of permutations for computing p value of individual contribution for the randomized dataset. |
This function is a permutation test of hierarchical partitioning for gam analysis. It returns a matrix of I values (the individual contribution towards total explained variation) for all values from permutations randomizations. For each permutation, the values in each variable (i.e each column of iv) are randomized independently, and gam.hp is run on the randomized iv. As well as the randomized I matrix, the function returns a summary table listing the observed I values, the p value of I for the randomized dataset.
a data.frame containing a summary table listing the observed individual contribution, the p value of individual contribution for the randomized dataset
Jiangshan Lai lai@njfu.edu.cn
library(mgcv)
mod1 <- gam(Sepal.Length ~ s(Petal.Length) + s(Petal.Width) + Sepal.Width,data = iris)
permu.gamhp(mod1,type="dev",permutations=10)