lr.test: Likelihood ratio test for generalized linear models

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

View source: R/addtests.r

Description

Computes the likelihood ratio test for the coefficients of a generalized linear model.

Usage

1
lr.test(fit1, fit2)

Arguments

fit1

an object that stores the results of glm fit of the model under the null hypothesis.

fit2

an object that stores the results of glm fit of the model under the alternative hypothesis.

Details

The objects fit1 and fit2 are obtained using the usual options passed to the glm function.

Value

The function lrt.test() returns the following list of values:

LR

the value of the likelihood ratio statistic.

pvalue

the p value of test under null hypothesis chi-square distribution.

Note

Both fit1 and fit2 must have the same family and link function.

Author(s)

Damiao N. da Silva damiao@ccet.ufrn.br

Antonio Hermes M. da Silva-Junior hermes@ccet.ufrn.br

References

McCullagh P, Nelder J (1989). Generalized Linear Models. Chapman & Hall/CRC, London.

Da Silva DN, Cordeiro GM (2009). "A Computer Program to Improve LR Tests for Generalized Linear Models." Communications in Statistics – Simulation and Computation, 38(10), 2184–2197.

See Also

mdscore

wald.test

Examples

1
2
3
4
data(strength)
fitf <- glm(y ~ cut * lot, data = strength,family = inverse.gaussian("inverse"))
fit0 <- glm(y ~ cut + lot, data = strength, family = inverse.gaussian("inverse"))
lr.test(fit0,fitf)

Example output

Loading required package: MASS
$LR
[1] 8.957195

$pvalue
[1] 0.06217836

attr(,"class")
[1] "lrt.test"

mdscore documentation built on May 2, 2019, 1:26 p.m.

Related to lr.test in mdscore...