5D Library › 科学方法论、可证伪性与可重复性危机的数理统计 · English

第六章 元科学的解药:预注册、注册报告与等效性检验

把预测与事后解释分开

诺塞克等人在 2018 年把预注册的道理概括为一句话:科学进步需要用新的观察检验由已有观察提出的假说,而研究者常常把这两件事混在一起 (Nosek et al. 2018)。用数据提出假说(探索、事后解释)是正当的,用数据检验假说(验证、预测)也是正当的;问题在于用同一批数据既提出又检验,并把结果当作检验来报告。后见之明偏差使人很难在事后分清自己当初预期的是什么。预注册就是在知道结果之前,把研究问题、主要结局、样本量与分析方案写下来并公开存档,使读者能够分辨哪些结果是预测、哪些是事后的发现。

这与第一章的可证伪性是同一件事。一份预注册写下的,正是理论在这项研究中禁止什么:如果主要结局的差异落在某个范围内,假说就被认为得到支持;落在另一个范围内,就被认为没有得到支持。第三章的岔口都在看到数据之前被堵上了。

为什么锁定方案能把假阳性率拉回名义水平

真实效应为零,两组各 50 人,每人测三个相关为 0.5 的结局;每种方案模拟 20,000 次。比较:事先注册的单一结局;三个结局中报告最好的;三个结局中最好的、但用邦费罗尼校正(α/3\alpha/3);在每组 25 人与 50 人时各看一次、每次都用 0.05;以及事先注册的两次期中分析边界(波科克边界,每次名义 α=0.0294\alpha = 0.0294)。最后是两项关于阳性结果比例的研究,附威尔逊 95% 置信区间。

推导

# Why fixing the analysis in advance restores the nominal error rate. True effect ZERO;
# two groups; 20,000 simulated studies per plan; two-sided t tests (critical values by
# Cornish-Fisher). The Pocock boundary for two equally spaced looks uses nominal alpha
# 0.0294 at each look.
import math, random
from statistics import NormalDist

def t_crit(alpha, df):
    z = NormalDist().inv_cdf(1 - alpha / 2)
    return (z + (z ** 3 + z) / (4 * df)
            + (5 * z ** 5 + 16 * z ** 3 + 3 * z) / (96 * df ** 2)
            + (3 * z ** 7 + 19 * z ** 5 + 17 * z ** 3 - 15 * z) / (384 * df ** 3))

def t_abs(xs, ys):
    n = len(xs); mx, my = sum(xs) / n, sum(ys) / n
    sp2 = (sum((x - mx) ** 2 for x in xs) + sum((y - my) ** 2 for y in ys)) / (2 * n - 2)
    return abs(mx - my) / math.sqrt(2 * sp2 / n)

def study(rng, n=50):
    # three outcomes per person, pairwise correlation 0.5 (shared component)
    def person():
        c = rng.gauss(0, 1)
        return [math.sqrt(0.5) * c + math.sqrt(0.5) * rng.gauss(0, 1) for _ in range(3)]
    return [person() for _ in range(n)], [person() for _ in range(n)]

def wilson(k, n):
    z = 1.96; p = k / n
    c = (p + z * z / (2 * n)) / (1 + z * z / n)
    h = z * math.sqrt(p * (1 - p) / n + z * z / (4 * n * n)) / (1 + z * z / n)
    return f"{p:.1%} ({c - h:.1%} to {c + h:.1%})"

if __name__ == "__main__":
    rng = random.Random(2600)
    c05_98, c05_48 = t_crit(0.05, 98), t_crit(0.05, 48)
    cbon, cp98, cp48 = t_crit(0.05 / 3, 98), t_crit(0.0294, 98), t_crit(0.0294, 48)
    hits = [0] * 5
    sims = 20000
    for _ in range(sims):
        a, b = study(rng)
        ts = [t_abs([p[j] for p in a], [p[j] for p in b]) for j in range(3)]
        half = t_abs([p[0] for p in a[:25]], [p[0] for p in b[:25]])
        hits[0] += ts[0] > c05_98                       # the one registered outcome
        hits[1] += max(ts) > c05_98                     # best of three outcomes
        hits[2] += max(ts) > cbon                       # best of three, Bonferroni
        hits[3] += half > c05_48 or ts[0] > c05_98      # peek at 25, then 50
        hits[4] += half > cp48 or ts[0] > cp98          # peek, Pocock boundary
    labels = ["registered: one outcome, one test at 50 per group",
              "report the best of 3 outcomes", "best of 3 with Bonferroni (alpha / 3)",
              "look at 25 and at 50, p < .05 each time",
              "look at 25 and at 50, registered Pocock boundary"]
    for lab, h in zip(labels, hits):
        print(f"{lab:52s} false-positive rate {h / sims:6.1%}")
    print("positive first hypothesis, Scheel et al. 2021: standard reports 146 / 152 =",
          wilson(146, 152))
    print("                                              Registered Reports  31 / 71 =",
          wilson(31, 71))
    print("benefit on primary outcome, Kaplan & Irvin 2015: before 2000 17 / 30 =",
          wilson(17, 30))
    print("                                                  after 2000  2 / 25 =",
          wilson(2, 25))
# registered: one outcome, one test at 50 per group    false-positive rate   5.0%
# report the best of 3 outcomes                        false-positive rate  12.7%
# best of 3 with Bonferroni (alpha / 3)                false-positive rate   4.5%
# look at 25 and at 50, p < .05 each time              false-positive rate   8.4%
# look at 25 and at 50, registered Pocock boundary     false-positive rate   5.0%
# positive first hypothesis, Scheel et al. 2021: standard reports 146 / 152 = 96.1% (91.7% to 98.2%)
#                                               Registered Reports  31 / 71 = 43.7% (32.7% to 55.2%)
# benefit on primary outcome, Kaplan & Irvin 2015: before 2000 17 / 30 = 56.7% (39.2% to 72.6%)
#                                                   after 2000  2 / 25 = 8.0% (2.2% to 25.0%)

事先注册的单一结局,假阳性率就是 5.0%。在三个结局中挑最好的,升到 12.7%;同样的挑选加上邦费罗尼校正,降到 4.5%(略低于 5%,因为三个结局彼此相关,校正偏保守)。在 25 人与 50 人时各看一次、每次都用 0.05,假阳性率升到 8.4%;如果事先注册了期中分析,并为两次检验预先规定更严格的边界,就回到 5.0%。所以预注册并不禁止多个结局或期中分析,它要求的是事先说清楚,并相应地调整判断标准。

注册报告

预注册解决了「事后挑选」,但没有解决「发表偏倚」:一项按计划完成、结果为阴性的研究,仍然可能被期刊拒绝或被作者放进抽屉。神经科学家钱伯斯在 2013 年宣布《皮层》(Cortex)期刊开始接受注册报告 (Chambers 2013):作者在收集数据之前提交引言、方法与分析计划,经同行评审后,期刊作出「原则上接受」的决定;只要研究者按计划完成研究,无论结果如何,论文都会发表。这样,发表与否取决于问题是否重要、方法是否可靠,而不取决于结果是否显著。

证据

注册报告中的阳性结果比例。 舍尔、斯海恩与拉肯斯在 2021 年比较了 71 篇已发表的心理学注册报告与随机抽取的 152 篇标准文献中检验假说的研究,只看每篇文章的第一个假说。标准文献中 96% 报告了阳性结果,注册报告中只有 44%;排除直接重复研究后,分别为 96% 与 50% (Scheel et al. 2021)。作者指出,这一差距说明心理学中阴性结果被大量少报;但这项研究不是随机分配的,不能直接证明注册报告降低了偏倚,因为选择注册报告形式的研究可能本来就不同(例如更多是重复研究)。

程序算出,标准文献的 146/152 = 96.1%(91.7% 到 98.2%),注册报告的 31/71 = 43.7%(32.7% 到 55.2%),两个区间相距很远,与原文的 96% 与 44% 一致。框架中的这两个数字经核对无误。

证据

临床试验注册之后。 卡普兰与欧文分析了美国国家心肺血液研究所资助的大型临床试验:2000 年以前发表的 30 项中有 17 项(57%)在主要结局上报告了显著获益,2000 年以后的 25 项中只有 2 项(8%)。2000 年以后的试验都在 ClinicalTrials.gov 上事先登记了主要结局。作者强调这是一个关联,不能证明是登记要求导致了变化 (Kaplan and Irvin 2015)。

「没有差别」也要能证明:等效性检验

传统的显著性检验只能得出两种结论:「显著」或「不显著」。「不显著」并不意味着「没有差别」,它可能只是样本太小。要说明「两种做法的差别小到不值得在意」,需要事先规定一个最小关注效应(SESOI),然后检验真实差别是否落在 ±\pmSESOI 之内。拉肯斯在 2017 年向心理学研究者系统介绍了药理学中常用的双单侧检验(TOST) (Lakens 2017; Schuirmann 1987):分别检验「差别不小于 −–SESOI」与「差别不大于 ++SESOI」两个单侧假设,两个都被拒绝时,才宣布等效;这等价于看差别的 90% 置信区间是否完全落在 ±\pmSESOI 之内。最小关注效应可以根据临床或实际意义、已有研究的效应分布或资源限制来确定,但必须事先确定 (Lakens, Scheel, et al. 2018)。

本系列的判定规则有什么统计性质

5D Library 各书的第八章一般都写有一条事先写成代码的判定规则。框架把它称为「四档」规则;实际上它有五种结论,按顺序判断:

  1. 置信区间下限不低于最小关注效应:获益至少达到最小关注效应;
  2. 下限大于零:有获益,但幅度未确定是否达到最小关注效应;
  3. 上限小于零:有害;
  4. 置信区间完全落在 ±\pm最小关注效应之内:没有值得行动的差异;
  5. 其他:区间太宽,无法判断。

此外还有事先规定的前置条件(例如依从性不足、操纵检验失败、出现安全事件),一旦触发,无论结果如何都判为「不可解释」或暂停审查。

试验按「在最小关注效应处有 90% 把握度、双侧 α=0.05\alpha = 0.05」设计,于是标准误 = 最小关注效应 / 3.24。计算五种结论在不同真实效应下的概率(以最小关注效应为单位),并与 TOST(90% 置信区间)宣布等效的概率比较。最后直接用写成代码的判定规则对 10 万次模拟估计分类,检查公式。

推导

# The five-verdict rule of the 5D Library's Chapter 8 trials, and TOST (Lakens 2017), for
# a trial sized for 90 % power at the SESOI (= delta), two-sided alpha 0.05, so SE = delta
# / 3.24. Verdicts from the 95 % CI (lo, hi) of the effect, positive = benefit, checked in
# this order:
#   V1 lo >= delta: benefit of at least the SESOI
#   V2 lo > 0: benefit, size not shown to reach it
#   V3 hi < 0: HARM
#   V4 -delta <= lo and hi <= delta: no difference worth acting on
#   V5 otherwise: unclear
import math, random
from statistics import NormalDist
N = NormalDist()
Z95, Z90 = N.inv_cdf(0.975), N.inv_cdf(0.90)

def verdict(est, se, delta, z=Z95):
    lo, hi = est - z * se, est + z * se
    if lo >= delta: return 0
    if lo > 0: return 1
    if hi < 0: return 2
    if lo >= -delta and hi <= delta: return 3
    return 4

def probs(theta, delta=1.0):
    se = delta / (Z95 + Z90)
    cuts = [(-math.inf, -Z95 * se, 2), (-Z95 * se, -delta + Z95 * se, 4),
            (-delta + Z95 * se, delta - Z95 * se, 3), (delta - Z95 * se, Z95 * se, 4),
            (Z95 * se, delta + Z95 * se, 1), (delta + Z95 * se, math.inf, 0)]
    out = [0.0] * 5
    for a, b, v in cuts:
        out[v] += N.cdf((b - theta) / se) - N.cdf((a - theta) / se)
    tost = (N.cdf((delta - 1.645 * se - theta) / se)
            - N.cdf((-delta + 1.645 * se - theta) / se))
    return out, tost

if __name__ == "__main__":
    print("true effect / SESOI |  V1 >=SESOI  V2 benefit  V3 harm  V4 no diff  V5 unclear"
          " | TOST 90% CI")
    for r in (-0.5, 0.0, 0.25, 0.5, 0.75, 1.0, 1.5, 2.0):
        p, tost = probs(r)
        cols = "  ".join(f"{x:9.3f}" for x in p)
        print(f"      {r:5.2f}         | " + cols + f" | {tost:9.3f}")
    # check probs() against verdict() directly
    rng, se = random.Random(355), 1 / (Z95 + Z90)
    for r in (0.0, 1.0):
        c = [0] * 5
        for _ in range(100000):
            c[verdict(rng.gauss(r, se), se, 1.0)] += 1
        vs = "  ".join(f"V{k + 1} {x / 1e5:.3f}" for k, x in enumerate(c))
        print(f"check by simulation, true effect {r:.0f} SESOI: " + vs)
# true effect / SESOI |  V1 >=SESOI  V2 benefit  V3 harm  V4 no diff  V5 unclear | TOST 90% CI
#       -0.50         |     0.000      0.000      0.367      0.365      0.267 |     0.490
#        0.00         |     0.000      0.025      0.025      0.800      0.150 |     0.890
#        0.25         |     0.000      0.125      0.003      0.663      0.209 |     0.776
#        0.50         |     0.000      0.367      0.000      0.365      0.267 |     0.490
#        0.75         |     0.003      0.678      0.000      0.125      0.194 |     0.202
#        1.00         |     0.025      0.875      0.000      0.025      0.075 |     0.050
#        1.50         |     0.367      0.631      0.000      0.000      0.002 |     0.001
#        2.00         |     0.900      0.100      0.000      0.000      0.000 |     0.000
# check by simulation, true effect 0 SESOI: V1 0.000  V2 0.025  V3 0.026  V4 0.799  V5 0.150
# check by simulation, true effect 1 SESOI: V1 0.026  V2 0.875  V3 0.000  V4 0.025  V5 0.074
本系列判定规则五种结论的概率随真实效应的变化。横轴以最小关注效应为单位,试验按在 1 处有 90% 把握度设计。

结果显示了这条规则的几个性质,其中一些对本系列是重要的自我修正。

  • 第一类错误受控。 真实效应为零时,得出任何「获益」结论(第 1 或第 2 种)的概率是 2.5%,得出「有害」的概率也是 2.5%;最常见的结论是「没有值得行动的差异」(80.0%),其次是「无法判断」(15.0%)。
  • 「90% 把握度」指的是得到某种获益结论。 真实效应恰好等于最小关注效应时,第 1 种与第 2 种结论合计 90.0%,但其中最强的第 1 种只有 2.5%,其余 87.5% 是「有获益,但幅度未确定」。要有一半的机会得到第 1 种结论,真实效应需要约 1.6 倍于最小关注效应;要有 90% 的机会,需要约 2 倍。本系列多数书的样本量计算写的是「90% 把握度」,读者应当知道它不是「90% 的机会证明效应至少达到最小关注效应」(第 30 本第八章已就其试验说明过这一点)。
  • 中间值最难判断。 真实效应为最小关注效应的一半时,「有获益」(36.7%)与「没有值得行动的差异」(36.5%)的机会几乎相等,还有 26.7% 无法判断。这不是规则的缺陷,而是样本量的诚实结果。
  • 「没有差异」的结论比 TOST 更严格。 真实效应为零时,TOST 宣布等效的概率是 89.0%,本系列规则是 80.0%,因为后者用的是 95% 置信区间(相当于每侧 α=0.025\alpha = 0.025 的 TOST)。在真实效应恰好等于最小关注效应时,TOST 错误地宣布等效的概率是 5.0%,本系列规则是 2.5%。
  • 公式与代码一致。 用判定规则的代码直接分类模拟估计,真实效应为零时第 2、3、4 种结论为 2.5%、2.6%、79.9%,等于最小关注效应时第 1、2 种为 2.6% 与 87.5%,与公式一致。

注

为什么不降低最强结论的门槛? 若改为「点估计不低于最小关注效应」,它在真实效应只有一半时也常会出现,「至少达到」就不再可靠。严格写法的代价是需要更大的样本;各书应如实说明「90% 把握度」的含义。

其他方案与争论

本书着重于预注册与等效性检验,但元科学中还有其他提议。例如,本杰明等七十多位研究者建议把新发现的显著性门槛从 0.05 改为 0.005 (Benjamin et al. 2018);拉肯斯等另一组研究者则反驳说,与其换一个新的固定门槛,不如要求研究者事先论证自己选择的 α\alpha (Lakens et al. 2018)。元科学本身也在争论中改进,没有一劳永逸的答案。

本章小结

预注册在看到数据之前写下理论禁止什么,把假阳性率拉回名义水平;它不禁止多个结局或期中分析,只要求事先说清并调整标准。注册报告让发表与否不取决于结果;注册报告中第一个假说的阳性率约为 44%,标准文献约为 96%。等效性检验让「没有差别」也能被证明。本系列的判定规则有五种结论;它控制了第一类错误,但「90% 把握度」指的是得到某种获益结论,最强的结论在真实效应恰好等于最小关注效应时只有 2.5% 的机会出现。下一章回到中国古典学术,看「实事求是」「无征不信」在原文中说的是什么。

参考文献

Benjamin, Daniel J. et al. 2018. “Redefine Statistical Significance.” Nature Human Behaviour 2 (1): 6–10.
Chambers, Christopher D. 2013. “Registered Reports: A New Publishing Initiative at Cortex.” Cortex 49 (3): 609–10. https://doi.org/10.1016/j.cortex.2012.12.016.
Kaplan, Robert M., and Veronica L. Irvin. 2015. “Likelihood of Null Effects of Large NHLBI Clinical Trials Has Increased over Time.” PLoS ONE 10 (8): e0132382. https://doi.org/10.1371/journal.pone.0132382.
Lakens, Daniël. 2017. “Equivalence Tests: A Practical Primer for t Tests, Correlations, and Meta-Analyses.” Social Psychological and Personality Science 8 (4): 355–62. https://doi.org/10.1177/1948550617697177.
Lakens, Daniël et al. 2018. “Justify Your Alpha.” Nature Human Behaviour 2 (3): 168–71.
Lakens, Daniël, Anne M. Scheel, and Peder M. Isager. 2018. “Equivalence Testing for Psychological Research: A Tutorial.” Advances in Methods and Practices in Psychological Science 1 (2): 259–69.
Nosek, Brian A., Charles R. Ebersole, Alexander C. DeHaven, and David T. Mellor. 2018. “The Preregistration Revolution.” Proceedings of the National Academy of Sciences 115 (11): 2600–2606. https://doi.org/10.1073/pnas.1708274114.
Scheel, Anne M., Mitchell R. M. J. Schijen, and Daniël Lakens. 2021. “An Excess of Positive Results: Comparing the Standard Psychology Literature with Registered Reports.” Advances in Methods and Practices in Psychological Science 4 (2): 1–12. https://doi.org/10.1177/25152459211007467.
Schuirmann, Donald J. 1987. “A Comparison of the Two One-Sided Tests Procedure and the Power Approach for Assessing the Equivalence of Average Bioavailability.” Journal of Pharmacokinetics and Biopharmaceutics 15 (6): 657–80.

Fan, Y. (2026). Scientific Methodology, Falsifiability and the Mathematical Statistics of the Replication Crisis: From Popper's Demarcation and p-Hacking to Ioannidis's Theorem and Pre-Registration, Read Beside Classical Chinese Evidential Scholarship [科学方法论、可证伪性与可重复性危机的数理统计] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.23782104 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).