Skip to content

Commit 8d97ac0

Browse files
jucorclaude
andcommitted
Fix D9: z-score thresholds from two-tailed to one-tailed
Change Z_90 from 1.645 to 1.2816 and Z_95 from 1.96 to 1.6449 in repness.py, matching Clojure's one-tailed z-scores (stats.clj) and resolving an internal inconsistency with Python's own stats.py which already used the correct values. The proportion tests in Polis check whether a comment's agree/disagree rate is significantly above 0.5 — a directional hypothesis requiring one-tailed tests. The two-tailed values were 28% more conservative, causing fewer comments to pass significance. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e883338 commit 8d97ac0

7 files changed

Lines changed: 2717 additions & 2752 deletions

File tree

delphi/polismath/pca_kmeans_rep/repness.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515
from polismath.utils.general import AGREE, DISAGREE
1616

1717

18-
# Statistical constants
19-
Z_90 = 1.645 # Z-score for 90% confidence
20-
Z_95 = 1.96 # Z-score for 95% confidence
18+
# Statistical constants — one-tailed z-scores, matching Clojure (stats.clj)
19+
# and Python's own stats.py (z_sig_90, z_sig_95).
20+
# One-tailed: P(Z > z) = α, i.e. the entire rejection region is on one side.
21+
Z_90 = 1.2816 # Z-score for 90% confidence (one-tailed)
22+
Z_95 = 1.6449 # Z-score for 95% confidence (one-tailed)
2123

2224
# Pseudocount for Bayesian smoothing (Beta prior)
2325
#

0 commit comments

Comments
 (0)