Learn R Programming

eba (version 1.10-0)

residuals.eba: Residuals for EBA Models

Description

Computes deviance and Pearson residuals for eba objects.

Usage

# S3 method for eba
residuals(object, type = c("deviance", "pearson"), …)

Arguments

object

an object of class eba, typically the result of a call to eba

type

the type of residuals which should be returned; the alternatives are: "deviance" (default) and "pearson"

further arguments passed to or from other methods; none are used in this method.

Value

A vector of residuals having as many elements as pairs of stimuli.

Details

Residuals are computed from the upper triangle of the paired-comparison matrix. See residuals.glm for details.

See Also

eba, residuals.glm, plot.eba.

Examples

Run this code
# NOT RUN {
data(celebrities)                # absolute choice frequencies
btl1 <- eba(celebrities)         # fit Bradley-Terry-Luce model
sum( resid(btl1)^2 )             # deviance G2
deviance(btl1)
sum( resid(btl1, "pearson")^2 )  # Pearson X2
# }

Run the code above in your browser using DataLab