R Observatory
Search

Surrogate Residuals for Ordinal and General Regression Models

install.packages("sure")
CRAN checks, method
OKnotes on 1 of 13
CRAN 30-day downloads, method
560+2.6% up on the 30 days before, the better direction
Test coverage, method
69%of lines run by tests

An implementation of the surrogate approach to residuals and diagnostics for ordinal and general regression models; for details, see Liu and Zhang (2018) <doi:10.1080/01621459.2017.1292915> and Greenwell et al. (2018) <doi:10.32614/RJ-2018-004>.

Full description

An implementation of the surrogate approach to residuals and diagnostics for ordinal and general regression models; for details, see Liu and Zhang (2018) <doi:10.1080/01621459.2017.1292915> and Greenwell et al. (2018) <doi:10.32614/RJ-2018-004>. These residuals can be used to construct standard residual plots for model diagnostics (e.g., residual-vs-fitted value plots, residual-vs-covariate plots, Q-Q plots, etc.). The package also provides 'plot' methods for producing standard diagnostic plots using lightweight base R graphics (via 'tinyplot'). The package currently supports cumulative link models from packages 'MASS', 'ordinal', 'rms', and 'VGAM', binary and other generalized linear models fit with 'glm', and multinomial models or general classifiers via a matrix of predicted class probabilities.

Maintainer
Brandon Greenwell
Licence
GPL (>= 2)
Latest release
24 Oct 2026
First release
21 Aug 2017

Compare with another package

More details
Releases
3
Needs compilation
No
Needs R
>= 4.0.0
RoxygenNote
7.3.3
Subjects (2) Method, Subjects
Cite

Package

Run in R for the authors' entry:

citation("sure")

The package provides a citation file, so citation() returns the authors' own entry.

It points to 10.32614/rj-2018-004.

R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA
Balamuta, J. J. (2026). R Observatory: Metrics for sure version 0.3.1 [Data set]. HJJB, LLC. Data release v2026-10-29. https://doi.org/10.5281/zenodo.21843040
About

From data release v2026-10-29, which the citation names so these numbers can be found later.

No warnings or errors. 1 of 13 check platforms have notes.

  • r-release-linux-x86_64

    The current release of R on Linux, x86_64

    Note

    Version checked
    0.2.0
    Time taken
    60 s

    Rd files: Note

    checkRd: (-1) getFittedProbs.Rd:6-8: Lost braces

    Full output

  • r-devel-linux-x86_64-debian-clang

    The unreleased R on Linux, x86_64, debian-clang

    OK

    Version checked
    0.3.1
    Time taken
    52 s
  • r-devel-linux-x86_64-debian-gcc

    The unreleased R on Linux, x86_64, debian-gcc

    OK

    Version checked
    0.3.1
    Time taken
    40 s
  • r-devel-linux-x86_64-fedora-clang

    The unreleased R on Linux, x86_64, fedora-clang

    OK

    Version checked
    0.3.1
    Time taken
    33 s
  • r-devel-linux-x86_64-fedora-gcc

    The unreleased R on Linux, x86_64, fedora-gcc

    OK

    Version checked
    0.3.1
    Time taken
    39 s
  • r-devel-windows-x86_64

    The unreleased R on Windows, x86_64

    OK

    Version checked
    0.3.1
    Time taken
    156 s
  • r-oldrel-macos-arm64

    The previous release of R on macOS, arm64

    OK

    Version checked
    0.3.1
    Time taken
    43 s
  • r-oldrel-macos-x86_64

    The previous release of R on macOS, x86_64

    OK

    Version checked
    0.3.1
    Time taken
    115 s
  • r-oldrel-windows-x86_64

    The previous release of R on Windows, x86_64

    OK

    Version checked
    0.3.1
    Time taken
    84 s
  • r-patched-linux-x86_64

    The patched release of R on Linux, x86_64

    OK

    Version checked
    0.3.1
    Time taken
    46 s
  • r-release-macos-arm64

    The current release of R on macOS, arm64

    OK

    Version checked
    0.3.1
    Time taken
    28 s
  • r-release-macos-x86_64

    The current release of R on macOS, x86_64

    OK

    Version checked
    0.3.1
    Time taken
    109 s
  • r-release-windows-x86_64

    The current release of R on Windows, x86_64

    OK

    Version checked
    0.3.1
    Time taken
    83 s
  • 1 Note
  • 12 OK
Check output (1)

Rd files, Note on 1 platform

checkRd: (-1) getFittedProbs.Rd:6-8: Lost braces
     6 | getFittedValues <- function(object) {
       |                                     ^
checkRd: (-1) getFittedProbs.Rd:14-16: Lost braces
    14 | getFittedValues <- function(object) {
       |                                     ^

Check results on CRAN

Total downloads in the last 30 days
587+4.1% up on the 30 days before, the better directionIt is the sum of 3 channels: CRAN, r2u and autoCRAN.

CRAN rank

5,499 of 26,553

CRAN

560 downloads in the last 30 days

Rank
5,499 of 26,553
Change
+2.6% up on the 30 days before, the better direction

It is in the total. Take it out

r2u

19 downloads in the last 30 days

Rank
4,881 of 30,526
Change
+375% up on the 30 days before, the better direction

It is in the total. Take it out

autoCRAN

8 downloads in the last 30 days

Rank
6,093 of 29,233
Change
−42.9% down on the 30 days before, the worse direction

It is in the total. Take it out

Over time

Compare downloads

Needs
1
Dependent packages
1
Suggested by
0
Needs (1)
  • stats
Installing it adds
0 packages, 0 KB of source
Of those, need compilation
0
Optional extras (10)
Dependent packages (1)
PackageTitleDownloads in 30 days
weightedCLEfficient and Feasible Inference for High-Dimensional Normal Copula Regression Models326
Functions
69
Public exports
5
Lines of R code
1,514
Median complexity
1
Functions (69)
Size and composition

Lines by kind (2,746)

KindLinesShare
R code1,51455%
Tests120.4%
Documentation55720%
Guides66324%

Lines by language

LanguageLinesShare
R1,52656%
Rd55720%
Vignettes51519%
Other1485%

Languages are counted from file extensions.

Files
47
R functions
69
Object systems
S3: 47 methods
Complexity
Median
1
Mean
2.64
Highest
41
Median lines per function
4
About complexity

Cyclomatic complexity counts the independent paths through a function: 1 is a straight line, higher is harder to test. R functions only.

Call graph figures
R functions
69
Calls
37
Unconnected
32
Groups
5
Growth (3 releases)
Total lines by release
2,693 on 20 Aug 20172,746 on 24 Oct 2026
Release changes

The tests ran and coverage was measured.

Lines run by tests
68.8%
Expressions run by tests
67.4%
Test cases
190
Exports named in tests
0%
Coverage by file (16)
Coverage run
Lines counted
509
Lines the tests ran
350
Tests passed
Yes
Measured with
covr 3.6.5 on R 4.6.1
Test suite
Has tests
Yes
Test frameworks
tinytest
Test cases
190
Lines of tests
12
Test lines per line of code
0.01
Exports documented
100%
Arguments documented
100%
Return value documented
100%
Help pages with examples
71.4%
Examples run in checks
100%
Guides (1)
Other documentation
README
Yes, 183 words
Release notes file
Yes
Help pages
7
Lines of documentation
557
Earlier names (2)
  • Brad Boehmke
  • Dungang Liu

bgreenwell / sure on github.com

Stars
8
Forks
4
Open issues
0
Last commit
27 Oct 2026
Activity
Commits
–
Open pull requests
0
Tagged releases
2
Latest tagged release
v0.3.1, 27 Oct 2026
Issues closed in
–
Pull requests closed in
–
Pull requests merged
75%
Created
2 Jul 2017
Licence file reads as
–

The weekly scan of development practices has not read this repository.

Earlier repositories (1)

Tools

ToolFirst seenFound
Claude Code29 Jun 2026Seen in the repositoryCLAUDE.mdNamed in .RbuildignoreCLAUDE.md
  • Seen in the repository
  • Named in .Rbuildignore

Shared conventions

AGENTS.md

Across bgreenwell

R releases
  • On CRAN
  • Facing archival
  • Release
VersionReleasedREvents
0.3.1 current24 Oct 20264.6.1Fix due 2 Nov 2026
The checks were fixed and the deadline was lifted.
0.2.019 Sep 20173.4.1
0.1.221 Aug 20173.4.1
Release notes (0.3.1)

Changed

  • plot.resid() now picks its default Q-Q reference distribution from fit when supplied (distribution defaults to NULL).

Removed

  • Removed the plot() method for glm objects, which replaced the standard stats::plot.lm() diagnostics once sure was loaded; use plot(resids(fit), fit = fit) instead.

Fixed

  • Fixed surrogate residuals for binary glm fits with a cloglog link, which used the wrong Gumbel orientation for the latent distribution (#45).
  • Fixed the Q-Q x-axis label reading NULL when calling plot() on a fitted model without a covariate.
  • Fixed citation metadata (author names, DOIs) in CITATION, DESCRIPTION, and references.