Learn R Programming

grouped (version 0.6-0)

anova.grouped: Anova method for grouped objects

Description

Performs a Likelihood Ratio Test between two nested grouped models.

Usage

## S3 method for class 'grouped':
anova(object, object2, ...)

Arguments

object
an object inheriting from class grouped, nested to object2.
object2
an object inheriting from class grouped.
...
additional arguments; currently none is used.

Value

  • a list of class aov.grouped with the following components:
  • name0the name of the null model represented by object.
  • L0the log-likelihood under object.
  • df0the number of parameters in object.
  • AIC0the AIC under object.
  • BIC0the BIC under object.
  • name1the name of the alternative model represented by object2.
  • L1the log-likelihood under object2.
  • df1the number of parameters in object2.
  • AIC1the AIC under object2.
  • BIC1the BIC under object2.
  • L01the value of the likelihood ratio test statistic.
  • p.valuethe $p$-value of the test.

Warning

The function does only partial checking whether the two models are nested; the user is responsible to supply nested models in order to perform a valid test.

See Also

grouped, summary.grouped

Examples

Run this code
m1 <- grouped(cbind(lo, up) ~ treat, link = "logit", data = Sdata)
m2 <- grouped(cbind(lo, up) ~ treat * x, link = "logit", data = Sdata)
anova(m1, m2)

m1 <- grouped(equispaced(r, n) ~ x1, link = "logit", data = Seeds)
m2 <- grouped(equispaced(r, n) ~ x1 * x2, link = "logit", data = Seeds)
anova(m1, m2)

Run the code above in your browser using DataLab