lrtest {DGLMExtPois} | R Documentation |
Likelihood Ratio Test for Nested glm_CMP and glm_hP Fits
Description
Performs the likelihood ratio chi-squared test to compare nested models.
Usage
lrtest(object1, object2)
Arguments
object1 , object2 |
fitted objects of classes inheriting from
|
Details
The test statistics is calculated as 2(llik- llik_0)
.
The test statistics has a chi-squared distribution with r degrees of freedom,
where r is the difference in the number of parameters between the full and
null models.
Value
A list with class "lrtest"
containing the following components:
statistics |
the value of the statistic. |
df |
the degrees of freedom. |
p-value |
the p-value for the test. |
Examples
Bids$size.sq <- Bids$size ^ 2
## Fit null model
fit0 <- glm.hP(formula.mu = numbids ~ leglrest + rearest + finrest +
whtknght + bidprem + insthold + size + size.sq + regulatn,
formula.gamma = numbids ~ 1, data = Bids)
## Fit full model
fit <- glm.hP(formula.mu = numbids ~ leglrest + rearest + finrest +
whtknght + bidprem + insthold + size + size.sq + regulatn,
formula.gamma = numbids ~ leglrest, data = Bids)
## Likelihood ratio test for the nested models
lrtest(fit,fit0)
[Package DGLMExtPois version 0.2.3 Index]