r.squaredLR(x, null = NULL, null.RE = FALSE)null.fit(x, evaluate = FALSE, RE.keep = FALSE, envir = NULL)
null.fit
will
be used to construct it. null.fit
's capabilities are limited to only
a few model classes, for others the null model has to be specified
manually.TRUE
evaluate the fitted model object else return
the call.TRUE
, the random effects of the original model are
included.r.squaredLR
returns a value of $R_{LR}^{2}$, and the
attribute "adj.r.squared"
gives the Nagelkerke's modified statistic.
Note that this is not the same as nor equivalent to the classical
null.fit
returns the fitted null model object (if
evaluate = TRUE
) or an unevaluated call to fit a null model.
logLik
with argument
REML = FALSE
). Note that the null model can include the random
factors of the original model, in which case the statistic represents the
For OLS models the value is consistent with classical $R^{2}$. In some cases (e.g. in logistic regression), the maximum $R_{LR}^{2}$ is less than one. The modification proposed by Nagelkerke (1991) adjusts the $R_{LR}^{2}$ to achieve 1 at its maximum: $\bar{R}^{2} = R_{LR}^{2} / \max(R_{LR}^{2})$ where $max(R_{LR}^{2}) = 1 - \exp(\frac{2}{n}\log\mathit{Lik}(\textrm{0}))$.
null.fit
tries to guess the null model call, given the provided
fitted model object. This would be usually a glm
. The function will give
an error for an unrecognized class.
Magee, L. (1990) R$^{2}$ measures based on Wald and likelihood ratio joint significance tests. Amer. Stat. 44: 250-253
Nagelkerke, N. J. D. (1991) A note on a general definition of the coefficient of determination. Biometrika 78: 691-692
summary.lm
, r.squaredGLMM