MuMIn::r.squaredGLMM and piecewiseSEM::sem.model.fits should be preforming the same calculations. They are implementing Schielzeth and Nakagawa's R2 for generalized linear mixed effects models. However, I keep getting different results between the two. Does anyone know why? Which is more accurate? Thanks for any input you may have.
Here is an example
library(lme4)
data("cbpp")
mod <- glmer(incidence / size ~ period + (1 | herd), weights = size,
family = binomial, data = cbpp)
library(piecewiseSEM)
sem.model.fits(mod)#R2m:0.09, R2c:0.19
library(MuMIn)
r.squaredGLMM(mod)#R2m:0.11, R2c:0.11
Documentation for the two functions
https://rdrr.io/cran/piecewiseSEM/man/sem.model.fits.html https://www.rdocumentation.org/packages/MuMIn/versions/1.40.0/topics/r.squaredGLMM