From 08e9e0c21923e015a3373ef04a505028d9573f11 Mon Sep 17 00:00:00 2001 From: Branimir Georgiev <66906831+braboj@users.noreply.github.com> Date: Sat, 7 Nov 2026 09:24:25 +0200 Subject: [PATCH 1/2] fix(efficacy): the method sentence names the install rate's score interval The install rate is a share, and a share of 1.0 in both arms resamples to the same zero every time, so its interval is Newcombe's score interval from the Wilson interval of each arm's share, paired over the blocks' agreement or from the two shares on their own. The record and the appendix said every interval was a bootstrap; the method sentence now names this one apart. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01DpT5xQQ4hBtuBqvpuv9xGj --- tests/efficacy/report.py | 41 ++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/tests/efficacy/report.py b/tests/efficacy/report.py index 7da2647..3188e3c 100644 --- a/tests/efficacy/report.py +++ b/tests/efficacy/report.py @@ -802,19 +802,32 @@ def unpaired_note(results): for label in unpaired])) +# The install rate's interval is not a bootstrap: a share of 1.0 in both +# arms resamples to the same zero every time. Newcombe's score interval +# (1998, method 10) gives it a width from the Wilson interval of each share. +RELIABILITY_METHOD = ( + "The install rate's interval is Newcombe's score interval instead, " + "from the Wilson interval of each arm's share: over the blocks' " + "agreement where the contrast is paired, from the two shares on their " + "own where it is not.") + + def interval_method(results, k): - """How the intervals were made, in a sentence or two: paired within a + """How the intervals were made, in a few sentences: paired within a block, and unpaired for the contrasts whose arms ran in different - rounds, each named. At a K too small to decide anything, the paired - sentence gives way to the descriptive note, so only the unpaired one - is given.""" - if k < FEWEST_DECIDING: - return unpaired_note(results) - text = ("Each interval below is a 95 %% bootstrap interval over the " - "paired differences of its contrast, one per block that " - "measured both arms: K = %d at most, and a cell that had fewer " - "names its count." % k) - return " ".join(part for part in (text, unpaired_note(results)) if part) + rounds, each named; the install rate's score interval apart. At a K + too small to decide anything, the paired sentence gives way to the + descriptive note, so only the other two are given.""" + parts = [] + if k >= FEWEST_DECIDING: + parts.append("Each interval below is a 95 %% bootstrap interval over " + "the paired differences of its contrast, one per block " + "that measured both arms: K = %d at most, and a cell " + "that had fewer names its count." % k) + parts.append(unpaired_note(results)) + if "reliability" in results: + parts.append(RELIABILITY_METHOD) + return " ".join(part for part in parts if part) def method_lines(results, k): @@ -7383,7 +7396,11 @@ def planted(install=True, probes=None, **scores): and "hybrid − none, are unpaired" in interval_method( across, FEWEST_DECIDING) and interval_method(results, FEWEST_DECIDING).endswith( - "names its count."), + "names its count.") + and "Newcombe's score interval" in interval_method( + {"reliability": {}}, FEWEST_DECIDING) + and "Newcombe" not in interval_method(results, + FEWEST_DECIDING), interval_method(across, FEWEST_DECIDING))) # A withdrawn metric's target drops out of the radar and its tables, as From d674bda5d11bbded8e28c8955300b88fc5918f21 Mon Sep 17 00:00:00 2001 From: Branimir Georgiev <66906831+braboj@users.noreply.github.com> Date: Sat, 7 Nov 2026 09:28:39 +0200 Subject: [PATCH 2/2] fix(efficacy): the install rate's method is read from the intervals themselves A round before 5d bootstrapped the install rate like any other row, so the sentence naming Newcombe's score interval is given only where a reliability contrast's interval says it was made that way. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01DpT5xQQ4hBtuBqvpuv9xGj --- tests/efficacy/report.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/tests/efficacy/report.py b/tests/efficacy/report.py index 3188e3c..0196ee5 100644 --- a/tests/efficacy/report.py +++ b/tests/efficacy/report.py @@ -825,7 +825,13 @@ def interval_method(results, k): "that measured both arms: K = %d at most, and a cell " "that had fewer names its count." % k) parts.append(unpaired_note(results)) - if "reliability" in results: + + # Read from the intervals themselves: a round before 5d bootstrapped the + # install rate like any other row, and its report says so by silence. + if any(str((contrast.get("interval") or {}).get("method", "")) + .startswith("Newcombe") + for contrast in results.get("reliability", {}).values() + if isinstance(contrast, dict)): parts.append(RELIABILITY_METHOD) return " ".join(part for part in parts if part) @@ -7398,9 +7404,13 @@ def planted(install=True, probes=None, **scores): and interval_method(results, FEWEST_DECIDING).endswith( "names its count.") and "Newcombe's score interval" in interval_method( - {"reliability": {}}, FEWEST_DECIDING) - and "Newcombe" not in interval_method(results, - FEWEST_DECIDING), + {"reliability": {"hybrid-none": { + "interval": newcombe_paired([(1.0, 1.0)] * 6)}}}, + FEWEST_DECIDING) + and "Newcombe" not in interval_method( + {"reliability": {"hybrid-none": {"interval": { + "method": "BCa, 2000 resamples, 95%"}}}}, + FEWEST_DECIDING), interval_method(across, FEWEST_DECIDING))) # A withdrawn metric's target drops out of the radar and its tables, as