Learn R Programming

ordinal (version 2010.03-04)

anova.clm: Likelihood ratio test of cumulative link models

Description

Comparison of cumulative link models in likelihood ratio tests. The models may differ by terms in location as well as in scale.

Usage

## S3 method for class 'clm':
anova(object, ..., test = c("Chisq", "none"))

Arguments

object
a clm object.
...
one or more additional clm objects.
test
if test = "none" the p-value for the likelihood ratio test is suppressed.

Value

  • The method returns an object of class Anova (for printing) and data.frame with the following elements
  • Modelcharacter description of the cumulative link models being compared. Location and scale models are separated by a "|".
  • Resid.dfthe residual degrees of freedom
  • -2logLiktwice the negative log likelihood (proportional to the deviance)
  • Testindication of which models are being compared.
  • DFthe difference in the degrees of freedom in the models being compared, i.e. the degrees of freedom for the chi-squared test.
  • LR stat.the likelihood ratio statistic.
  • Pr(Chi)the p-value from the likelihood ratio test. Absent if test = "none".

See Also

clm, addterm, dropterm and anova.default

Examples

Run this code
options(contrasts = c("contr.treatment", "contr.poly"))
data(soup)
m1 <- clm(SURENESS ~ PROD, scale = ~PROD, data = soup,
          link = "logistic")

## anova
anova(m1, update(m1, scale = ~.-PROD))
mN1 <- clm(SURENESS ~ 1, nominal = ~PROD, data = soup,
           link = "logistic")
anova(m1, mN1)
anova(m1, update(m1, scale = ~.-PROD), mN1)

## Fit model from polr example:
data(housing, package = "MASS")
fm1 <- clm(Sat ~ Infl + Type + Cont, weights = Freq, data = housing)
anova(fm1, update(fm1, scale =~ Cont))

Run the code above in your browser using DataLab