Skip to content

[Repo Assist] feat: add dunnSidakFWER and holmSidakFWER corrections to MultipleTesting#374

Draft
github-actions[bot] wants to merge 2 commits intodeveloperfrom
repo-assist/improve-dunn-sidak-20260412-ff9a8aac-3956323be622a182
Draft

[Repo Assist] feat: add dunnSidakFWER and holmSidakFWER corrections to MultipleTesting#374
github-actions[bot] wants to merge 2 commits intodeveloperfrom
repo-assist/improve-dunn-sidak-20260412-ff9a8aac-3956323be622a182

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

🤖 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 as p_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 holmFWER and hochbergFWER:

  • Operate on float[]
  • NaN-safe: NaN entries are excluded from the test count and returned unchanged at their original indices

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:

  • Šidák (1967): Rectangular confidence regions for the means of multivariate normal distributions
  • Holm (1979): A simple sequentially rejective multiple test procedure
  • [Abdi (2007) — Bonferroni and Šidák corrections for multiple comparisons]((personal.utdallas.edu/redacted)

Changes

  • src/FSharp.Stats/Testing/MultipleTesting.fs: added dunnSidakFWER and holmSidakFWER
  • tests/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

Generated by 🌈 Repo Assist, see workflow run. Learn more.

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@97143ac59cb3a13ef2a77581f929f06719c7402a

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Dunn-Šidák correction

0 participants