Skip to content

CLRtools

0.1.2Package record

Diagnostic Tools for Logistic and Conditional Logistic Regression

0packages depend
3.9Kdownloads / year
–test coverage
9/13flavors OK

Overview

About

Provides tools for fitting, assessing, and comparing logistic and conditional logistic regression models. Includes residual diagnostics and goodness of fit measures for model development and evaluation in matched case control studies.

Changes in 0.1.2
  • Update deprecated stan syntax in vignette Bayesian\_Logistic\_Regression.
  • Fixed discordant.pairs() to correctly handle strata extracted from tibble inputs.

From NEWS.md in the release

Install

Health

CRAN checks
4ERROR9OK
Check messages
ERRORre-building of vignette outputsr-devel-linux-x86_64-debian-gcc, r-devel-windows-x86_64, r-oldrel-windows-x86_64, r-release-windows-x86_64

r-devel-linux-x86_64-debian-gcc

Error(s) in re-building vignettes:
  ...
--- re-building ‘Bayesian_Logistic_regression.Rmd’ using rmarkdown
[WARNING] Deprecated: --mathjax. Use --math-method=mathjax[:URL] instead.
--- finished re-building ‘Bayesian_Logistic_regression.Rmd’

--- re-building ‘Conditional_Logistic_Regression.Rmd’ using rmarkdown

Quitting from Conditional_Logistic_Regression.Rmd:131-142 [unnamed-chunk-9]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error in `a$specials[[i]]`:
! subscript out of bounds
---
Backtrace:
    ▆
 1. ├─utils::head(...)
 2. └─CLRtools::residuals_clog(...)
 3.   ├─stats::model.matrix(model)
 4.   └─survival:::model.matrix.coxph(model)
 5.     └─stats::delete.response(object$terms)
 6.       └─stats (local) off(a$specials[[i]])
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: processing vignette 'Conditional_Logistic_Regression.Rmd' failed with diagnostics:
subscript out of bounds
--- failed re-building ‘Conditional_Logistic_Regression.Rmd’

--- re-building ‘Logistic_Regression.Rmd’ using rmarkdown
[WARNING] Deprecated: --mathjax. Use --math-method=mathjax[:URL] instead.
--- finished re-building ‘Logistic_Regression.Rmd’

SUMMARY: processing the following file failed:
  ‘Conditional_Logistic_Regression.Rmd’

Error: Vignette re-building failed.
Execution halted

r-devel-windows-x86_64

Error(s) in re-building vignettes:
--- re-building 'Bayesian_Logistic_regression.Rmd' using rmarkdown
specified C++17
make cmd is
  make -f "D:/RCompile/recent/R/etc/x64/Makeconf" -f "D:/RCompile/recent/R/share/make/winshlib.mk" CXX='$(CXX17) $(CXX17STD)' CXXFLAGS='$(CXX17FLAGS)' CXXPICFLAGS='$(CXX17PICFLAGS)' SHLIB_LDFLAGS='$(SHLIB_CXX17LDFLAGS)' SHLIB_LD='$(SHLIB_CXX17LD)' SHLIB="file52f0878892a5a.dll" WIN=64 TCLBIN= OBJECTS="file52f0878892a5a.o"

make would use
if test "zfile52f0878892a5a.o" != "z"; then \
  if test -e "file52f0878892a5a-win.def"; then \
    echo g++   -shared  -s -static-libgcc -o file52f0878892a5a.dll file52f0878892a5a-win.def file52f0878892a5a.o  "D:/RCompile/CRANpkg/lib/4.7/rstan/lib/x64/libStanServices.a" -L"D:/RCompile/CRANpkg/lib/4.7/StanHeaders/libs/x64" -lStanHeaders -L"D:/RCompile/CRANpkg/lib/4.7/RcppParallel/lib/x64" -ltbb -LD:/RCompile/CRANpkg/lib/4.7/RcppParallel/libs/x64 -lRcppParallel -LD:/RCompile/CRANpkg/lib/4.7/RcppParallel/lib/x64 -ltbb -ltbbmallo
...[truncated]...
fi

Quitting from Bayesian_Logistic_regression.Rmd:268-348 [unnamed-chunk-7]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error in `sink()`:
! invalid connection
---
Backtrace:
    ▆
 1. └─rstan::stan(...)
 2.   └─rstan::stan_model(...)
 3.     └─rstan:::cxxfunctionplus(...)
 4.       └─base::sink(type = "output")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: processing vignette 'Bayesian_Logistic_regression.Rmd' failed with diagnostics:
invalid connection
--- failed re-building 'Bayesian_Logistic_regression.Rmd'

--- re-building 'Conditional_Logistic_Regression.Rmd' using rmarkdown
--- finished re-building 'Conditional_Logistic_Regression.Rmd'

--- re-building 'Logistic_Regression.Rmd' using rmarkdown
--- finished re-building 'Logistic_Regression.Rmd'

SUMMARY: processing the following file failed:
  'Bayesian_Logistic_regression.Rmd'

Error: Vignette re-building failed.
Execution halted

r-oldrel-windows-x86_64

Error(s) in re-building vignettes:
--- re-building 'Bayesian_Logistic_regression.Rmd' using rmarkdown
make cmd is
  make -f "D:/RCompile/recent/R-4.5.3/etc/x64/Makeconf" -f "D:/RCompile/recent/R-4.5.3/share/make/winshlib.mk" CXX='$(CXX17) $(CXX17STD)' CXXFLAGS='$(CXX17FLAGS)' CXXPICFLAGS='$(CXX17PICFLAGS)' SHLIB_LDFLAGS='$(SHLIB_CXX17LDFLAGS)' SHLIB_LD='$(SHLIB_CXX17LD)' SHLIB="file14c0c5c8816c8.dll" WIN=64 TCLBIN= OBJECTS="file14c0c5c8816c8.o"

make would use
if test "zfile14c0c5c8816c8.o" != "z"; then \
  if test -e "file14c0c5c8816c8-win.def"; then \
    echo g++  -shared -s -static-libgcc -o file14c0c5c8816c8.dll file14c0c5c8816c8-win.def file14c0c5c8816c8.o  "D:/RCompile/CRANpkg/lib/4.5/rstan/lib/x64/libStanServices.a" -L"D:/RCompile/CRANpkg/lib/4.5/StanHeaders/libs/x64" -lStanHeaders -L"D:/RCompile/CRANpkg/lib/4.5/RcppParallel/lib/x64" -ltbb -LD:/RCompile/CRANpkg/lib/4.5/RcppParallel/libs/x64 -lRcppParallel -LD:/RCompile/CRANpkg/lib/4.5/RcppParallel/lib/x64 -ltbb -ltbbmalloc -L"d
...[truncated]...
fi

Quitting from Bayesian_Logistic_regression.Rmd:268-348 [unnamed-chunk-7]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error in `sink()`:
! invalid connection
---
Backtrace:
    ▆
 1. └─rstan::stan(...)
 2.   └─rstan::stan_model(...)
 3.     └─rstan:::cxxfunctionplus(...)
 4.       └─base::sink(type = "output")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: processing vignette 'Bayesian_Logistic_regression.Rmd' failed with diagnostics:
invalid connection
--- failed re-building 'Bayesian_Logistic_regression.Rmd'

--- re-building 'Conditional_Logistic_Regression.Rmd' using rmarkdown
--- finished re-building 'Conditional_Logistic_Regression.Rmd'

--- re-building 'Logistic_Regression.Rmd' using rmarkdown
--- finished re-building 'Logistic_Regression.Rmd'

SUMMARY: processing the following file failed:
  'Bayesian_Logistic_regression.Rmd'

Error: Vignette re-building failed.
Execution halted

r-release-windows-x86_64

Error(s) in re-building vignettes:
--- re-building 'Bayesian_Logistic_regression.Rmd' using rmarkdown
specified C++17
make cmd is
  make -f "D:/RCompile/recent/R-4.6.1/etc/x64/Makeconf" -f "D:/RCompile/recent/R-4.6.1/share/make/winshlib.mk" CXX='$(CXX17) $(CXX17STD)' CXXFLAGS='$(CXX17FLAGS)' CXXPICFLAGS='$(CXX17PICFLAGS)' SHLIB_LDFLAGS='$(SHLIB_CXX17LDFLAGS)' SHLIB_LD='$(SHLIB_CXX17LD)' SHLIB="file5971852873328.dll" WIN=64 TCLBIN= OBJECTS="file5971852873328.o"

make would use
if test "zfile5971852873328.o" != "z"; then \
  if test -e "file5971852873328-win.def"; then \
    echo g++   -shared  -s -static-libgcc -o file5971852873328.dll file5971852873328-win.def file5971852873328.o  "D:/RCompile/CRANpkg/lib/4.6/rstan/lib/x64/libStanServices.a" -L"D:/RCompile/CRANpkg/lib/4.6/StanHeaders/libs/x64" -lStanHeaders -L"D:/RCompile/CRANpkg/lib/4.6/RcppParallel/lib/x64" -ltbb -LD:/RCompile/CRANpkg/lib/4.6/RcppParallel/libs/x64 -lRcppParallel -LD:/RCompile/CRANpkg/lib/4.6/RcppParallel/lib/x64 -ltb
...[truncated]...
fi

Quitting from Bayesian_Logistic_regression.Rmd:268-348 [unnamed-chunk-7]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error in `sink()`:
! invalid connection
---
Backtrace:
    ▆
 1. └─rstan::stan(...)
 2.   └─rstan::stan_model(...)
 3.     └─rstan:::cxxfunctionplus(...)
 4.       └─base::sink(type = "output")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: processing vignette 'Bayesian_Logistic_regression.Rmd' failed with diagnostics:
invalid connection
--- failed re-building 'Bayesian_Logistic_regression.Rmd'

--- re-building 'Conditional_Logistic_Regression.Rmd' using rmarkdown
--- finished re-building 'Conditional_Logistic_Regression.Rmd'

--- re-building 'Logistic_Regression.Rmd' using rmarkdown
--- finished re-building 'Logistic_Regression.Rmd'

SUMMARY: processing the following file failed:
  'Bayesian_Logistic_regression.Rmd'

Error: Vignette re-building failed.
Execution halted
ERRORexamplesr-devel-linux-x86_64-debian-gcc
Running examples in ‘CLRtools-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: residuals_clog
> ### Title: Model Diagnostic for Conditional Logistic Regression
> ### Aliases: residuals_clog
> 
> ### ** Examples
> 
> # Example from Hosmer et al., 2013
> # Applied Logistic Regression (3rd ed.), Chapter 7
> 
> # Convert 'fracture' to binary (0 = No, 1 = Yes)
> glow11m$fracture <- ifelse(glow11m$fracture == "Yes", 1, 0)
> 
> # Load required package
> library(survival)
> 
> # Fit a conditional logistic regression model
> mod7.3 <- clogit(
+   fracture ~ weight + bmi + priorfrac + momfrac + armassist + strata(pair),
+   data = glow11m)
> 
> # Run diagnostics for the conditional logistic model
> residuals_clog(mod7.3, strata = glow11m$pair, y = glow11m$fracture)
Error in a$specials[[i]] : subscript out of bounds
Calls: residuals_clog ... model.matrix -> model.matrix.coxph -> delete.response -> off
Execution halted

CRAN check page ↗

Slowest check: 13.2 min · r-release-linux-x86_64
Status changes
  • ERROR9 OK, 4 ERRORNow
  • ERROR12 OK, 1 ERROR2026-09-06
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK13 OK2026-06-09
  • ERROR12 OK, 1 ERROR2026-06-08
Show 5 earlier changesHide 5 earlier changes
  • OK13 OK2026-05-02
  • ERROR11 OK, 1 ERROR2026-04-25
  • NOTE11 OK, 3 NOTE2026-04-22
  • ERROR10 OK, 3 NOTE, 1 ERROR2026-04-18
  • NOTE5 OK, 9 NOTE2026-03-10
Advisories

none known

Documentation

In release 0.1.2
READMEYes · 152 wordsVignettesYes · 3 · dynamicNEWSYes · 67% structured · mentions 0.1.2Citation fileNoWebsitenot declared in DESCRIPTION
Help pages
28 (1 internal)includes a package overview page
Examples that run
100%19 run in a plain check
Exported functions with examples
76%
Documented parameters
100%
Return-value docs
100%
Help pages citing references
29%

Downloads

3.9K
CRAN downloads in the past year
Rank #10,285 · ~11/day · ~323/mo
Daily download trend is not available in this view yet.
24830 days
1K90 days
3.9K1 year
Compare downloads with other packages →
Also on126 r2u13 autocran

Repository

0Stars
1Forks
0Open issues
0Open PRs
0Releases
10Commits
2Commit identities
10 commits · Last activity 2026-08-10
Responsiveness
How these are sampled
PRs merged (all time)
100%
Median days to close, 50 most recently updated closed issues
not measured
Median days to close, 50 most recently updated closed PRs
8

Forks over time

2026-07-07 · 02026-07-20 · 1
PracticesBeta

Checks run against github.com/brendacontla/clrtools on 2026-10-22.

No development-tooling practices detected in the upstream repository.

How this is detected·Detection ruleset v4 (2026-10-20)

Dependencies

Declared dependencies
17 external dependencies (excludes base and recommended)

Installing CLRtools adds 122 packages (62 with compiled code, 118 MB of source tarballs). Heaviest: BH 14 MB, stringi 11 MB, ggplot2 6.0 MB.

Depends (1)
R >= 3.5
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

Datasets

People & History

People (3)
Author, Maintainer since 0.1.0 (2026)
Contributor
Provided statistical guidance, conceptual feedback, and supervision
Contributor
Provided statistical guidance, conceptual feedback, and supervision
Releases (3)

Pick two releases to compare their code metrics.

  • R
    R 4.6.0 released · 2026-04-24
  • 0.1.2Latest
    record
    2026-03-16 · current release · diff ↗
  • 0.1.1
    record
    2026-03-16 · diff ↗
  • 0.1.0
    record
    2026-01-29
  • R
    R 4.5.0 released · 2025-04-11

Package metadata

First published
2026-01-29
Total releases
3 / 1 yrs
License
GPL-3 OSI
Minimum R
≥ 3.5
Bundled data
11 KB / 2 files
Download size
4.7 MB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("CLRtools")
Contla Hernández, B., Compton, C., & Vignes, M. (2026). CLRtools: Diagnostic Tools for Logistic and Conditional Logistic Regression (Version 0.1.2) [Computer software]. https://doi.org/10.32614/CRAN.package.CLRtools

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 CLRtools version 0.1.2 [Data set]. HJJB, LLC. Data release v2026-10-24. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-24, 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