Remove survMisc dependency, implement weighted log-rank tests internally#700
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
survMisc::ten()andsurvMisc::comp()with a self-contained internal weighted log-rank test implementation (R/weighted_logrank.R, ~130 lines of base R)Changes
R/weighted_logrank.R.weighted_logrank_test()functionR/surv_pvalue.Rten()/comp()block with call to new internal functionR/utilities.R@importFrom survMisc ten compDESCRIPTIONsurvMiscfrom ImportsNAMESPACER/ggsurvplot.R,R/ggurvplot_arguments.R\link[survMisc]{comp}with plain textvignettes/NEWS.mdtests/testthat/test-surv_pvalue.RTest plan
devtools::test()— 42 tests pass, 0 failuresdevtools::check(vignettes = FALSE)— 0 errors, 0 warnings