neuropsychology/psycho.R

R2 for mixed models (Nakagawa, 2017)

DominiqueMakowski opened this issue · 2 comments

It would be nice to remove the dependency on MuMIn that is only used for GLMM's R2 and reimplement it using Nakagawa's (2017) most recent method.

MuMIn has been updated:

Most significant change is that to r.squaredGLMM (modified following Nakagawa et al 2017 paper), namely it now returns a 2-column matrix, not a 2-element vector. E.g.:

r.squaredGLMM(fm)
R2m R2c
theoretical 0.1474375 0.4687607
delta 0.1039262 0.3304214

Number of rows differ depending on the model family.

To get marginal R2, use <R2>[method, 1]
to get conditional R2, use <R2>[method, 2]

where method should be "trigamma" for models with "log" link and "delta" otherwise.
To get results compatible with previous version for binomial family, use method = "theoretical". The new R2 value may be different for poisson models. For "merMod" there is a "pj2014" argument which adds the older method of calculation named "pj2014".

This could generate some bugs. Must look into it.