What does Jing-Well Press Needles and Post-Stroke Cognition conclude, in numbers, about “Practice and a Pre-registered Test”?

Answer: Chapter 8 gives a four-step checklist and a pre-registered three-arm trial: single primary comparison genuine against sham press needles (both rubbed three times a day), single primary outcome the MoCA at week 4 by analysis of covariance, smallest effect of interest 1.5 points, 72 analysable and 85 randomised per group, 255 in all, frontal alpha only as a pre-specified mediation analysis, and a decision rule written as code. Marked boxes separate published evidence, runnable Python calculations (16 programs), classical sources and the author's models and hypotheses; apart from cited literature data, all data in the book are synthetic.

Scope of the numbers: Marked boxes separate published evidence, runnable Python calculations (16 programs), classical sources and the author's models and hypotheses; apart from cited literature data, all data in the book are synthetic.

中文版

Data table

The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 1.5, 255, 72, 85

normal theory: n64.005 -> 65 per arm (residual SD 2.60)
simulated power, n65/arm: 0.894 (s.e. 0.007); treated arm at 30: 14%
simulated power, n68/arm: 0.898 (s.e. 0.007); treated arm at 30: 14%
simulated power, n72/arm: 0.919 (s.e. 0.006); treated arm at 30: 14%
simulated power, n76/arm: 0.930 (s.e. 0.006); treated arm at 30: 14%
smallest n with power - 2 s.e. >0.90: 72; type I error there 0.057
planned72 analysable per arm; 15 % loss -> 85 randomised per arm,
255 in three arms (11:1)
sensitivity, analysable per arm (normal theory):
SESOI \ rho0.3 0.5 0.7
1.0 points174 143 98
1.5 points78 65 44
2.0 points44 37 26
Show the full program
# Chapter 8. Sample size, genuine vs sham press needles (both pressed 3 times a day).
# Primary outcome: MoCA at week 4 by ANCOVA (baseline, centre). Planning assumptions:
# SD 3.0, baseline-outcome correlation 0.5, SESOI 1.5 points, two-sided 0.05, power 90 %.
# n per arm = 2 (z_0.975 + z_0.90)^2 s^2 (1 - r^2) / d^2 + z_0.975^2 / 4, then checked by
# simulation with integer scores, the 18-25 inclusion window and the ceiling at 30.
import math, random, statistics

Z = statistics.NormalDist().inv_cdf
SD, RHO, D = 3.0, 0.5, 1.5

def n_formula(sd=SD, rho=RHO, d=D, power=0.90):
    za, zb = Z(0.975), Z(power)
    return 2 * (za + zb) ** 2 * sd ** 2 * (1 - rho ** 2) / d ** 2 + za ** 2 / 4

def one_trial(rng, n, delta, mean_post=25.0):
    rows = []
    for arm in (1, 0):
        for _ in range(n):
            while True:
                b = rng.gauss(21.5, 3.0); bo = round(b)
                if 18 <= bo <= 25:
                    break
            e = rng.gauss(0, SD * math.sqrt(1 - RHO ** 2))
            y = mean_post + delta * arm + RHO * (b - 21.5) + e
            rows.append((arm, bo, min(30, round(y))))
    n2 = len(rows); mx = math.fsum(r[1] for r in rows) / n2
    # ANCOVA via residualising on baseline within the pooled sample
    X = [(1.0, r[0], r[1] - mx) for r in rows]; Y = [r[2] for r in rows]
    S = [[math.fsum(x[i] * x[j] for x in X) for j in range(3)] for i in range(3)]
    v = [math.fsum(x[i] * y for x, y in zip(X, Y)) for i in range(3)]
    inv = invert3(S)
    beta = [math.fsum(inv[i][j] * v[j] for j in range(3)) for i in range(3)]
    res = [y - math.fsum(bb * xx for bb, xx in zip(beta, x)) for x, y in zip(X, Y)]
    s2 = math.fsum(r * r for r in res) / (n2 - 3)
    z, df = Z(0.975), n2 - 3
    tcrit = z + (z ** 3 + z) / (4 * df)                 # t quantile, Cornish-Fisher
    return abs(beta[1] / math.sqrt(s2 * inv[1][1])) > tcrit, \
        sum(1 for r in rows if r[0] == 1 and r[2] == 30) / n

def invert3(S):
    a, b, c = S[0]; d, e, f = S[1]; g, h, i = S[2]
    det = a * (e * i - f * h) - b * (d * i - f * g) + c * (d * h - e * g)
    return [[(e * i - f * h) / det, (c * h - b * i) / det, (b * f - c * e) / det],
            [(f * g - d * i) / det, (a * i - c * g) / det, (c * d - a * f) / det],
            [(d * h - e * g) / det, (b * g - a * h) / det, (a * e - b * d) / det]]

if __name__ == "__main__":
    n0 = n_formula()
    print(f"normal theory: n = {n0:.3f} -> {math.ceil(n0)} per arm"
          f" (residual SD {SD * math.sqrt(1 - RHO ** 2):.2f})")
    rng = random.Random(2026); chosen = None
    for n in (math.ceil(n0), 68, 72, 76):
        res = [one_trial(rng, n, D) for _ in range(2000)]
        pw = sum(r[0] for r in res) / len(res); se = math.sqrt(pw * (1 - pw) / 2000)
        top = math.fsum(r[1] for r in res) / len(res)
        print(f"   simulated power, n = {n}/arm: {pw:.3f} (s.e. {se:.3f});"
              f" treated arm at 30: {top:.0%}")
        if chosen is None and pw - 2 * se >= 0.90:
            chosen = n
    t1 = sum(one_trial(rng, chosen, 0.0)[0] for _ in range(2000)) / 2000
    print(f"   smallest n with power - 2 s.e. >= 0.90: {chosen}; type I error there"
          f" {t1:.3f}")
    plan = math.ceil(chosen / 0.85)
    print(f"planned: {chosen} analysable per arm; 15 % loss -> {plan} randomised"
          f" per arm,\n   {3 * plan} in three arms (1:1:1)")
    print("sensitivity, analysable per arm (normal theory):")
    print("   SESOI \\ rho        0.3    0.5    0.7")
    for d in (1.0, 1.5, 2.0):
        print(f"   {d:4.1f} points    " + "".join(
            f"{math.ceil(n_formula(rho=r, d=d)):7d}" for r in (0.3, 0.5, 0.7)))

Single source and citation

Fan, Y. (2026). Finger–Brain Cortical Magnification, Distal Microneedle Afference and Computational Neurology of Post-Stroke Cognitive Network Reconstruction (Version 1.0.0), Chapter 8: Practice and a Pre-registered Test. 5D Library. https://doi.org/10.5281/zenodo.23839915

DOI: 10.5281/zenodo.23839915 · Read the monograph · 5DL-B-052 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026052,
  author    = {Fan, Yafu},
  title     = {Finger–Brain Cortical Magnification, Distal Microneedle Afference and Computational Neurology of Post-Stroke Cognitive Network Reconstruction},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  doi       = {10.5281/zenodo.23839915},
  url       = {https://doi.org/10.5281/zenodo.23839915}
}

Other chapter answers in this book