Measures discrepancies between observed categories and the fitted category distribution without assigning numerical distances to category labels.
# S3 method for fastglm_ordinal
residuals(object, type = c("probability", "cumulative", "pearson"), ...)A named vector for probability-scale residuals or a matrix for cumulative or Pearson residuals.
a fitted fastglm_ordinal model.
"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.
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. tools:::Rd_expr_doi("10.1093/biomet/asr073").