permu.gamhp | R Documentation |
Permutation Test of Hierarchical Partitioning for GAM Analysis
permu.gamhp(mod = NULL, iv = NULL, type = "dev", permutations = 10)
mod |
gam model generated by mgcv::gam() |
iv |
optional The relative importance of predictor groups will be assessed. The input for iv should be a list, where each element contains the names of variables belonging to a specific group. These variable names must correspond to the predictor variables defined in the model (mod). |
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(mod=mod1,type="dev",permutations=10)
iv <- list(env1=c("s(Petal.Length)","s(Petal.Width)"),env2="Sepal.Width")
permu.gamhp(mod=mod1,iv,type="dev",permutations=10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.