llratio: Calculation of likelihood ratios for nested models

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

Description

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

Usage

1
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

AIC, logLik.

Examples

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

qpcR documentation built on May 2, 2019, 5:17 a.m.

Related to llratio in qpcR...