关于「实践与预注册试验」,《演化博弈与互惠合作》给出的定量结论是什么?
结论:按社群平均值的标准差 0.15(比上面的示意模型略保守)、最小关注差异 0.10(对照组 0.40,A 组 0.50)、双侧 \(\alpha = 0.05\)、把握度 90% 计算,每组需要 48 个可分析的社群(正态近似;若按 t 分布校正,约多需 1 个);考虑约 10% 的社群因有人中途退出而不完整,每组招募 54 个社群,即每组 648 人,共 1,296 人。若标准差为 0.18,每组需要 69 个社群;若最小关注差异为 0.08,需要 74 个。这些参数都是假设值,正式实施前应当用预试验的数据核对。
数据口径:本书讨论演化博弈的数学模型,不作道德说教,也不是经营建议。 书中以标注框区分已发表的证据、可运行的 Python 计算(15 段程序,全部核对)、原典与作者的假说。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 0.05, 0.08, 0.10, 0.15, 0.18, 0.40
communities per arm (alpha 0.05 two-sided, 90 % power)
SD of community means delta 0.08 delta 0.10 delta 0.12
0.12 48 31 22
0.15 74 48 33
0.18 107 69 48
model: SD of community means 0.138; SD of individual rates 0.291; ICC 0.15
design effect if analysed per person: 1 + (m - 1) ICC = 2.70
chosen: SD 0.15, delta 0.10 (control 0.40 -> 0.50): 48 communities per arm analysable;
allowing 10 % incomplete communities, recruit 54 per arm =
648 people per arm, 1296 in all
true effect 0.10: some benefit shown 0.905; 'at least 0.10' shown 0.027
true effect 0.15: some benefit shown 1.000; 'at least 0.10' shown 0.383
true effect 0.20: some benefit shown 1.000; 'at least 0.10' shown 0.902查看完整验算程序
# Sample size for the Chapter 8 cluster-randomised trial. Unit of randomisation: an
# online COMMUNITY of 12 people who play 30 rounds of a public goods game in re-matched
# groups of 3. Primary outcome, one number per community: the share of "contribute"
# decisions in rounds 21-30. The analysis is at community level, so the sample size
# needs the SD of community means (sigma_g), which depends on the intra-cluster
# correlation (ICC) of individual rates. All parameter values are assumptions, to be
# checked against pilot data.
# Arm A labels: one fixed rule, simple standing with strict justification (see p15).
import math, random
from statistics import NormalDist, mean, pstdev
rng = random.Random(14)
z = NormalDist().inv_cdf
ALPHA, POWER, M = 0.05, 0.90, 12
def n_per_arm(sd, delta):
return math.ceil(2 * (z(1 - ALPHA / 2) + z(POWER)) ** 2 * sd ** 2 / delta ** 2)
print("communities per arm (alpha 0.05 two-sided, 90 % power)")
print(" SD of community means delta 0.08 delta 0.10 delta 0.12")
for sd in (0.12, 0.15, 0.18):
print(f" {sd:.2f} " + " ".join(
f"{n_per_arm(sd, d):3d}" for d in (0.08, 0.10, 0.12)))
# A generative model for individuals: person j in community g contributes in each of the
# 10 scored rounds with probability p = base + u_g + e_j (clipped to 0..1), where
# u_g ~ N(0, 0.13^2) is shared by the community and e_j ~ N(0, 0.25^2) is personal.
def community(base, tau=0.13, s_e=0.25):
u = rng.gauss(0, tau); rates = []
for _ in range(M):
p = min(1.0, max(0.0, base + u + rng.gauss(0, s_e)))
rates.append(sum(rng.random() < p for _ in range(10)) / 10)
return rates
cs = [community(0.40) for _ in range(3000)]
means = [mean(c) for c in cs]
sd_g = pstdev(means)
within = mean(pstdev(c) ** 2 * M / (M - 1) for c in cs)
icc = (sd_g ** 2 - within / M) / (sd_g ** 2 - within / M + within)
print(f"model: SD of community means {sd_g:.3f}; SD of individual rates"
f" {math.sqrt(within + sd_g ** 2 - within / M):.3f}; ICC {icc:.2f}")
print(f" design effect if analysed per person: 1 + (m - 1) ICC ="
f" {1 + (M - 1) * icc:.2f}")
SD, DELTA = 0.15, 0.10
n = n_per_arm(SD, DELTA); rec = math.ceil(n / 0.9)
print(f"chosen: SD 0.15, delta 0.10 (control 0.40 -> 0.50): {n} communities per arm"
f" analysable;")
print(f" allowing 10 % incomplete communities, recruit {rec} per arm =\n "
f" {rec * M} people per arm, {2 * rec * M} in all")
# What the decision rule (p15) will say if the true effect equals the smallest effect of
# interest (0.10): 95 % CI of the difference from a two-sample t-type interval.
def trial(true_delta, n):
a = [rng.gauss(0.40, SD) for _ in range(n)]; b = [rng.gauss(0.40 + true_delta, SD)
for _ in range(n)]
d = mean(b) - mean(a)
se = math.sqrt((pstdev(a) ** 2 + pstdev(b) ** 2) * n / (n - 1) / n)
return d - 1.96 * se, d + 1.96 * se
for td in (0.10, 0.15, 0.20):
res = [trial(td, n) for _ in range(4000)]
benefit = sum(lo > 0 for lo, hi in res) / 4000
strong = sum(lo >= 0.10 for lo, hi in res) / 4000
print(f"true effect {td:.2f}: some benefit shown {benefit:.3f};"
f" 'at least 0.10' shown {strong:.3f}")唯一数据源与引用
范雅福(Fan, Y.). (2026). 《演化博弈、直接与间接互惠及合作涌现的数学模型》第 8 章「实践与预注册试验」(版本 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.23788551
DOI: 10.5281/zenodo.23788551 · 阅读本章所在专著 · 5DL-B-035 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026035,
author = {Fan, Yafu},
title = {Evolutionary Game Theory, Direct and Indirect Reciprocity and the Emergence of Cooperation},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
doi = {10.5281/zenodo.23788551},
url = {https://doi.org/10.5281/zenodo.23788551}
}