For mixed-effects models, R$^{2}$ can be categorized into two types:
marginal and conditional. Marginal R$^{2}$ represents the
variance explained by fixed factors, and is defined as:$$R_{GLMM(m)}^{2}= \frac{\sigma_f^2}{\sigma_f^2
+ \sum_{l=1}^{u}\sigma_{l}^{2} + \sigma_\epsilon^2}$$
Conditional R$^{2}$ 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}= \frac{\sigma_f^2 + \sum_{l=1}^{u}\sigma_{l}^{2}}{\sigma_f^2 +
\sum_{l=1}^{u}\sigma_{l}^{2} + \sigma_\epsilon^2}$$
where $\sigma_f^2$ is the variance of the fixed effect components, and
$\sum \sigma_{l}^{2}$ is the sum of all
latex{$u$}{} variance components (group, individual, etc.), and
$\sigma_\epsilon^2$ is the residual variance.