Learn R Programming

MuMIn (version 1.15.6)

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

Description

Calculate conditional and marginal coefficient of determination for Generalized mixed-effect models (R_GLMM<U+00B2>).

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 R_GLMM<U+00B2>.

Details

For mixed-effects models, R<U+00B2> can be categorized into two types. Marginal R_GLMM<U+00B2> represents the variance explained by fixed factors, and is defined as:

$$R_GLMM(m)<U+00B2> = (\sigma_f<U+00B2>) / (\sigma_f<U+00B2> + \sum(\sigma_l<U+00B2>) + \sigma_e<U+00B2> + \sigma_d<U+00B2> $$

Conditional R_GLMM<U+00B2> 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)<U+00B2>= (\sigma_f<U+00B2> + \sum(\sigma_l<U+00B2>)) / (\sigma_f<U+00B2> + \sum(\sigma_l<U+00B2>) + \sigma_e<U+00B2> + \sigma_d<U+00B2> $$

where \(\sigma_f<U+00B2>\) is the variance of the fixed effect components, and \(\sum \sigma_l<U+00B2>\) is the sum of all \(u\) variance components (group, individual, etc.), \(\sigma_l<U+00B2>\) is the variance due to additive dispersion and \(\sigma_d<U+00B2>\) is the distribution-specific variance.

References

Nakagawa, S, Schielzeth, H. (2013). A general and simple method for obtaining R<U+00B2> from Generalized Linear Mixed-effects Models. Methods in Ecology and Evolution 4: 133<U+2013>142

Johnson, P.C.D. (2014) Extension Nakagawa & Schielzeth<U+2019>s R_GLMM<U+00B2> to random slopes models. Methods in Ecology and Evolution 5: 44-946.

See Also

summary.lm, r.squaredLR

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
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