Learn R Programming

qpcR (version 1.1-8)

LR: Calculation of likelihood ratios for nested models

Description

Calculates the likelihood ratio and p-value from a chi-square distribution for two nested models.

Usage

LR(objX, objY)

Arguments

objX
Either a value of class logLik or a model for which logLik can be applied.
objY
Either a value of class logLik or a model for which logLik can be applied.

Value

  • A list containing the following items:
  • ratiothe likelihood ratio statistic.
  • dfthe change in parameters.
  • p.valuethe p-value from a chi-square distribution. See Details.

encoding

latin1

Details

The likelihood ratio statistic is $$LR = \frac{f(X, \hat{\phi}, \hat{\psi})}{f(X, \phi, \hat{\psi_0})}$$ The usual test statistic is $$\Lambda = 2*(l(\hat{\phi}, \hat{\psi}) - l(\phi, \hat{\psi_0}))$$ Following the large sample theory, if $H_0$ is true, then $$\Lambda \sim \chi_p^2$$

See Also

AIC, logLik.

Examples

Run this code
### compare l5 and l4 model
m1 <- pcrfit(reps, 1, 2, l5())
m2 <- pcrfit(reps, 1, 2, l4())
LR(m1, m2)

Run the code above in your browser using DataLab