deviancepercentage {BiodiversityR} | R Documentation |
This function calculates the percentage of deviance explained by a GLM model and calculates the significance of the model.
deviancepercentage(x,data,test="F",digits=2)
x |
Result of GLM as calculated by glm or glm.nb . |
data |
Data set to be used for the null model (preferably the same data set used by the 'full' model). |
test |
Test statistic to be used for the comparison between the null model and the 'full' model as estimated by anova.glm or anova.negbin : partial match of one of "Chisq", "F" or "Cp". |
digits |
Number of digits in the calculation of the percentage. |
The function calculates the percentage of explained deviance and the significance of the 'full' model by contrasting it with the null model.
For the null model, the data is subjected to na.omit
. You should check whether the same data are used for the null and 'full' models.
The function calculates the percentage of explained deviance and the significance of the 'full' model by contrasting it with the null model by ANOVA. The results of the ANOVA are also provided.
Roeland Kindt
Kindt, R. & Coe, R. (2005) Tree diversity analysis: A manual and software for common statistical methods for ecological and biodiversity studies.
http://www.worldagroforestry.org/treesandmarkets/tree_diversity_analysis.asp
library(vegan) data(dune) data(dune.env) dune.env$Agrsto<- dune$Agrsto Count.model1 <- glm(Agrsto ~ Management + A1, family=quasipoisson(link=log), data=dune.env, na.action=na.omit) summary(Count.model1) deviancepercentage(Count.model1,dune.env)