Conversation
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.
Fleming–Harrington weighting currently fits its pooled Kaplan–Meier curve without the supplied case weights, although the test's risk sets, event counts and covariance calculation use those weights. This makes the result depend on whether duplicate observations are expanded or represented as frequency counts.
Compute left-continuous pooled survival directly from the same weighted risk sets already used by the test: cumulatively multiply
1 - d_i / n_i, then shift by one with an initial value of 1. This also avoids the assumption that the KM timeline has an extra origin row before every observed time, resolving the zero-time length mismatch in #1681.On
load_waltons(), 163 rows can be compressed losslessly into 39 rows with integer frequency weights. For FH(p=3,q=3), the original expanded representation gives p=0.0607523, but the compressed representation gives p=4.46375e-9. After this patch, both give p=0.0607523. A full grid is recorded rather than only this crossing: (0,0), (1,0), (0,1), (1,1), (2,2), (3,3), (4,4). The (0,0) log-rank control agrees before and after; every nontrivial weighting in this grid disagrees before correction. These are the same observations, not different weighting estimands or new data.Validation on base
7a8fc34a013ecd79fa405017b89e1697c1cc6e17: seven cases compare expanded/compressed results against a separate scalar risk-set implementation of the two-group weighted log-rank statistic; two cases test invariance to a shift from a zero time origin. Before: eight fail, one passes. The complete existing statistics test file plus these cases gives 51 passed. Black 22.8.0 formatting passes. The full package suite was not run. Released 0.30.3 also reproduces the case-weight discrepancy.Fixes #1681. Prepared with AI assistance. This checks a bundled Drosophila dataset and does not establish an effect on a published conclusion or clinical decision. The public audit includes the reproduction scripts, separate patches, environment records and before/after execution logs in a downloadable evidence archive.