Measures discrepancies between observed categories and the fitted category distribution without assigning numerical distances to category labels.

# S3 method for class 'fastglm_ordinal'
residuals(object, type = c("probability", "cumulative", "pearson"), ...)

Arguments

object

a fitted fastglm_ordinal model.

type

"probability" gives probability-scale residuals; "cumulative" gives observed minus fitted cumulative proportions; "pearson" standardizes cumulative count differences using their marginal binomial variances.

...

further arguments; currently unused.

Value

A named vector for probability-scale residuals or a matrix for cumulative or Pearson residuals.

Details

For an individual outcome \(y\), the probability-scale residual is \(F(y-)+F(y)-1\), where \(F\) is the fitted cumulative distribution. Positive values indicate outcomes above the fitted distribution. For a count response, this method returns the mean of the individual residuals within each row. Probability-scale residuals lie in \([-1,1]\); for ordinal data they generally have neither a normal nor a uniform distribution.

Cumulative residuals have one column per threshold. For row frequency \(m\), the Pearson version divides cumulative observed count minus \(m F(j)\) by \(\sqrt{m F(j)(1-F(j))}\). These columns are dependent and are descriptive diagnostics, not independent goodness-of-fit tests. Zero-frequency rows have missing residuals. Rows omitted under na.exclude are restored with missing values.

References

Li, C. and Shepherd, B. E. (2012). A new residual for ordinal outcomes. Biometrika, 99, 473–480. doi:10.1093/biomet/asr073 .