Bio Clinical Biostatistics Power Sample Size 标志

Bio Clinical Biostatistics Power Sample Size

组织
PKU-YuanGroup
bio-clinical-biostatistics-power-sample-size

计算临床试验的样本量和检验效能,适用于连续、二元和生存时间终点,以及优效性、非劣效性和等效性设计;涵盖 FDA 2016 年非劣效界值选择的 M1/M2 框架、用于生存分析的 Schoenfeld 1981 和 Lakatos 1988、Schuirmann TOST 和 80-125% 生物等效性,以及最小临床重要差异(MCID)与 δ 的区别。适用于根据 CONSORT 2025 第 16a 项,在方案或 SAP 中论证试验样本量。

Add to TypingMind

概览

发布者PKU-YuanGroup
代码仓库OpenAI4S
技能名称bio-clinical-biostatistics-power-sample-size
星标数
622
复刻数
72
附带文件
2
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 2 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 PKU-YuanGroup 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Bio Clinical Biostatistics Power Sample Size AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/PKU-YuanGroup/OpenAI4S/tree/main/skills/bioskills/bio-clinical-biostatistics-power-and-sample-size
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/PKU-YuanGroup/OpenAI4S.git /tmp/OpenAI4S
mkdir -p .claude/skills
cp -r /tmp/OpenAI4S/skills/bioskills/bio-clinical-biostatistics-power-and-sample-size .claude/skills/bio-clinical-biostatistics-power-sample-size
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Bio Clinical Biostatistics Power Sample Size,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Bio Clinical Biostatistics Power Sample Size。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Bio Clinical Biostatistics Power Sample Size 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Version Compatibility

Reference examples tested with: statsmodels 0.14+, scipy 1.12+, numpy 1.26+, pandas 2.1+. R packages cited: pwr, gsDesign (Anderson/Merck), gsDesign2, rpact (Wassmer/Brannath), presize, npsurvSS, nph, simtrial.

Before using code patterns, verify installed versions match. If versions differ:

  • Python: pip show <package> then help(module.function) to check signatures
  • R: packageVersion('<pkg>') then ?function_name

If code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.

Power and Sample Size for Clinical Trials

"Justify the trial's sample size" -> Compute the n needed to detect a pre-specified alternative δ with power 1-β at significance α, accounting for endpoint distribution, design (superiority/NI/equivalence), expected dropout, multiplicity, and stratification — and distinguish δ (the effect the trial is powered to detect) from MCID (the clinically meaningful difference).

The Foundational Distinction -- δ vs MCID

δ (the alternative effect): what the trial is powered to detect. Usually set above the MCID because sponsors want a strong signal that exceeds noise + design uncertainty.

MCID (Minimum Clinically Important Difference): the smallest effect size considered clinically meaningful. Jaeschke-Singer-Guyatt 1989 Control Clin Trials 10:407 (anchor-based) and Norman-Sloan-Wyrwich 2003 Med Care 41:582 ("the remarkable universality of half a standard deviation") established the modern conventions.

Confusing the two has produced both:

  • Underpowered trials where sponsor sets δ = MCID and gets a CI straddling zero
  • Overgenerous NI margins where sponsor sets M2 = full MCID (NI margin should be a fraction of MCID)

Postdoc rule of thumb: for superiority, δ >= 1.5 × MCID; for NI, M2 <= 0.5 × MCID.

Algorithmic Taxonomy

DesignFormula / approachSoftwareStrengthFails when
Two-sample t-test, continuousCohen's d; n = 2 × (z_α/2 + z_β)² / d²pwr::pwr.t.test (R); statsmodels.power.tt_ind_solve_power (Py)StandardHeteroscedasticity; non-normal outcomes
Two-sample proportions (Fleiss)Asymptotic normal approximation with/without continuity correctionpower.prop.test (R) -- uncorrected; pwr::pwr.2p.test; statsmodelsStandardn < 100/arm: continuity correction debate (D'Agostino 1988)
Survival (Schoenfeld 1981)events ≈ 4(z_α/2 + z_β)² / (log HR)² for 1:1gsDesign::nSurv; npsurvSS::size_two_armStandard PH-conformantPH violated (immuno-oncology) under-estimates by 20-50%
Survival under non-PH (Lakatos 1988)Markov chain accommodating time-varying HR, accrual, dropoutgsDesign::nSurv; npsurvSS; simtrialHandles immuno-oncology delayed effectsRequires explicit specification of HR(t) and accrual
MaxCombo SS under NPHSimulation-based; pre-specify weight familynphRCT; simtrialRobust to NPH patternComputationally heavier
Non-inferiority fixed-marginn = (z_α + z_β)² × variance / M²pwr::pwr.t2n.test adapted; rpact::getSampleSizeMeansPre-discounted MConstancy assumption violation invisible
Non-inferiority synthesisPool historical control-vs-placebo + current test-vs-controlgsDesign::ssTwoArmTestMore efficient than fixed-marginConstancy assumption MUST hold exactly
Equivalence TOSTTwo one-sided tests at α eachpwr::pwr.t.test adapted; presizeNo multiplicity adjustment neededWrong question when superiority/NI is intended
Group-sequentialLan-DeMets spending functionrpact; gsDesignInterim analyses; early stoppingMore complex SAP
Sample-size re-estimation (Mehta-Pocock)Promising-zone conditional powerrpact::getSampleSizeMeans with reestimationRecovers power if interim shows promiseUnblinded SSR scares FDA
Cluster-randomisedAdjust for design effect = 1 + (m-1)ICCclusterPower; pwr adaptedStandardICC misspecification

Postdoc reading list:

  • Fleiss JL 1981 Statistical Methods for Rates and Proportions (with/without continuity correction tables)
  • Schoenfeld DA 1981 Biometrika 68:316 (canonical TTE formula)
  • Lakatos E 1988 Biometrics 44:229 (Markov chain SS for complex survival)
  • Schuirmann DJ 1987 J Pharmacokinet Biopharm 15:657 (TOST)
  • Jaeschke R, Singer J, Guyatt GH 1989 Control Clin Trials 10:407 (MCID anchor-based)
  • Norman GR, Sloan JA, Wyrwich KW 2003 Med Care 41:582 (0.5 SD heuristic)
  • Snapinn SM 2000 Curr Control Trials Cardiovasc Med 1:19 (NI biocreep)
  • Temple R, Ellenberg SS 2000 Ann Intern Med 133:455 + 133:464 (NI assay sensitivity; Ann Intern Med NOT NEJM — common citation error)
  • Hung HMJ, Wang SJ, O'Neill RT 2005 Biom J (NI within-trial Type-I not guaranteed)
  • Mehta CR, Pocock SJ 2011 Stat Med 30:3267 (promising zone)
  • Lin RS, Lin J, Roychoudhury S et al 2020 Stat Biopharm Res (NPH Working Group)

Decision Tree by Scenario

ScenarioRecommended approachWhy
Continuous outcome, two-arm parallel, superiorityFleiss / Cohen's d formula via power.t.test or statsmodelsStandard; cite Fleiss 1981
Binary outcome, n > 100/armUncorrected normal approximation via power.prop.test; statsmodels power_proportions_2indepAdequate for n > 100
Binary outcome, n < 100/armFisher exact-based simulation OR Fleiss with continuity correctionContinuity correction debate; cite D'Agostino 1988 if uncorrected
Time-to-event with PHSchoenfeld 1981 via gsDesign::nSurvStandard; pre-specify hazards
Time-to-event under expected NPH (immuno-oncology)Lakatos 1988 OR simulation via simtrial::simtrial/nphRCTSchoenfeld under-estimates by 20-50%; cite Lin 2020
Non-inferiority continuousFixed-margin with M2 = 0.5 × historical M1 (discounted)FDA 2016 NI guidance; cite Temple-Ellenberg 2000
Non-inferiority binaryFixed-margin with Miettinen-Nurminen CI for RDCite EMA NI guidance; MN-CI standard
Bioequivalence (Cmax/AUC)TOST with 80-125% margins on geometric mean ratioFDA 1992 BE guidance; Schuirmann 1987
Cluster-randomisedn × design effect = 1 + (m-1)ICCCite Murray 1998 cluster RCT methodology
Group-sequentialLan-DeMets spending functionrpact or gsDesign
Pilot for sample size re-estimationBlinded SSR (Friede-Kieser 2006)No Type-I inflation; safer than unblinded
Promising-zone reestimationMehta-Pocock 2011 with pre-specified increase ruleRecovers power; cite caveat re Jennison-Turnbull 2015 critique

Continuous Outcomes -- Two-Sample t-Test

python
from statsmodels.stats.power import tt_ind_solve_power

# Solve for n per group
n = tt_ind_solve_power(
    effect_size=0.5,  # Cohen's d = (mu1 - mu2) / sigma
    alpha=0.05,
    power=0.80,
    alternative='two-sided'
)
print(f'n per arm = {np.ceil(n):.0f}')

# Solve for power given n
power = tt_ind_solve_power(effect_size=0.5, alpha=0.05, nobs1=100, alternative='two-sided')

Cohen's d benchmarks: small = 0.2, medium = 0.5, large = 0.8. Choose d to detect based on prior literature or clinically meaningful effect, NOT post-hoc to fit the affordable n.

Inflate for dropout: if dropout rate is q, multiply final n by 1/(1-q). For q=0.20, n_total = n/0.80.

Stratified randomisation efficiency: if randomisation stratifies on prognostic factors with combined R² = r against outcome, the effective n is n/(1-r²). Senn 2013 Stat Med 32:1439 makes the precision argument explicit.

Binary Outcomes -- The Continuity Correction Debate

python
from statsmodels.stats.power import NormalIndPower
import math

# Without continuity correction
p1, p2 = 0.30, 0.20
pbar = (p1 + p2) / 2
z_alpha = 1.96  # two-sided alpha=0.05
z_beta = 0.84   # power=0.80
n = ((z_alpha * math.sqrt(2 * pbar * (1 - pbar)) +
      z_beta * math.sqrt(p1 * (1 - p1) + p2 * (1 - p2))) / (p1 - p2)) ** 2
print(f'n per arm (uncorrected) = {math.ceil(n)}')

# Continuity-corrected (Fleiss formula)
correction = (1 + math.sqrt(1 + 4 / (n * abs(p1 - p2)))) ** 2 / 4
n_corrected = math.ceil(n * correction)
print(f'n per arm (continuity corrected) = {n_corrected}')

The continuity correction debate (D'Agostino, Chase & Belanger 1988 Am Stat 42:198):

  • Pro (Fleiss, Yates): better matches the exact distribution under H0
  • Con: overly conservative, wastes ~10% sample size; modern computing makes exact (Fisher-Irwin, Boschloo) tests feasible

R's power.prop.test uses uncorrected normal approximation — can over-state power 5-10% in small samples (n<100). For confirmatory work with n<100, use simulation-based SS via simr or presize.

Survival (Time-to-Event)

Schoenfeld 1981 -- the canonical formula

python
import math

# Events needed for two-sample log-rank under PH (Schoenfeld 1981)
from scipy.stats import norm

def schoenfeld_events(hr, alpha=0.05, power=0.80, allocation_ratio=1.0, two_sided=True):
    """
    events = (z_crit + z_beta)^2 / (p*(1-p) * log(HR)^2)

    where z_crit = z_{1-alpha/2} for two-sided test OR z_{1-alpha} for one-sided.
    """
    z_crit = norm.ppf(1 - alpha/2) if two_sided else norm.ppf(1 - alpha)
    z_beta = norm.ppf(power)
    p = 1 / (1 + allocation_ratio)
    return math.ceil((z_crit + z_beta) ** 2 / (p * (1 - p) * math.log(hr) ** 2))

# For HR=0.70, alpha=0.05 two-sided, 80% power, 1:1 -> approx 247 events
events_needed = schoenfeld_events(hr=0.70)
print(f'Events needed for HR=0.70: {events_needed}')

Events drive power, not subjects. Convert to n via expected event rate and follow-up:

python
# n needed = events / overall event probability over follow-up
expected_overall_event_prob = 0.40  # from pilot or historical
n_per_arm = math.ceil(events_needed / (2 * expected_overall_event_prob))
# Inflate for dropout
n_per_arm_with_dropout = math.ceil(n_per_arm / (1 - 0.15))  # 15% dropout

Lakatos 1988 -- complex survival

Use R gsDesign::nSurv() or npsurvSS::size_two_arm() for complex scenarios with:

  • Time-varying hazard ratios (delayed effect)
  • Non-uniform accrual
  • Different dropout rates per arm
  • Cure fractions
r
library(gsDesign)
n_lakatos <- nSurv(
    lambdaC = 0.04,     # control hazard per month
    hr = 0.70,           # treatment HR
    eta = 0.005,         # dropout hazard per month
    T = 24,              # total study duration in months
    minfup = 12,         # minimum follow-up
    accrualTime = 12,    # accrual duration
    alpha = 0.025,       # one-sided
    beta = 0.10          # power = 90%
)
print(n_lakatos)

Under non-PH (immuno-oncology with delayed effect)

Schoenfeld 1981 ASSUMES PH. Under immuno-oncology with delayed separation, the formula under-estimates required events by 20-50%. The fix:

r
# Simulate under expected hazard pattern (Lin 2020 NPH Working Group recommendation)
library(simtrial)
sim_result <- simtrial(
    n_per_arm = 250,
    enroll_rate = piecewise_enroll(),
    fail_rate = piecewise_fail(  # delayed-effect specification
        duration = c(6, 18),
        fail_rate = c(0.04, 0.04),  # control
        hr = c(1.0, 0.5),            # treatment HR is 1 for first 6 months, then 0.5
        dropout_rate = c(0.005, 0.005)
    ),
    total_duration = 36
)
# Compute empirical power via MaxCombo or weighted log-rank

Non-Inferiority Designs -- The FDA 2016 Framework

FDA NI Trials Guidance (November 2016) establishes the canonical M1/M2 framework:

  • M1 = entire effect of active control vs placebo (lower bound of CI from historical meta-analysis)
  • M2 = clinically acceptable loss, typically M1/2 (50% effect retention) but as conservative as M1/4 for mortality endpoints

The "double discount" trap: M2 = 0.5 × (lower CI bound of M1) effectively requires 50% retention of a discounted historical estimate, yielding a much tighter margin than naive point-estimate retention. This has effectively halted new antibiotic NDA development under stringent NI margins.

python
# Fixed-margin NI sample size (binary endpoint)
import math

p_control = 0.85         # historical/observed control success rate
p_test = 0.85            # null assumption: test = control (NI null is test - control < -M2)
margin_M2 = 0.05         # pre-specified clinically acceptable loss
z_alpha = 1.645          # one-sided alpha=0.025
z_beta = 0.84            # power=0.80

# Approximate: n per arm
variance_term = p_control * (1 - p_control) + p_test * (1 - p_test)
n = math.ceil((z_alpha + z_beta) ** 2 * variance_term / margin_M2 ** 2)
print(f'NI sample size per arm: {n}')

Use Miettinen-Nurminen score CI for RD (the regulatory standard) when computing the NI margin from observed proportions. Cite ratesci::scoreci (R) for production.

Constancy assumption: the historical placebo-vs-active effect must persist in the NI trial. If standard of care drifted, M1 over-estimates and margin is too liberal. Hung-Wang-O'Neill 2005 Biom J critique: NI trials have NO within-trial Type-I error guarantee — alpha is conditional on constancy.

Assay sensitivity (Temple-Ellenberg 2000 Ann Intern Med 133:455 + 133:464): NI trials have only external assay sensitivity (inferred from historical data + constancy); placebo-controlled trials have internal assay sensitivity. This is why NI trials are second-best when placebo is ethical.

Equivalence Designs and Bioequivalence

TOST (Two One-Sided Tests; Schuirmann 1987): reject H0 of inequivalence iff both one-sided tests reject at α each — equivalent to the 1-2α CI lying within (-δ, +δ). Closed under intersection-union -> no multiplicity adjustment needed despite two tests.

python
# TOST sample size for continuous outcome
import math

def tost_sample_size(mu_diff, sigma, margin, alpha=0.05, power=0.80):
    """Sample size per arm for TOST equivalence test."""
    z_alpha = 1.645  # one-sided
    z_beta = 0.84
    effect = abs(margin - abs(mu_diff))
    if effect <= 0:
        raise ValueError('|mu_diff| must be < margin')
    n = math.ceil(2 * sigma ** 2 * (z_alpha + z_beta) ** 2 / effect ** 2)
    return n

n_eq = tost_sample_size(mu_diff=0.0, sigma=10, margin=5)
print(f'Equivalence sample size per arm: {n_eq}')

FDA 1992 bioequivalence (80-125% rule): geometric mean ratio of Cmax and AUC must have 90% CI within (0.80, 1.25). Implemented in PowerTOST R package for crossover BE designs.

Crossover Designs -- Bioequivalence and Repeated-Measures

Crossover trials randomise each subject to receive both treatments in different periods. Power calculation is fundamentally different from parallel: the within-subject SD (sigma_w) drives power, not between-subject SD (sigma_b). With reasonable carryover-free designs, crossover requires ~25-50% the n of parallel for the same precision.

python
# Two-period crossover sample size (continuous endpoint)
import math

def crossover_n_continuous(mean_diff, sd_within, alpha=0.05, power=0.80):
    """n per sequence (so total n = 2*n) for two-period crossover."""
    z_alpha = 1.96  # two-sided
    z_beta = 0.84   # power=0.80
    n_per_seq = math.ceil(2 * (z_alpha + z_beta)**2 * sd_within**2 / mean_diff**2)
    return n_per_seq, 2 * n_per_seq  # n_per_seq, n_total

Bioequivalence (FDA 1992 / EMA 2010 framework)

Average bioequivalence: geometric mean ratio (GMR) of test/reference Cmax and AUC must have 90% CI within (0.80, 1.25). Log-transform pharmacokinetic parameters; analyse with mixed-effects ANOVA (period, sequence, treatment, subject random).

r
library(PowerTOST)
# Sample size for 2x2 crossover bioequivalence with CV (within-subject)
n_be <- sampleN.TOST(
    alpha = 0.05,
    targetpower = 0.80,
    theta0 = 0.95,        # expected GMR
    theta1 = 0.80,        # lower BE bound
    theta2 = 1.25,        # upper BE bound
    CV = 0.25,             # within-subject CV
    design = '2x2x2'      # standard 2-period 2-sequence
)
print(n_be)

Highly variable drugs (CV > 30%): standard 80-125% fails with feasible n. Use scaled average bioequivalence (SABE); the expanding-limits (ABEL) approach below is the EMA method (the FDA's reference-scaled RSABE uses a different criterion and PowerTOST::sampleN.RSABE()):

  • Reference-scaled limits: theta = exp(0.760 * sigma_WR) when sigma_WR > 0.294
  • Widens BE bounds proportional to within-subject variability of reference
  • PowerTOST::sampleN.scABEL() for sample size

Carryover assessment (Grizzle 1965)

Grizzle test for carryover: compares baseline-adjusted period 1 vs period 2 effects. Now controversial: the two-stage Grizzle carryover pretest is misleading -- it inflates the Type-I error of the treatment comparison (Freeman 1989 Stat Med 8:1421); significant "carryover" should drive design choice (washout extension), not an analysis switch (Senn 2002, Cross-over Trials in Clinical Research, 2nd ed.).

Modern operational rule: pre-specify adequate washout (>=5 half-lives); do NOT routinely test for carryover in primary analysis. If carryover is biologically plausible, use parallel design or extend washout.

Period effect

Period effects (calendar/learning) are estimable in 2x2 crossover. Standard analysis includes period as fixed effect:

r
library(nlme)
fit <- lme(response ~ treatment + period, random = ~1 | subject, data = df)

If period significant, treatment effect is still unbiased (orthogonal in balanced 2x2); report period effect for transparency.

Decision tree -- when crossover is appropriate

ScenarioUse crossover?Why
Bioequivalence of pharmacokinetic parametersYESStandard regulatory; within-subject precision much higher
Chronic stable disease (HTN, GERD, asthma)YESReversible response; ~50% sample size savings
Acute disease (sepsis, MI)NOCannot retreat same patient
Curative intent (oncology, surgery)NOTreatment alters disease state irreversibly
Long-half-life drug (>1 week)NOWashout impractical
Patient-reported outcomes with strong period biasCAUTIONPeriod bias may dominate

MCID -- Anchor-Based vs Distribution-Based

MethodSourceDescription
Anchor-basedJaeschke 1989Patient-reported anchor question; MCID = mean change in subjects who report "small important" change
1 SEM (Wyrwich 1999)J Clin EpidemiolMCID ≈ standard error of measurement
0.5 SD (Norman 2003)Med Care 41:582"Remarkable universality of half a standard deviation" across PROMs
0.5 SD baselineCommon rule of thumbQuick approximation for unknown PROMs

Postdoc rule: δ in power calculation should EXCEED MCID (often 1.5-2× MCID) so that trials are powered to detect effects clearly larger than the noise threshold.

Multiple Endpoints -- See multiplicity-graphical

For co-primary endpoints, power-adjust per FDA Multiple Endpoints Guidance (October 2022):

  • Co-primary (all-must-win): each endpoint at full alpha but joint power = product -> inflate n
  • Multiple primary (any-wins): alpha split (e.g., Bonferroni or graphical)
  • Hierarchical: test in order; if any fail, downstream cannot be claimed

Reconciliation: When Methods Disagree

PatternLikely causeAction
Schoenfeld n much smaller than Lakatos simulation nPH violated under expected HR(t) pattern (immuno-oncology delayed effect)Use Lakatos OR simulation under expected HR(t); cite Lin 2020 NPH Working Group
Continuity-corrected vs uncorrected proportion SS differ by ~10%Asymptotic approximation debate (D'Agostino 1988)For confirmatory n < 100/arm, use simulation-based SS; document correction approach in SAP
NI margin per FDA double discount (50% of M1 lower CI) vs sponsor proposed margin (50% of M1 point estimate)Sponsor uses point estimate; FDA expects lower-CI discountFDA 2016 NI guidance: M2 from lower CI bound is the regulatory expectation
Bayesian predictive probability of success vs frequentist power give different nBayesian integrates prior uncertainty; frequentist conditions on hypothesised δBayesian PPoS more honest about pre-trial uncertainty; frequentist preferred for confirmatory regulatory; report both for adaptive contexts
TOST and CI-inclusion approach give different equivalence conclusionsTOST is two-one-sided at α; CI is 1-2α — mathematically equivalent so should NOT disagreeIf disagree, check α conventions (Schuirmann 1987: TOST at α, CI at 1-2α)
Sponsor's MCID vs published anchor-based MCID differDifferent anchor questions or populationCite primary MCID source; cross-check with Norman 2003 0.5 SD heuristic; declare in SAP
Stratified-randomisation SS calculation vs unstratified differ substantiallyStratification efficiency gain via Senn 2013 formulaUse stratified formula; cite efficiency = 1/(1-r²) where r² is R² of strata against outcome
Cluster-RCT SS underpowered after enrollmentICC misspecified at design (most common SS failure in cluster RCTs)Use historical ICC + sensitivity analysis at ±50% of estimate; cite Murray 1998

Per-Method Failure Modes

Schoenfeld under non-PH

  • Trigger: Immunotherapy or other delayed-effect mechanism
  • Mechanism: Schoenfeld assumes constant log-HR
  • Symptom: Trial under-powered; observed events insufficient
  • Fix: Lakatos 1988 or simulation under expected HR(t); cite Lin 2020 NPH Working Group

Continuity correction debate

  • Trigger: Small-sample binary design
  • Mechanism: Uncorrected normal approx over-states power; corrected wastes ~10%
  • Symptom: Trial reach significance at lower n than expected
  • Fix: Use simulation-based SS for n<100; pre-specify correction approach in SAP

NI margin too liberal

  • Trigger: M2 set to MCID rather than 50% of historical M1
  • Mechanism: Allows clinically unacceptable inferiority within "non-inferior" CI
  • Symptom: Regulators flag margin as inappropriate at scientific advice
  • Fix: M2 <= 0.5 × MCID; M2 <= 0.5 × historical M1 lower bound (FDA double discount)

Constancy assumption violated

  • Trigger: NI trial with new standard of care differing from historical
  • Mechanism: M1 derived from historical data no longer reflects current control efficacy
  • Symptom: Active control performs worse than expected; "successful" NI may mask true inferiority
  • Fix: Synthesis approach with formal sensitivity to constancy; consider three-arm trial with small placebo

MCID confused with δ

  • Trigger: Sponsor sets δ = MCID in power calculation
  • Mechanism: Trial powered to detect smallest meaningful effect, with no margin for noise/dropout
  • Symptom: Effect estimate near MCID with wide CI straddling zero
  • Fix: δ >= 1.5 × MCID; document rationale in SAP

Promising-zone "stealth alpha inflation"

  • Trigger: Mehta-Pocock SSR applied without sufficient simulation
  • Mechanism: a naive unblinded increase analysed with the conventional (unweighted) statistic inflates Type-I error (Cui-Hung-Wang 1999); the pre-specified weighted CHW statistic preserves alpha
  • Symptom: Type-I inflation when the CHW weighting is dropped; separately, Jennison-Turnbull 2015 show the promising zone is inefficient -- the largest power gains per added patient lie outside it
  • Fix: Pre-specify increase rule transparently; report simulation operating characteristics

Unblinded SSR -- DMC firewall failure

  • Trigger: Interim effect estimate leaked beyond IDMC
  • Mechanism: Sponsor inference from sample-size increase decision reveals direction of interim effect
  • Symptom: Regulator audit reveals unblinding
  • Fix: Strict firewall; only "increase / no increase" communicated to sponsor; document SOP

Quantitative Thresholds

ThresholdSourceRationale
δ >= 1.5 × MCID for superiorityPostdoc rule; Norman 2003 implicationδ = MCID gives no margin for sampling variation
M2 <= 0.5 × historical M1 (FDA double discount)FDA NI 2016 guidanceConservative retention against biocreep
M2 <= 0.5 × MCID for NIStandard regulatory expectationAcceptable loss < clinically meaningful difference
Schoenfeld under non-PH under-estimates by 20-50%Lin 2020 NPH WGSwitch to Lakatos or simulation
Continuity correction wastes ~10% sample sizeD'Agostino, Chase & Belanger 1988 Am Stat 42:198Modern computing makes exact tests cheap
90% CI within (0.80, 1.25) for BEFDA 1992 BE guidanceGeometric mean ratio of Cmax/AUC
Unblinded SSR Type-I requires CHW weightsCui-Hung-Wang 1999Naive increase inflates Type-I
Promising-zone CP range ~30-80%Mehta-Pocock 2011 Stat Med 30:3267Mathematical calibration for Type-I preservation

Common Errors

Error / symptomCauseSolution
Trial under-powered for immunotherapySchoenfeld formula used under non-PHLakatos or simulation; cite Lin 2020
δ = MCID, CI straddles zeroδ-MCID confusionPre-specify δ >= 1.5 × MCID
NI "success" but active much worse than historicalConstancy violationCite Hung 2005; consider synthesis or 3-arm
Unblinded SSR with naive sample increaseType-I inflationCHW-weighted test; cite Cui-Hung-Wang 1999
power.prop.test over-states power n < 100Uncorrected normal approximationSimulation-based SS or Fleiss continuity correction
BE failure after large n with point estimate near 1.0Variability higher than assumedRe-estimate from pilot; consider replicate design for highly variable drugs
Promising-zone tipping to favourable not pre-specifiedOperational confusionDocument increase rule in SAP; pre-specify cap
Cluster RCT n based on individual-levelDesign effect ignoredn × (1 + (m-1)ICC); cite Murray 1998
TOST sample size with non-zero true differenceTreating null as abs(mu_diff)=0Include realistic mu_diff in calculation

Anticipated Reviewer Pushback

PushbackResponse
"Is δ realistic?"Justified from prior phase 2; δ exceeds MCID by factor X; pre-specified
"Why this NI margin?"M2 = 50% of historical lower-CI M1 per FDA 2016 double discount; M2 < MCID
"Constancy assumption?"Reviewed historical placebo-vs-active effect over time; stable; sensitivity to lower-end constancy provided
"Schoenfeld vs Lakatos?"PH plausible from phase 2 KM; pre-specified Schoenfeld; Lakatos simulation under expected delayed-effect as sensitivity
"Continuity correction?"n > 200/arm; uncorrected normal approximation valid (Fleiss 1981)
"Bioequivalence variability assumption?"Conservative (upper bound of historical CV); pilot will trigger re-estimation if CV >X%
"Cluster ICC source?"Historical ICC from prior cluster trial in similar setting; sensitivity at ICC ±50% provided
"MCID source?"Anchor-based MCID from validation study (Jaeschke 1989); supported by 0.5 SD heuristic (Norman 2003)
"Promising zone or just blinded SSR?"Promising zone with pre-specified CP boundaries; CHW weights for Type-I control

References

  • Cui L, Hung HMJ, Wang SJ. 1999. Modification of sample size in group sequential clinical trials. Biometrics 55:853-857.
  • D'Agostino RB, Chase W, Belanger A. 1988. The appropriateness of some common procedures for testing the equality of two independent binomial populations. Am Stat 42:198-202.
  • FDA. 2016. Non-Inferiority Clinical Trials to Establish Effectiveness. Final Guidance.
  • FDA. 2022. Multiple Endpoints in Clinical Trials. Final Guidance.
  • Fleiss JL. 1981. Statistical Methods for Rates and Proportions (2nd ed). Wiley.
  • Friede T, Kieser M. 2006. Sample size recalculation in internal pilot study designs. Biom J 48:537-555.
  • Hung HMJ, Wang SJ, O'Neill RT. 2005. A regulatory perspective on choice of margin and statistical inference issue in non-inferiority trials. Biom J 47:28-36.
  • Jaeschke R, Singer J, Guyatt GH. 1989. Measurement of health status: ascertaining the minimal clinically important difference. Control Clin Trials 10:407-415.
  • Lakatos E. 1988. Sample sizes based on the log-rank statistic in complex clinical trials. Biometrics 44:229-241.
  • Lin RS, Lin J, Roychoudhury S, Anderson KM, Hu T, Huang B, Leon LF, Liao JJZ, Liu R, Luo X, Mukhopadhyay P, Qin R, Tatsuoka K, Wang X, Wang Y, Zhu J, Chen TT, Iacona R. 2020. Alternative analysis methods for time to event endpoints under nonproportional hazards: a comparative analysis. Stat Biopharm Res.
  • Mehta CR, Pocock SJ. 2011. Adaptive increase in sample size when interim results are promising. Stat Med 30:3267-3284.
  • Norman GR, Sloan JA, Wyrwich KW. 2003. Interpretation of changes in health-related quality of life: the remarkable universality of half a standard deviation. Med Care 41:582-592.
  • Schoenfeld DA. 1981. The asymptotic properties of nonparametric tests for comparing survival distributions. Biometrika 68:316-319.
  • Schuirmann DJ. 1987. A comparison of the two one-sided tests procedure and the power approach for assessing the equivalence of average bioavailability. J Pharmacokinet Biopharm 15:657-680.
  • Senn S. 2013. Seven myths of randomisation in clinical trials. Stat Med 32:1439-1450.
  • Snapinn SM. 2000. Noninferiority trials. Curr Control Trials Cardiovasc Med 1:19-21.
  • Temple R, Ellenberg SS. 2000. Placebo-controlled trials and active-control trials in the evaluation of new treatments, part 1: ethical and scientific issues. Ann Intern Med 133:455-463.
  • Ellenberg SS, Temple R. 2000. Placebo-controlled trials and active-control trials in the evaluation of new treatments, part 2: practical issues and specific cases. Ann Intern Med 133:464-470.
  • Wyrwich KW, Tierney WM, Wolinsky FD. 1999. Further evidence supporting an SEM-based criterion for the identification of meaningful intra-individual changes in health-related quality of life. J Clin Epidemiol 52:861-873.

Related Skills

  • clinical-biostatistics/survival-analysis - TTE-specific sample size (Schoenfeld, Lakatos, simulation)
  • clinical-biostatistics/effect-measures - δ on OR/RR/RD scales
  • clinical-biostatistics/categorical-tests - Binary endpoint test selection
  • clinical-biostatistics/multiplicity-graphical - Power adjustment for co-primary endpoints
  • clinical-biostatistics/adaptive-designs - SSR, promising zone, group-sequential
  • clinical-biostatistics/bayesian-trials - Bayesian SS via predictive probability of success
  • clinical-biostatistics/trial-reporting - CONSORT 2025 item 16a (sample size justification)
  • experimental-design/sample-size - General sample-size methods
  • experimental-design/power-analysis - General power methods

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Bio Clinical Biostatistics Power Sample Size AI 技能有什么作用?

计算临床试验的样本量和检验效能,适用于连续、二元和生存时间终点,以及优效性、非劣效性和等效性设计;涵盖 FDA 2016 年非劣效界值选择的 M1/M2 框架、用于生存分析的 Schoenfeld 1981 和 Lakatos 1988、Schuirmann TOST 和 80-125% 生物等效性,以及最小临床重要差异(MCID)与 δ 的区别。适用于根据 CONSORT 2025 第 16a 项,在方案或 SAP 中论证试验样本量。

为什么在 TypingMind 中使用 Bio Clinical Biostatistics Power Sample Size?

因为您只需安装一次,就能搭配任何模型使用。Bio Clinical Biostatistics Power Sample Size 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Bio Clinical Biostatistics Power Sample Size?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/PKU-YuanGroup/OpenAI4S/tree/main/skills/bioskills/bio-clinical-biostatistics-power-and-sample-size。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Bio Clinical Biostatistics Power Sample Size?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Bio Clinical Biostatistics Power Sample Size 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Bio Clinical Biostatistics Power Sample Size 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Bio Clinical Biostatistics Power Sample Size AI 技能免费吗?

是的。PKU-YuanGroup 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇