lrtest | R Documentation |
Performs the likelihood ratio chi-squared test to compare nested models.
lrtest(object1, object2)
object1, object2 |
fitted objects of classes inheriting from
|
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.
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. |
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.