Learn R Programming

psycho (version 0.4.91)

R2_nakagawa: Pseudo-R-squared for Generalized Mixed-Effect models.

Description

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 Conditional R_GLMM<U+00B2> is interpreted as variance explained by both fixed and random factors (i.e. the entire model). IMPORTANT: Looking for help to reimplement this method.

Usage

R2_nakagawa(fit)

Arguments

fit

A mixed model.

References

Nakagawa, S., Johnson, P. C., & Schielzeth, H. (2017). The coefficient of determination R2 and intra-class correlation coefficient from generalized linear mixed-effects models revisited and expanded. Journal of the Royal Society Interface, 14(134), 20170213. Nakagawa, S., & Schielzeth, H. (2013). A general and simple method for obtaining R2 from generalized linear mixed-effects models. Methods in Ecology and Evolution, 4(2), 133-142.

Examples

Run this code
# NOT RUN {
library(psycho)

fit <- lmerTest::lmer(Sepal.Length ~ Sepal.Width + (1 | Species), data = iris)

R2_nakagawa(fit)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab