Logo Bio Clinical Biostatistics Power Sample Size

Bio Clinical Biostatistics Power Sample Size

Tổ chức
PKU-YuanGroup
bio-clinical-biostatistics-power-sample-size

Tính cỡ mẫu và lực thống kê cho các thử nghiệm lâm sàng có tiêu chí liên tục, nhị phân và thời gian đến biến cố; thiết kế ưu thế, không thua kém và tương đương; chọn biên không thua kém theo hướng dẫn FDA 2016 với khung M1/M2; phương pháp Schoenfeld 1981 và Lakatos 1988 cho phân tích sống còn; phép kiểm TOST của Schuirmann và tính tương đương sinh học 80–125%; phân biệt khác biệt có ý nghĩa lâm sàng tối thiểu (MCID) với δ. Dùng khi giải trình cỡ mẫu thử nghiệm trong đề cương hoặc SAP theo mục 16a của CONSORT 2025.

Add to TypingMind

Tổng quan

Nhà phát hànhPKU-YuanGroup
Kho mãOpenAI4S
Tên kỹ năngbio-clinical-biostatistics-power-sample-size
Sao
622
Bản fork
72
Tệp đi kèm
2
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 2 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được PKU-YuanGroup công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Bio Clinical Biostatistics Power Sample Size trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/PKU-YuanGroup/OpenAI4S/tree/main/skills/bioskills/bio-clinical-biostatistics-power-and-sample-size
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

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
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Bio Clinical Biostatistics Power Sample Size trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Bio Clinical Biostatistics Power Sample Size ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Bio Clinical Biostatistics Power Sample Size với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

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

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Bio Clinical Biostatistics Power Sample Size làm được gì?

Tính cỡ mẫu và lực thống kê cho các thử nghiệm lâm sàng có tiêu chí liên tục, nhị phân và thời gian đến biến cố; thiết kế ưu thế, không thua kém và tương đương; chọn biên không thua kém theo hướng dẫn FDA 2016 với khung M1/M2; phương pháp Schoenfeld 1981 và Lakatos 1988 cho phân tích sống còn; phép kiểm TOST của Schuirmann và tính tương đương sinh học 80–125%; phân biệt khác biệt có ý nghĩa lâm sàng tối thiểu (MCID) với δ. Dùng khi giải trình cỡ mẫu thử nghiệm trong đề cương hoặc SAP theo mục 16a của CONSORT 2025.

Vì sao nên dùng Bio Clinical Biostatistics Power Sample Size trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Bio Clinical Biostatistics Power Sample Size là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Bio Clinical Biostatistics Power Sample Size trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/PKU-YuanGroup/OpenAI4S/tree/main/skills/bioskills/bio-clinical-biostatistics-power-and-sample-size. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Bio Clinical Biostatistics Power Sample Size?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Bio Clinical Biostatistics Power Sample Size với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Bio Clinical Biostatistics Power Sample Size với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Bio Clinical Biostatistics Power Sample Size có miễn phí không?

Có. Kỹ năng này được PKU-YuanGroup phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇