Skip to contents

Ordinal outcomes have no canonical residual; two are offered. "response" is the observed category index minus its expected index under the fitted probabilities (on the 0, 1, ..., J-1 scale). "pearson" divides that by the fitted standard deviation of the index. For model checking prefer the simulation route: simulate() feeds DHARMa::createDHARMa(); see simulate.iord().

Usage

# S3 method for class 'iord'
residuals(object, type = c("response", "pearson"), ...)

Arguments

object

An "iord" object.

type

"response" or "pearson".

...

Unused.

Value

A numeric vector.

See also

simulate.iord() for simulated-residual diagnostics with DHARMa; fitted() for the fitted category probabilities.

Other simulation and diagnostics: iord-distribution, riop(), simulate.iord()

Examples

data(bp)
m <- oprobit(violence ~ loggdppc + parliament + disaster, data = bp)
r <- residuals(m, type = "pearson")
summary(r)
#>      Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
#> -4.610060 -0.650468 -0.468911 -0.005958  0.582826  5.264554 
## the simulation route, preferred for model checking
s <- simulate(m, nsim = 5)
dim(s)
#> [1] 1984    5