Learn R Programming

MuMIn (version 1.15.1)

r.squaredGLMM: Pseudo-R-squared for Generalized Mixed-Effect models

Description

Calculate conditional and marginal coefficient of determination for Generalized mixed-effect models (GLMM).

Usage

r.squaredGLMM(x)

Arguments

x
a fitted linear model object.

Value

  • r.squaredGLMM returns a numeric vector with two values for marginal and conditional GLMM.

encoding

utf-8

newcommand

  • \Rsqx
  • \Rsq
  • \mydequation
  • \myequation

ifelse

  • latex
  • html
  • latex
  • html
  • latex
  • html
  • latex
  • html

eqn

$#1$

enc

  • R_#1²
  • $$#2$$
  • $#2$

deqn

$$#1$$

Details

For mixed-effects models, \Rsqcan be categorized into two types. Marginal GLMM represents the variance explained by fixed factors, and is defined as:

R_{GLMM(m)}^{2}= \sigma_f^2{\sigma_f^2 + \sum_{l=1}^{u}\sigma_{l}^{2} + \sigma_e^2 + \sigma_d^2}{R_GLMM(m)² = (\sigma_f²) / (\sigma_f² + \sum(\sigma_l²) + \sigma_e² + \sigma_d² }{R_GLMM(m)^2 = (sigma_f^2) / (sigma_f^2 + sum(sigma_l^2) + sigma_e^2 + sigma_d^2 }

Conditional GLMM is interpreted as variance explained by both fixed and random factors (i.e. the entire model), and is calculated according to the equation:

R_{GLMM(c)}^{2}= \sigma_f^2 + \sum_{l=1}^{u}\sigma_{l}^{2}{\sigma_f^2 + \sum_{l=1}^{u}\sigma_{l}^{2} + \sigma_e^2 + \sigma_d^2}{R_GLMM(c)²= (\sigma_f² + \sum(\sigma_l²)) / (\sigma_f² + \sum(\sigma_l²) + \sigma_e² + \sigma_d² }{R_GLMM(c)^2= (sigma_f^2 + sum(sigma_l^2)) / (sigma_f^2 + sum(sigma_l^2) + sigma_e^2 + sigma_d^2 }

where \sigma_f^2{\sigma_f²}{sigma_f^2} is the variance of the fixed effect components, and \sum\sigma_{l}^{2}{\sum\sigma_l²}{sum(sigma_l^2)} is the sum of all $u$ variance components (group, individual, etc.), \sigma_l^2{\sigma_l²}{sigma_l^2} is the variance due to additive dispersion and \sigma_d^2{\sigma_d²}{sigma_d^2} is the distribution-specific variance.

References

Nakagawa, S, Schielzeth, H. (2013). A general and simple method for obtaining \Rsqfrom Generalized Linear Mixed-effects Models. Methods in Ecology and Evolution 4: 133–142

Johnson, P.C.D. (2014) Extension Nakagawa & Schielzeth’s GLMM to random slopes models. Methods in Ecology and Evolution 5: 44-946.

See Also

summary.lm, r.squaredLR

Examples

Run this code
if(require(nlme)) {
data(Orthodont, package = "nlme")

fm1 <- lme(distance ~ Sex * age, ~ 1 | Subject, data = Orthodont)

r.squaredGLMM(fm1)
r.squaredLR(fm1)
r.squaredLR(fm1, null.RE = TRUE)
}

Run the code above in your browser using DataLab