logLik(object, ...) ## S3 method for class 'logLik': print(x, digits = getOption("digits"), ...) ## S3 method for class 'logLik': logLik(object, ...) ## S3 method for class 'lm': logLik(object, REML = FALSE, ...) ## S3 method for class 'nls': logLik(object, REML = FALSE) ## S3 method for class 'logLik': str(object, digits = max(2, getOption("digits") - 3), vec.len = getOption("str")$vec.len, ...)
object | an object inheriting from a fitted model or a class, which has the log-likelihood value to be extracted. |
... | other arguments to pass in or from other functions. |
REML |
a logical flag. Optional.
If TRUE, the restricted log-likelihood is returned.
If FALSE (the default), the log-likelihood is returned.
logLik.nls cannot compute the restricted log-likelihood and gives an error if you ask for it. |
k | a numeric value. Used as the coefficient for the number of parameters in the fitted model. |
digits | the maximum number of (significant) digits. The default is the value of the system option "digits". |
vec.len |
the non-negative integer number of values in object. (Optionally, it can be coercible to
a non-negative integer.)
The default value is the "vec.len" component of the option "str". |
logLik.logLik | returns object. |
m1 <- lm(ozone ~ radiation + temperature, data = Sdatasets::air) logLik(m1) ## 'log Lik.' -91.68577 (df=4) logLik(m1, REML = TRUE) ## 'log Lik.' -104.4643 (df=4)