[Repo Assist] feat: add dunnSidakFWER and holmSidakFWER corrections to MultipleTesting#374
Draft
github-actions[bot] wants to merge 2 commits intodeveloperfrom
Conversation
Implements the Šidák (Dunn-Šidák) FWER corrections requested in #178: - dunnSidakFWER: single-step adjustment p_adj = 1 - (1 - p)^m - holmSidakFWER: step-down (Holm-style) adjustment using the Šidák formula at each step: p_adj_(i) = 1 - (1 - p_(i))^(m-i+1) Both functions are NaN-safe (ignored in computation, preserved in output), consistent with the existing holmFWER and hochbergFWER functions. 4 new unit tests verified against Python reference calculations. All 1197 tests pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
32 tasks
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.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Summary
Implements the Šidák (Dunn-Šidák) FWER multiple-testing corrections requested in #178.
Two new functions added to
FSharp.Stats.Testing.MultipleTesting:dunnSidakFWER— single-step Šidák: adjusts each p-value independently asp_adj = 1 - (1 - p)^m. Slightly less conservative than Bonferroni.holmSidakFWER— step-down (Holm-style) Šidák: applies the Šidák formula at each sequential step, giving a more powerful test than the single-step variant while still controlling the FWER.Both functions match the style of the existing
holmFWERandhochbergFWER:float[]Background
The Šidák correction is derived from the formula for the probability that all of m independent tests give a false positive:
α_per_test = 1 - (1 - α_FWER)^(1/m). The adjusted p-value form is the inverse.References:
Changes
src/FSharp.Stats/Testing/MultipleTesting.fs: addeddunnSidakFWERandholmSidakFWERtests/FSharp.Stats.Tests/Testing.fs: 4 new tests (basic and NaN cases for each function)Test Status
✅ All 1197 tests pass (1193 pre-existing + 4 new).
Closes #178