关于「实践与预注册检验」,《计算美学与界面认知工程》给出的定量结论是什么?

结论:第八章给出显著性、可读性、选择与指向、证据四步核查表,以及一项由独立研究人员实施的预注册在线随机对照试验方案(唯一主要结局为找到并正确点击目标的对数完成时间,最小关注效应为几何平均时间缩短 10%,90% 把握度下每组 158 名可分析、招募 190 名,判定规则写成代码)。书中以标注框区分已发表的证据、可运行的 Python 计算(16 段程序)、原典与作者的模型和假说;书中所有页面、品牌与数据都是虚构或模拟的。

数据口径:书中以标注框区分已发表的证据、可运行的 Python 计算(16 段程序)、原典与作者的模型和假说;书中所有页面、品牌与数据都是虚构或模拟的。

English version

对照数据表

下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 10, 158, 190, 90

assumed sd of the outcome 0.333; implied practice correlation 0.58 (planning value 0.5)
normal approximation, 90 % power, two-sided alpha 0.05, delta = ln 0.90 = -0.1054:
   t-test 210 per arm; ANCOVA (rho 0.5) 158 per arm
simulation check (300 trials of 158 per arm, lognormal tasks, 60 s cap):
   power 0.930; mean estimate -0.1055
allowing 15 % exclusion/attrition: recruit 190 per arm, 380 in total
sensitivity (per arm, ANCOVA):        SESOI  5 %    10 %    15 %
   planning values                      664     158      67
   sd 30 % higher                     1,123     266     112
   no usable covariate                  886     210      89

核心公式

\[n = \frac{2\,(z_{0.975} + z_{0.90})^2\,\sigma^2\,(1-\rho^2)}{\delta^2},\]
查看完整验算程序
# Sample size for the Chapter 8 pre-registered online trial. Two parallel arms, 1:1:
# X = layouts revised by the checklist (salience, contrast, Fitts distance), Y = control
# layouts; 12 find-and-click tasks on fictional shop pages. Single primary outcome: each
# participant's mean of ln(time to the correct click, s), a task not completed within
# 60 s counted as 60 s; analysed by ANCOVA on the mean ln time of 2 neutral practice
# tasks done before the layouts differ. SESOI: 10 % shorter geometric-mean time,
# delta = ln 0.90. PLANNING ASSUMPTIONS (not estimates from data): between-person sd of
# ln time 0.30, within-person task sd 0.50, practice-outcome correlation 0.5.
import math, random, statistics

Z = statistics.NormalDist().inv_cdf
DELTA, SB, SW, RHO, K = math.log(0.90), 0.30, 0.50, 0.5, 12
MU = math.log(8.0)                                 # control geometric mean 8 s per task

def n_arm(delta, sd, rho, power=0.90, alpha=0.05):
    return math.ceil(2 * (Z(1 - alpha / 2) + Z(power)) ** 2 * sd ** 2 * (1 - rho ** 2)
                     / delta ** 2)

def participant(rng, arm):
    b = rng.gauss(0, SB)                           # person effect
    pr = statistics.fmean(MU + b + rng.gauss(0, SW) for _ in range(2))
    shift = DELTA if arm else 0.0
    y = statistics.fmean(min(MU + b + shift + rng.gauss(0, SW), math.log(60.0))
                         for _ in range(K))
    return pr, y

def ancova_t(rows):
    x = [r[1] for r in rows]; g = [r[0] for r in rows]; y = [r[2] for r in rows]
    n = len(y); mx, mg, my = statistics.fmean(x), statistics.fmean(g), statistics.fmean(y)
    sxx = sum((a - mx) ** 2 for a in x); sgg = sum((a - mg) ** 2 for a in g)
    sxg = sum((a - mx) * (b - mg) for a, b in zip(x, g))
    sxy = sum((a - mx) * (c - my) for a, c in zip(x, y))
    sgy = sum((b - mg) * (c - my) for b, c in zip(g, y))
    det = sxx * sgg - sxg ** 2
    bx = (sgg * sxy - sxg * sgy) / det; bg = (sxx * sgy - sxg * sxy) / det
    res = [c - my - bx * (a - mx) - bg * (b - mg) for a, b, c in zip(x, g, y)]
    s2 = sum(r * r for r in res) / (n - 3)
    return bg, math.sqrt(s2 * sxx / det)

if __name__ == "__main__":
    sd = math.sqrt(SB ** 2 + SW ** 2 / K)
    r_pr = SB ** 2 / math.sqrt((SB ** 2 + SW ** 2 / 2) * (SB ** 2 + SW ** 2 / K))
    print(f"assumed sd of the outcome {sd:.3f}; implied practice correlation {r_pr:.2f}"
          f" (planning value {RHO})")
    n0 = n_arm(DELTA, sd, 0.0); n1 = n_arm(DELTA, sd, RHO)
    print(f"normal approximation, 90 % power, two-sided alpha 0.05, delta = ln 0.90"
          f" = {DELTA:.4f}:\n   t-test {n0} per arm; ANCOVA (rho {RHO}) {n1} per arm")
    rng = random.Random(46); hits = 0; sims = 300; est = []
    for _ in range(sims):
        rows = [(arm,) + participant(rng, arm) for arm in (0, 1) for _ in range(n1)]
        b, se = ancova_t(rows); est.append(b)
        hits += b + 1.96 * se < 0                  # CI excludes 0 on the faster side
    print(f"simulation check ({sims} trials of {n1} per arm, lognormal tasks, 60 s cap):"
          f"\n   power {hits / sims:.3f}; mean estimate {statistics.fmean(est):+.4f}")
    rec = math.ceil(n1 / 0.85 / 10) * 10
    print(f"allowing 15 % exclusion/attrition: recruit {rec} per arm, {2 * rec} in total")
    print("sensitivity (per arm, ANCOVA):        SESOI  5 %    10 %    15 %")
    for lab, s_, r_ in (("planning values", sd, RHO), ("sd 30 % higher", 1.3 * sd, RHO),
                        ("no usable covariate", sd, 0.0)):
        row = [n_arm(math.log(1 - e), s_, r_) for e in (0.05, 0.10, 0.15)]
        print(f"   {lab:32s}" + "".join(f"{v:8,d}" for v in row))

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《计算美学、视觉显著性图谱与人机界面认知工程》第 8 章「实践与预注册检验」(版本 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.23836258

DOI: 10.5281/zenodo.23836258 · 阅读本章所在专著 · 5DL-B-046 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026046,
  author    = {Fan, Yafu},
  title     = {Computational Aesthetics, Visual Saliency Maps and Cognitive Ergonomics in User Interface Design},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  doi       = {10.5281/zenodo.23836258},
  url       = {https://doi.org/10.5281/zenodo.23836258}
}

本书其他章节结论