5D Library › 双过程睡眠架构、慢波胶质淋巴清除与体温节律相位控制 · English

第八章 四步核查与一项预注册试验

改变任何东西之前的四个问题

本章把全书变成四个问题。它们不是治疗。持续的失眠——每周至少三晚入睡或维持睡眠困难、持续三个月或更久——是一种医学状况,欧洲与美国的指南都把失眠的认知行为疗法(CBT-I)列为推荐的一线治疗 (Riemann et al. 2017; Qaseem et al. 2016)。鼾声很响、呼吸暂停、夜里憋醒,或困倦到影响驾驶与工作,需要看医生,而不是看追踪器。

一、这是测量的问题,还是睡眠的问题? 在依据追踪器的数字行动之前,把它们与一周平均下来白天的实际感受与功能比较。第六章说明,验证研究无法证明一台设备优于它的人工判读者,而分数逐晚的变化比分数本身更嘈杂。

二、单独一晚能告诉我什么? 关于深睡眠或 REM,几乎什么都不能。第三章(p06)说明,一个生理从不改变的睡眠者,中间 90% 的夜晚深睡眠从 24.0 到 131.0 分钟不等,检测真实的 10 分钟变化需要几个月。看每周平均,忽略单独的夜晚。

三、就寝时咖啡因是否仍在掩盖压力? 第一章说明,咖啡因改变的是感到多少睡眠压力,而不是压力有多少;熄灯时还剩多少,既取决于最后一杯的时间,也同样取决于半衰期。人与人之间半衰期相差数倍,怀孕与一些药物会使它延长 (Nehlig 2018)。本书不给任何剂量;怀孕、有心脏疾病或正在服用与咖啡因相互作用药物的人,应先问医生或药师。

四、温度阀门打开了吗? 第五章说明,夜里核心主要通过温暖的手脚降温;睡前加热只有在熄灯前早早结束,才能让傍晚的下降更陡。这是关于时机的问题,与任何产品无关。

一项预注册试验:看到分数会让睡眠变差吗?

第六章以一个可以低成本检验的假说结束:对于会查看每晚睡眠分数的人,把分数隐藏起来能改善失眠症状。下面的试验在任何数据出现之前写成。

假说 · 尚未验证

研究方案。 每晚佩戴消费级睡眠追踪器、并自述会查看其睡眠分数的成年人;排除:已确诊的睡眠障碍、轮班工作、怀孕、正在接受失眠治疗者。每位参与者以随机顺序度过三周分数可见与三周分数隐藏(设备照常记录;应用设置为隐藏分数),中间相隔一周洗脱期。主要结局:每期结束时的失眠严重程度指数(ISI,0-28)(Bastien et al. 2001)。主要估计量:个体内差值的均值,可见减隐藏;为正表示分数可见时更差。最小关注效应:ISI 1.5 分。次要结局(报告,但从不改变判定):设备记录的总睡眠时间与入睡潜伏期、日间嗜睡。安全:任何人的 ISI 达到临床范围,无论处于哪一期,都会被建议就医并获转介 CBT-I。由独立于作者企业的研究人员实施与分析;不涉及、也不背书任何产品。

推导

# Chapter 8. Sample size for the pre-registered crossover: each participant
# spends three weeks with the nightly sleep score VISIBLE and three weeks with
# it HIDDEN (the device still records), in random order, one week apart.
# Primary outcome: Insomnia Severity Index (ISI, 0-28) at the end of each
# period. Primary estimate: mean of (visible - hidden); POSITIVE means worse
# with the score visible. Smallest effect of interest 1.5 ISI points; assumed
# sd of the within-person difference 4.0; two-sided alpha 0.05, power 0.90; 20
# % dropout. The formula is checked by simulating the trial.
import math
import random

def z(p):
    lo, hi = -10.0, 10.0
    for _ in range(100):
        mid = 0.5 * (lo + hi)
        if 0.5 * (1 + math.erf(mid / math.sqrt(2))) < p:
            lo = mid
        else:
            hi = mid
    return 0.5 * (lo + hi)

def t_crit(df):
    # two-sided 0.05 critical value of Student's t by numerical integration of
    # the density
    def dens(x):
        return (
            math.exp(math.lgamma((df + 1) / 2) - math.lgamma(df / 2))
            / math.sqrt(df * math.pi)
            * (1 + x * x / df) ** (-(df + 1) / 2)
        )
    lo, hi = 0.0, 10.0
    for _ in range(60):
        mid = 0.5 * (lo + hi)
        n, h = 2000, mid / 2000
        area = sum(dens((i + 0.5) * h) for i in range(n)) * h
        if 0.5 + area < 0.975:
            lo = mid
        else:
            hi = mid
    return 0.5 * (lo + hi)

if __name__ == "__main__":
    sesoi, sd = 1.5, 4.0
    n = math.ceil((z(0.975) + z(0.90)) ** 2 * sd ** 2 / sesoi ** 2)
    print("Completers needed (normal approximation): {}".format(n))
    print("Recruit, allowing 20 % dropout: {}".format(math.ceil(n / 0.8)))
    rng = random.Random(57015)
    tc = t_crit(n - 1)
    hits = 0
    for _ in range(4000):
        d = [rng.gauss(sesoi, sd) for _ in range(n)]
        m = sum(d) / n
        s = math.sqrt(sum((x - m) ** 2 for x in d) / (n - 1))
        hits += abs(m / (s / math.sqrt(n))) > tc
    print(
        "Simulated power with {} completers and a true effect of 1.5: {:.3f}"
        .format(n, hits / 4000)
    )
# Completers needed (normal approximation): 75
# Recruit, allowing 20 % dropout: 94
# Simulated power with 75 completers and a true effect of 1.5: 0.900

假设个体内差值的标准差为 4.0,试验需要 75 名完成者,才能在最小关注效应处达到 90% 的把握度;对试验的模拟证实了这个公式(把握度 0.900)。考虑 20% 的脱落,招募 94 人。

推导

# Chapter 8. Decision rule for the score-visible vs score-hidden crossover,
# fixed before the data are examined. D = mean ISI difference (visible -
# hidden) with its 95 % confidence interval; POSITIVE D means the visible
# score made insomnia symptoms worse. SESOI 1.5 ISI points. Gates, checked
# first: fewer than 90 % of the 75 planned completers; adherence (fewer than
# 80 % of nights with the score truly hidden in the hidden period, from the
# app log); a period-by-treatment interaction (carry-over) with p < 0.10, in
# which case only the first period is analysed and the verdict says so.
SESOI = 1.5

def verdict(d, lo, hi, n=75, n_planned=75, adherence=0.95, carryover_p=0.5):
    if n < 0.9 * n_planned:
        return (
            "D = {:+.2f}: NOT INTERPRETABLE - only {} of {} planned"
            " completers".format(d, n, n_planned)
        )
    if adherence < 0.80:
        return (
            "D = {:+.2f}: NOT INTERPRETABLE - the score was really hidden"
            "\n    on only {:.0%} of hidden-period nights".format(
                d, adherence
            )
        )
    if lo >= SESOI:
        v = "seeing the score worsens symptoms\n    by at least the SESOI"
    elif lo > 0:
        v = (
            "seeing the score worsens symptoms,\n    not shown to reach the"
            " SESOI"
        )
    elif hi < 0:
        v = "seeing the score IMPROVES symptoms"
    elif lo >= -SESOI and hi <= SESOI:
        v = "no difference worth acting on"
    else:
        v = "unclear: the interval is too wide to decide"
    out = "D = {:+.2f} ({:+.2f} to {:+.2f}): {}".format(d, lo, hi, v)
    if carryover_p < 0.10:
        out += (
            "\n    qualifier: carry-over detected; first-period comparison"
            " only,\n      lower power"
        )
    return out

if __name__ == "__main__":
    for c in (
        (2.4, 1.6, 3.2),
        (1.1, 0.2, 2.0),
        (0.2, -0.7, 1.1),
        (-1.3, -2.2, -0.4),
        (0.6, -1.8, 3.0),
        (2.4, 1.6, 3.2, 75, 75, 0.95, 0.04),
        (2.4, 1.6, 3.2, 60),
        (2.4, 1.6, 3.2, 75, 75, 0.71),
    ):
        print(verdict(*c))
    print(
        "\nSecondary outcomes (device total sleep time, sleep-onset latency,"
        " daytime"
    )
    print(
        "sleepiness) are reported with intervals and never change the"
        " verdict."
    )
    print(
        "The example numbers above are invented, to show what each branch"
        " prints."
    )
# D = +2.40 (+1.60 to +3.20): seeing the score worsens symptoms
#     by at least the SESOI
# D = +1.10 (+0.20 to +2.00): seeing the score worsens symptoms,
#     not shown to reach the SESOI
# D = +0.20 (-0.70 to +1.10): no difference worth acting on
# D = -1.30 (-2.20 to -0.40): seeing the score IMPROVES symptoms
# D = +0.60 (-1.80 to +3.00): unclear: the interval is too wide to decide
# D = +2.40 (+1.60 to +3.20): seeing the score worsens symptoms
#     by at least the SESOI
#     qualifier: carry-over detected; first-period comparison only,
#       lower power
# D = +2.40: NOT INTERPRETABLE - only 60 of 75 planned completers
# D = +2.40: NOT INTERPRETABLE - the score was really hidden
#     on only 71% of hidden-period nights
#
# Secondary outcomes (device total sleep time, sleep-onset latency, daytime
# sleepiness) are reported with intervals and never change the verdict.
# The example numbers above are invented, to show what each branch prints.

判定规则对每个分支打印一行。两道闸门使结果不可解释,而不是否定:完成者太少;以及「隐藏」期中分数真正被隐藏的夜晚不足 80%——这一点从应用日志读取,而不是依靠自述。若两期之间存在延续效应,分析只限于第一期,并如实说明。相反方向的结果——分数可见反而改善症状——是一个可能且有信息量的结局,规则为它命名。

注

正面结果意味着什么、不意味着什么。 它意味着,对已经在查看分数的人,隐藏分数在三周内减轻了失眠症状。它不意味着追踪器普遍有害,不意味着分数不准确,也不意味着不看分数的人能从任何东西中获益。零结果并不证明追踪器无害;它只说明在这一规模下没有发现这一特定效应。

小结

四个问题概括了全书:问题出在测量还是睡眠,单独一晚能说明什么,就寝时咖啡因是否仍在掩盖压力,温度阀门是否及时打开。持续失眠与可能的睡眠呼吸暂停需要看医生,CBT-I 是失眠的推荐一线治疗。书中的一个假说可以低成本、前瞻地检验:分数可见与分数隐藏的随机交叉试验,需要 75 名完成者,判定规则事先写好。

参考文献

Bastien, Célyne H., Annie Vallières, and Charles M. Morin. 2001. “Validation of the Insomnia Severity Index as an Outcome Measure for Insomnia Research.” Sleep Medicine 2 (4): 297–307.
Nehlig, Astrid. 2018. “Interindividual Differences in Caffeine Metabolism and Factors Driving Caffeine Consumption.” Pharmacological Reviews 70 (2): 384–411.
Qaseem, Amir, Devan Kansagara, et al. 2016. “Management of Chronic Insomnia Disorder in Adults: A Clinical Practice Guideline from the American College of Physicians.” Annals of Internal Medicine 165 (2): 125–33.
Riemann, Dieter, Chiara Baglioni, et al. 2017. “European Guideline for the Diagnosis and Treatment of Insomnia.” Journal of Sleep Research 26 (6): 675–700.

Fan, Y. (2026). Two-Process Sleep Architecture, Slow-Wave Glymphatic Clearance and Thermoregulatory Phase Control: Adenosine Homeostasis, Flip-Flop Switch Bistability, Core-Distal Heat Flux and Sleep-Stage Markov Chains [双过程睡眠架构、慢波胶质淋巴清除与体温节律相位控制] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090162 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).