Skip to content

Remove survMisc dependency, implement weighted log-rank tests internally#700

Merged
kassambara merged 1 commit into
masterfrom
remove-survmisc
Feb 24, 2026
Merged

Remove survMisc dependency, implement weighted log-rank tests internally#700
kassambara merged 1 commit into
masterfrom
remove-survmisc

Conversation

@kassambara
Copy link
Copy Markdown
Owner

Summary

  • Replace survMisc::ten() and survMisc::comp() with a self-contained internal weighted log-rank test implementation (R/weighted_logrank.R, ~130 lines of base R)
  • survMisc is at risk of CRAN archival (last updated April 2022); this removes the only dependency on it
  • All 6 weight methods (log-rank, Gehan-Breslow, Tarone-Ware, Peto-Peto, modified Peto-Peto, Fleming-Harrington) plus test-for-trend continue to work identically — validated against survMisc output

Changes

File Change
R/weighted_logrank.R New internal .weighted_logrank_test() function
R/surv_pvalue.R Replace ten()/comp() block with call to new internal function
R/utilities.R Remove @importFrom survMisc ten comp
DESCRIPTION Remove survMisc from Imports
NAMESPACE Auto-regenerated, survMisc imports removed
R/ggsurvplot.R, R/ggurvplot_arguments.R Replace \link[survMisc]{comp} with plain text
vignettes/ Remove survMisc references
NEWS.md Add entry under Major changes
tests/testthat/test-surv_pvalue.R New tests covering all weight methods, multi-group, trend

Test plan

  • devtools::test() — 42 tests pass, 0 failures
  • devtools::check(vignettes = FALSE) — 0 errors, 0 warnings
  • Validated new implementation against survMisc reference values for all 6 methods, 2-group, 3+ group, and test-for-trend cases

Replace survMisc::ten() and survMisc::comp() calls with a self-contained
weighted log-rank test implementation in R/weighted_logrank.R. This avoids
depending on survMisc which is at risk of CRAN archival.

The internal function supports all 6 weight methods (log-rank,
Gehan-Breslow, Tarone-Ware, Peto-Peto, modified Peto-Peto,
Fleming-Harrington) plus test-for-trend, validated against survMisc output.

All existing method arguments in surv_pvalue() and log.rank.weights in
ggsurvplot() continue to work identically.
@kassambara kassambara merged commit eed7215 into master Feb 24, 2026
5 checks passed
@kassambara kassambara deleted the remove-survmisc branch February 24, 2026 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant