Skip to content

crs

0.15-46Package record

Categorical Regression Splines

4packages dependsuggested by 2
77.8Kdownloads / year
–test coverage
13/13flavors OK

Overview

About

Regression splines that handle a mix of continuous and categorical (discrete) data often encountered in applied settings. I would like to gratefully acknowledge support from the Natural Sciences and Engineering Research Council of Canada (NSERC, https://www.nserc-crsng.gc.ca), the Social Sciences and Humanities Research Council of Canada (SSHRC, https://www.sshrc-crsh.gc.ca), and the Shared Hierarchical Academic Research Computing Network (SHARCNET, https://www.sharcnet.ca). We would also like to acknowledge the contributions of the GNU GSL authors. In particular, we adapt the GNU GSL B-spline routine gsl_bspline.c adding automated support for quantile knots (in addition to uniform knots), providing missing functionality for derivatives, and for extending the splines beyond their endpoints.

Changes in 0.15-46
  • Retired the duplicated demo/spline.R implementation and its release-time copy step. The constrained mean, first-derivative, second-derivative, and bootstrap-test demos already use the exported crshat() operator backed by the canonical package implementation, so fitted and constraint arithmetic are unchanged while the package no longer ships a second copy of its spline engine.
  • Added the opt-in observed native NOMAD solve interface used by downstream packages for throttled progress heartbeats during long objective evaluations. The versioned C API reports evaluation and cooperative-activity events out of band, preserves the numerical solve and cache/accounting contracts, disables only observation after ordinary observer errors, and converts explicit user interruption into an orderly native stop. The original native solve entry point remains source- and binary-compatible.
Show all changes in 0.15-46Hide the rest of the changes in 0.15-46
  • Hardened the public clsd() scalar-condition contract for elastic.max and NOMAD. Ambiguous vectors, empty values, missing values, and values which cannot be interpreted by the historical scalar operator semantics now fail early with argument-specific errors; valid logical and numeric scalar controls retain their existing search routes and fitted results.
  • Modernized crsiv() and crsivderiv() with training-grid formula/data interfaces (y ~ z | w and y ~ z | w | x), one authoritative row map for subset/NA/weights/starting values, collision-safe internal role names, and namespaced IV metadata. Added selected-state fitted(), residuals(), and predict() semantics, structured summaries, corrected original-response plot overlays, and self-contained formula-based examples. Native evaluation interfaces and established CRS post-fit projection remain available; formula-time evaluation and formula-object newdata are deliberately deferred and fail clearly.
  • Corrected fitted-value centering throughout crsivderiv() so both empirical terms of the Equation (14) adjoint use the same fitted conditional-residual vector. The initial adjoint had centered its second term on the raw residual, while the constructed-residual route also averaged the wrong constructed quantity in both initial and recursive states. This can materially change derivative trajectories, stopping states, and fitted curves, and removes catastrophic finite-sample losses observed under the malformed constructed-residual adjoint.
  • Made crsivderiv() Landweber-Fridman states coherent with the estimator definition: iteration N now stores the matched derivative, integrated curve, and stopping criterion after exactly N updates. Explicit starting.values are the state used immediately before update 1, without a hidden preliminary update. Returned phi and phi.prime, the reported iteration, and the summary stopping value now all refer to the selected state. This corrects the previous one-column mismatch between the curve and derivative histories; results can change when that mismatch affected state selection or extraction.
  • Corrected the private Gaussian integral operator used by crsivderiv() so the empirical adjoint applies the ordinary kernel CDF required by Equation (14) of Florens, Centorrino, and Racine. The helper had multiplied the CDF average by the continuous bandwidth, producing the same malformed scaling implicated in np issue #57. Other spline fitting, bandwidth, stopping, optimizer, and public helper behavior is unchanged.
  • Hardened the observed native NOMAD interface so explicit user interruption has a dedicated status after orderly native cleanup, ordinary observer errors remain fail-open, and a failed callback cannot expose unwritten black-box output memory. Existing native ABI values, layouts, callable names, and successful-run numerical/accounting behavior are unchanged.
  • Hardened native NOMAD interruption by limiting the operating-system signal handler to signal-safe state capture, consuming interruption from ordinary solver control flow, and restoring the prior process handler before return. Interrupt status now takes precedence when a solve is interrupted after an earlier callback failure, and R-callback failures retain their first trapped diagnostic in the bounded result message.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 25.0 min · r-oldrel-windows-x86_64
Status changes
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK13 OK2026-05-17
  • WARNING12 OK, 1 WARNING2026-05-13
  • OK12 OK2026-04-25
Show 1 earlier changeHide 1 earlier change
  • NOTE12 OK, 2 NOTE2026-03-10
Advisories

none known

Documentation

In release 0.15-46
READMEYes · 207 wordsVignettesYes · 1 · dynamicNEWSYes · 100% structured · mentions 0.15-46Citation fileNoWebsitenot declared in DESCRIPTION
Help pages
21includes a package overview page
Examples that run
63%12 run in a plain check · 7 never run
Exported functions with examples
100%
Documented parameters
82%
Return-value docs
100%
Help pages citing references
81%

Also includes 14 demo scripts (run with demo())

Downloads

77.8K
CRAN downloads in the past year
Rank #1,263 · ~213/day · ~6.5K/mo
Daily download trend is not available in this view yet.
8.6K30 days
24.1K90 days
77.8K1 year
Compare downloads with other packages →
Also on1.2K r2u12 autocran3.2K conda_forge171 c2d4u

Repository

17Stars
5Forks
1Open issues
0Open PRs
0Releases
1,436Commits
5Commit identities
1,436 commits · Last activity 2026-08-09
Responsiveness
How these are sampled
PRs merged (all time)
40%
Median days to close, 50 most recently updated closed issues
1
Median days to close, 50 most recently updated closed PRs
1

Stars over time

2022-09-21 · 162026-07-07 · 17
PracticesBeta

Checks run against github.com/jeffreyracine/r-package-crs on 2026-10-18.

No development-tooling practices detected in the upstream repository.

How this is detected·Detection ruleset v3 (2026-09-26)

Dependencies

Declared dependencies
8 external dependencies (excludes base and recommended)

Installing crs adds 3 packages (2 with compiled code, 1.4 MB of source tarballs). Heaviest: quantreg 903 KB, SparseM 540 KB, MatrixModels 24 KB.

Depends (0)
none
Imports (3)
bootstatsquantreg
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
4direct
47indirect
Imports 4 · LinkingTo 2
Suggested by 2
Depends, Imports or LinkingTo, most downloaded first
Suggests, most downloaded first

Datasets

People & History

People (3)
Author, Maintainer since 0.14-7 (2011)
Contributor · added in 0.15-20
stepCV.R
Releases (45)

Pick two releases to compare their code metrics.

Show 46 earlier eventsHide 46 earlier events

Package metadata

First published
2011-06-09
Total releases
45 / 15 yrs
License
GPL (>= 3) OSI
Bundled data
70 KB / 3 files
Download size
1.5 MB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("crs")
Racine, J. S., Nie, Z., & Ripley, B. D. (2026). crs: Categorical Regression Splines (Version 0.15-46) [Computer software]. https://doi.org/10.32614/CRAN.package.crs

This package has no citation file, so citation() returns this entry built from DESCRIPTION.

Cite the 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 crs version 0.15-46 [Data set]. HJJB, LLC. Data release v2026-10-21. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-21, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy