Reputation: 173
Basically I'm trying to find a way to extract the number value of log-likelihood value from logLik object.
E.g., the output: 'log Lik.' -72.0789 (df=2)
Is it possible to 'extract' only the -72.0789 number so it could be assigned elsewhere?
Upvotes: 5
Views: 1767
Reputation: 60000
Just use [
to extract the value. e.g.:
logLik(mod)[1]
# [1] -10.44608
Or head
:
head( logLik(mod) )
# [1] -10.44608
Upvotes: 4