What does Survival Analysis for Livestream Retention conclude, in numbers, about “Closing the Loop: a Hazard Review after Every Show and a Plan to Falsify”?

Answer: Chapter 8 gives the post-show review, the Swipe-Spike Hook Scheduler and a pre-registered test plan with an expected hazard ratio of 0.718. Marked boxes separate published evidence, runnable Python calculations (18 programs), classical sources and the author's hypotheses.

Scope of the numbers: Its rooms, audiences, hazard parameters, hook effects and run sheets are illustrative; all calculations are generated by its programs; the book is not individual business advice. Marked boxes separate published evidence, runnable Python calculations (18 programs), classical sources and the author's hypotheses.

中文版

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: 0.718

room R (p41): switch windows 311 exits / 45089 viewer-s, rest 781 / 1081624
mean window multiplier: arm S 0.700arm U 0.975HR 0.718
HRpowerevents | streams, both arms: ICC 00.0050.02
0.900.82829 |102466
0.900.93787 |133288
0.800.8631 |3615
0.800.9845 |3720
0.720.8291 |137
0.720.9390 |2410
0.600.8121 |113
0.600.9162 |124
Show the full program
# Chapter 8. p82: how many streams does the pre-registered test need?
# Contrast: settled-viewer exits inside the five switch windows, under
# the scheduled hooks (arm S) versus hooks every 20 minutes at a random
# phase (arm U). Expected hazard ratio from the hook model: arm S covers
# 3 of 5 windows at rho = 0.5; arm U covers a window only when a hook
# happens to run through it. Events needed (Schoenfeld 1983, equal
# arms): d = 4 (z_a + z_b)^2 / (ln HR)^2. Streams, not viewers, are
# randomised, so d is inflated by the design effect 1 + (m - 1) ICC,
# m = switch-window exits per stream (311 in room R, from p41).
import math
import statistics

SWITCH = [180, 900, 1260, 1980, 2700]   # 环节切换秒数(示意)
SPIKE_LEN, W, RHO = 30, 60, 0.5
M = 311                                  # 每场切换窗口退出数(p41)
COUNTS = (311, 45089, 781, 1081624)      # p41 两档的离开数与人秒
nd = statistics.NormalDist()


def covered(starts, s):
    # 钩子窗口与切换窗口重叠的秒数占比
    sec = [t for t in range(s, s + SPIKE_LEN)
           if any(a <= t < a + W for a in starts)]
    return len(sec) / SPIKE_LEN


def mult(starts):
    return math.fsum(1.0 - RHO * covered(starts, s)
                     for s in SWITCH) / len(SWITCH)


arm_s = mult([870, 1230, 1950])
arm_u = math.fsum(mult([ph, ph + 1200, ph + 2400])
                  for ph in range(0, 1200)) / 1200.0
hr = arm_s / arm_u
print("room R (p41): switch windows %d exits / %d viewer-s, rest %d / %d"
      % COUNTS)
print("mean window multiplier: arm S %.3f  arm U %.3f  HR %.3f"
      % (arm_s, arm_u, hr))


def events(h, power, alpha=0.05):
    za = nd.inv_cdf(1 - alpha / 2)
    zb = nd.inv_cdf(power)
    return 4.0 * (za + zb) ** 2 / math.log(h) ** 2


print("  HR   power  events | streams, both arms: ICC 0  0.005  0.02")
for h in (0.9, 0.8, round(hr, 2), 0.6):
    for pw in (0.8, 0.9):
        d = events(h, pw)
        row = [math.ceil(d * (1 + (M - 1) * icc) / M)
               for icc in (0.0, 0.005, 0.02)]
        print("%5.2f  %5.1f  %6d |  %24d  %5d  %4d"
              % (h, pw, math.ceil(d), row[0], row[1], row[2]))

Single source and citation

Fan, Y. (2026). Kaplan-Meier Retention Curves for Livestream Rooms: Locating Swipe-Away Hazard Spikes and Timing the Insertion of Hooks (Version 1.0.0), Chapter 8: Closing the Loop: a Hazard Review after Every Show and a Plan to Falsify. 5D Library. DOI pending

DOI pending · monograph page goes live after publication · 5DL-B-277 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026277,
  author    = {Fan, Yafu},
  title     = {Kaplan-Meier Retention Curves for Livestream Rooms: Locating Swipe-Away Hazard Spikes and Timing the Insertion of Hooks},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

Other chapter answers in this book