glmm.hp {glmm.hp}R Documentation

Hierarchical Partitioning of Marginal R2 for Generalized Mixed-Effect Models

Description

Hierarchical Partitioning of Marginal R2 for Generalized Mixed-Effect Models

Usage

glmm.hp(mod, type = "adjR2", commonality = FALSE)

Arguments

mod

Fitted lme4,nlme,glmmTMB,glm or lm model objects.

type

The type of R-square of lm, either "R2" or "adjR2", in which "R2" is unadjusted R-square and "adjR2" is adjusted R-square, the default is "adjR2". The adjusted R-square is calculated using Ezekiel's formula (Ezekiel 1930) for lm.

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 (marginal) R2 for Generalized Linear Mixed-effect Model (including lm,glm and glmm). The marginal R2 is the output of r.squaredGLMM in MuMIn package for glm and glmm.

Value

r.squaredGLMM

The R2 for the full model.

hierarchical.partitioning

A matrix containing individual effects and percentage of individual effects towards total (marginal) R2 for each predictor.

Author(s)

Jiangshan Lai lai@njfu.edu.cn

References

Examples

library(MuMIn)
library(lme4)
mod1 <- lmer(Sepal.Length ~ Petal.Length + Petal.Width+(1|Species),data = iris)
r.squaredGLMM(mod1)
glmm.hp(mod1)
a <- glmm.hp(mod1)
plot(a)
mod2 <- glm(Sepal.Length ~ Petal.Length + Petal.Width, data = iris)
r.squaredGLMM(mod2)
glmm.hp(mod2)
b <- glmm.hp(mod2)
plot(b)
plot(glmm.hp(mod2))
mod3 <- lm(Sepal.Length ~ Petal.Length + Petal.Width + Petal.Length:Petal.Width, data = iris)
glmm.hp(mod3,type="R2")
glmm.hp(mod3,commonality=TRUE)

[Package glmm.hp version 0.1-3 Index]