
Calculate a coefficient of determination based on the likelihood-ratio test
(
r.squaredLR(object, null = NULL, null.RE = FALSE, ...)null.fit(object, evaluate = FALSE, RE.keep = FALSE, envir = NULL, ...)
r.squaredLR
returns a value of "adj.r.squared"
gives the Nagelkerke's modified statistic.
Note that this is not the same as nor equivalent to the classical
‘adjusted R squared’.
null.fit
returns the fitted null model object (if
evaluate = TRUE
) or an unevaluated call to fit a null model.
a fitted model object.
a fitted null model. If not provided, 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.
logical, should the null model contain random factors? Only used if no null model is given, otherwise omitted, with a warning.
if TRUE
evaluate the fitted model object else return
the call.
if TRUE
, the random effects of the original model are
included.
the environment in which the null model is to be evaluated, defaults to the environment of the original model's formula.
further arguments, of which only x
would be used, to
maintain compatibility with older versions (x
has been replaced
with object
).
This statistic is is one of the several proposed pseudo-
where 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
‘variance explained’ by fixed effects.
For OLS models the value is consistent with classical
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 unrecognised class.
Cox, D. R. and Snell, E. J. 1989 The analysis of binary data, 2nd ed. London, Chapman and Hall.
Magee, L. 1990
Nagelkerke, N. J. D. 1991 A note on a general definition of the coefficient of determination. Biometrika 78, 691--692.
summary.lm
, r.squaredGLMM
r2
from package performance calculates
many different types of