Learn R Programming

ordinal (version 2023.12-4.1)

nominal_test: Likelihood ratio tests of model terms in scale and nominal formulae

Description

Add all model terms to scale and nominal formulae and perform likelihood ratio tests. These tests can be viewed as goodness-of-fit tests. With the logit link, nominal_test provides likelihood ratio tests of the proportional odds assumption. The scale_test tests can be given a similar interpretation.

Usage

nominal_test(object, ...)

# S3 method for clm nominal_test(object, scope, trace=FALSE, ...)

scale_test(object, ...)

# S3 method for clm scale_test(object, scope, trace=FALSE, ...)

Value

A table of class "anova" containing columns for the change in degrees of freedom, AIC, the likelihood ratio statistic and a p-value based on the asymptotic chi-square distribtion of the likelihood ratio statistic under the null hypothesis.

Arguments

object

for the clm method an object of class "clm", i.e., the result of a call to clm.

scope

a formula or character vector specifying the terms to add to scale or nominal. In nominal_test terms in scope already in nominal are ignored. In scale_test terms in scope already in scale are ignored.

In nominal_test the default is to add all terms from formula (location part) and scale that are not also in nominal.

In scale_test the default is to add all terms from formula (location part) that are not also in scale.

trace

if TRUE additional information may be given on the fits as they are tried.

...

arguments passed to or from other methods.

Author

Rune Haubo B Christensen

Details

The definition of AIC is only up to an additive constant because the likelihood function is only defined up to an additive constant.

Examples

Run this code

## Fit cumulative link model:
fm <- clm(rating ~ temp + contact, data=wine)
summary(fm)
## test partial proportional odds assumption for temp and contact:
nominal_test(fm)
## no evidence of non-proportional odds.
## test if there are signs of scale effects:
scale_test(fm)
## no evidence of scale effects.

## tests of scale and nominal effects for the housing data from MASS:
if(require(MASS)) {
    fm1 <- clm(Sat ~ Infl + Type + Cont, weights = Freq, data = housing)
    scale_test(fm1)
    nominal_test(fm1)
    ## Evidence of multiplicative/scale effect of 'Cont'. This is a breach
    ## of the proportional odds assumption.
}

Run the code above in your browser using DataLab