Implementation of Logistic Box-Cox Regression
Overview
Implements a logistic Box-Cox model that adds a shape parameter to a routine logistic regression model to flexibly estimate the shape and strength of the relationship between a binary outcome and a continuous predictor, adjusting for covariates and survey weights. This model is fully described in Xing, L. et al. (2021) doi:10.1002/cjs.11587. This version extends the original 'lboxcox' package (1.1) with numerically stabilized likelihood/gradient calculations, vectorized data preprocessing, and a bootstrap-ensemble estimator.
Install
Health
ERRORtestsr-oldrel-macos-arm64
Running ‘testthat.R’ [5s/5s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> library(testthat)
> library(lboxcox)
Loading required package: survey
Loading required package: grid
Loading required package: Matrix
Loading required package: survival
Attaching package: 'survey'
The following object is masked from 'package:graphics':
dotchart
>
> test_check("lboxcox")
*** caught segfault ***
address 0x110, cause 'invalid permissions'
*** caught segfault ***
address 0x110, cause 'invalid permissions'
Traceback:
1: glm.fit(x = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
...[truncated]...
orter, load_helpers = load_helpers, env = env, stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, load_package = load_package, parallel = parallel, shuffle = shuffle)
73: test_dir("testthat", package = package, reporter = reporter, ..., load_package = "installed")
74: test_check("lboxcox")
An irrecoverable exception occurred. R is aborting now ...
Saving _problems/test-lboxcox-50.R
[ FAIL 1 | WARN 47 | SKIP 0 | PASS 55 ]
══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-lboxcox.R:44:3'): svyglm_train init is the same with and without parallel ──
Error in `if (lambda == 0) log(myXX) else expm1(lambda * log(myXX))/lambda`: argument is of length zero
Backtrace:
▆
1. └─lboxcox:::svyglm_train(...) at test-lboxcox.R:44:3
2. └─lboxcox:::train_single_svyglm_model(formula, design, best_lambda)
[ FAIL 1 | WARN 47 | SKIP 0 | PASS 55 ]
Error:
! Test failures.
Execution halted- ERROR12 OK, 1 ERROR2026-10-05
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK14 OK2026-03-30
- ERROR13 OK, 1 ERROR2026-03-10
Documentation
- Help pages
- 12 (1 internal)includes a package overview page
- Examples that run
- no examples
- Exported functions with examples
- 0%
- Documented parameters
- 94%
- Return-value docs
- 100%
- Help pages citing references
- 8%
Downloads
Dependencies
Installing lboxcox adds 73 packages (38 with compiled code, 56 MB of source tarballs). Heaviest: stringi 11 MB, ggplot2 6.0 MB, data.table 5.7 MB.
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- 2.0.1Latest2026-10-04 · current release · diff ↗ ·
removed 7 exports
LogLikeFun, LogLikeFun_new, ScoreFun, ScoreFun_new, box_cox_new, lbc_train, svyglm_ms·added 7 exports
devr, lbc_train_all, lbc_train_bagging, lbc_train_ms, lboxcox_cv.fit, lboxcox_cv.predict, lboxcox_maxLik_el.predict23 hours in CRAN's queue
Listed in CRAN's incoming queue from 2026-10-03 21:57 to 2026-10-04 20:43 UTC, in 6 readings. - RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- 1.22023-12-16 · diff ↗ ·
added 6 exports
LogLikeFun_new, ScoreFun_new, box_cox_new, lbc_maxlik, lboxcox_maxLik.predict, svyglm_ms - RR 4.3.0 released · 2023-04-21
- 1.1
- RR 4.2.0 released · 2022-04-22
- 1.02022-01-27
- RR 4.1.0 released · 2021-05-18
Package metadata
- First published
- 2022-01-27
- Total releases
- 4 / 4 yrs
- License
- GPL-3 OSI
- Minimum R
- ≥ 3.5.0
- Bundled data
- 86 KB / 1 file
- Download size
- 126 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("lboxcox")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.
From data release v2026-10-23, which the citation names so these numbers can be found later. More on citing and the projects behind them.