Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

llratio

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

llratio(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.

Details

The likelihood ratio statistic is

LR = \frac{f(X, \hat{φ}, \hat{ψ})}{f(X, φ, \hat{ψ_0})}

The usual test statistic is

Λ = 2 \cdot (l(\hat{φ}, \hat{ψ}) - l(φ, \hat{ψ_0}))

Following the large sample theory, if H_0 is true, then

Λ \sim χ_p^2

Value

A list containing the following items:

ratio

the likelihood ratio statistic.

df

the change in parameters.

p.value

the p-value from a χ^2 distribution. See Details.

Author(s)

Andrej-Nikolai Spiess

See Also

Examples

## Compare l5 and l4 model.
m1 <- pcrfit(reps, 1, 2, l5)
m2 <- pcrfit(reps, 1, 2, l4)
llratio(m1, m2)

qpcR

Modelling and Analysis of Real-Time PCR Data

v1.4-1
GPL (>= 2)
Authors
Andrej-Nikolai Spiess <a.spiess@uke.uni-hamburg.de>
Initial release
2018-05-29

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.