likeratio {MQMF}R Documentation

likeratio conducts a likelihood ratio test

Description

likeratio conducts a likelihood ratio test on two negative log-likelihoods. It produces the LR plus related statistics detailing if a significant difference has been found. The order in which the log-likelihoods are entered does not matter as that is checked for so a positive likelihood ratio is always generated.

Usage

likeratio(nLL1, nLL2, df = 1)

Arguments

nLL1

the first -ve log-likelihood

nLL2

the second -ve log-likelihood

df

the number of degrees of freedom difference between the two model, a minimum of 1, which is the default.

Value

a vector of the likelihood ratio, the significance of any difference, the minimum difference required for significance, and the degrees of freedom.

Examples

  one <- 291.1691
  two <- 277.0122
  dof <- 1
  round(likeratio(one,two,dof),8)  # LR = 28.3138

[Package MQMF version 0.1.5 Index]