Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ecospat.permut.glm

GLM Permutation Function


Description

A permutation function to get p-values on GLM coefficients and deviance.

Usage

ecospat.permut.glm (glm.obj, nperm, verbose = FALSE)

Arguments

glm.obj

Any calibrated GLM or GAM object with a binomial error distribution.

nperm

The number of permutations in the randomization process.

verbose

Boolean indicating whether to print progress output during calculation. Default is FALSE.

Details

Rows of the response variable are permuted and a new GLM is calibrated as well as deviance, adjusted deviance and coefficients are calculated. These random parameters are compared to the true parameters in order to derive p-values.

Value

Return p-values that are how the true parameters of the original model deviate from the disribution of the random parameters. A p-value of zero means that the true parameter is completely outside the random distribution.

Author(s)

Christophe Randin christophe.randin@unibas.ch, Antoine Guisan antoine.guisan@unil.ch and Trevor Hastie

References

Hastie, T., R. Tibshirani and J. Friedman. 2001. Elements of Statistical Learning; Data Mining, Inference, and Prediction, Springer-Verlag, New York.

Legendre, P. and L. Legendre. 1998. Numerical Ecology, 2nd English edition. Elsevier Science BV, Amsterdam.

Examples

library(rms)
data('ecospat.testData')

# data for Soldanella alpina
data.Solalp<- ecospat.testData[c("Soldanella_alpina","ddeg","mind","srad","slp","topo")] 

# gbm model for Soldanella alpina

glm.Solalp <- glm(Soldanella_alpina ~ pol(ddeg,2) + pol(mind,2) + pol(srad,2) + pol(slp,2) 
      + pol(topo,2), data = data.Solalp, family = binomial)
                  
# p-values
ecospat.permut.glm (glm.Solalp, 1000)

ecospat

Spatial Ecology Miscellaneous Methods

v3.2
GPL
Authors
Olivier Broennimann [cre, aut, ctb], Valeria Di Cola [aut, ctb], Blaise Petitpierre [ctb], Frank Breiner [ctb], Daniel Scherrer [ctb], Manuela D`Amen [ctb], Christophe Randin [ctb], Robin Engler [ctb], Wim Hordijk [ctb], Heidi Mod [ctb], Julien Pottier [ctb], Mirko Di Febbraro [ctb], Loic Pellissier [ctb], Dorothea Pio [ctb], Ruben Garcia Mateo [ctb], Anne Dubuis [ctb], Luigi Maiorano [ctb], Achilleas Psomas [ctb], Charlotte Ndiribe [ctb], Nicolas Salamin [ctb], Niklaus Zimmermann [ctb], Antoine Guisan [aut]
Initial release
2021-02-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.