relLik: Relative log-likehood.

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/relLik.R

Description

Calculate the relative log-likehood between two models.

Usage

1
relLik(x, y, method = c("AIC", "BIC"), ndigits = 6, ...)

Arguments

x,y

Fitted model objects for which there exists a logLik method to extract the corresponding log-likelihood, or objects inheriting from class logLik.

method

Whether to base the comparison on AIC or BIC. Defaults to "AIC".

ndigits

An integer denoting the number of decimal digits in the output.

...

Further arguments to pass to AIC or BIC.

Details

The relative log-likelihood is calculated as exp((abs(AIC(x) - AIC(y)))/2) or exp((abs(BIC(x) - BIC(y)))/2), depending on the method.

You can find information regarding differences between AIC and BIC from http://methodology.psu.edu/eresources/ask/sp07.

Value

A vector with values:

AIC(x), BIC(x)

The AIC or ]codeBIC value of the first model object.

AIC(y), BIC(y)

The AIC or ]codeBIC value of the second model object.

relLik

The relative likelihood between the two models. Model y will be that much more likely given the data than model x.

Author(s)

Antoine Tremblay, Statistics Canada, trea26@gmail.com

References

On AIC and relative log-likelihood (which they call evidence ratio):

Symonds, M.R.E and Moussalli, A. (2011). A brief guide to model selection, multimodel inference and model averaging in behavioural ecology using Akaike's information criterion. Behavioral Ecology and Sociobiology, 65, 13–21. doi: 10.1007/s00265-010-1037-6

See Also

logLik; AIC; BIC

Examples

1
# see example in LMERConvenienceFunctions help page.

Example output

Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl_init' failed, running with rgl.useNULL = TRUE 
3: .onUnload failed in unloadNamespace() for 'rgl', details:
  call: fun(...)
  error: object 'rgl_quit' not found 

LMERConvenienceFunctions documentation built on Oct. 23, 2020, 5:12 p.m.