R/ordinal-methods.R
residuals.fastglm_ordinal.RdMeasures discrepancies between observed categories and the fitted category distribution without assigning numerical distances to category labels.
A named vector for probability-scale residuals or a matrix for cumulative or Pearson residuals.
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.
Li, C. and Shepherd, B. E. (2012). A new residual for ordinal outcomes. Biometrika, 99, 473–480. doi:10.1093/biomet/asr073 .