来源信息
- 仓库
- brycewang-stanford/Auto-Empirical-Research-Skills
- 最近来源活动
- 2026年4月3日 02:07
- 检测到的 SKILL.md 语言
- 英语
- 星标
- 3,291
- 分支
- 432
安装方式
默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。
检查来源文件
决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。
菜单
默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。
决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/brycewang-stanford/Auto-Empirical-Research-Skills --skill clinical-trial-design-guide命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Route empirical-research requests through the Auto-Empirical Research Skills catalog when this whole repository is installed as one skill in Codex, CodeBuddy, Claude Code, or another IDE. Use to choose and load the right vendored AERS skill for causal inference, econometrics, replication, data acquisition, manuscript writing, peer review and referee responses, citation checking, de-AIGC editing, or full empirical-paper workflows without reading the entire repository at once.
中英双语学术降 AIGC / bilingual academic de-AIGC skill. Removes AI-generated writing signatures from empirical papers in economics, management, and the social sciences — in both English and Chinese. Covers Turnitin AI, GPTZero, Originality.ai on the English side and 知网 AMLC, 万方, 维普 on the Chinese side. Uses a six-step loop (intake → audit → claim-evidence check → differentiated rewrite → five-dimension self-score → cold-reader recheck) with two pattern libraries (22 English + 17 Chinese patterns), section-by-section strategies for empirical papers, and hard protections that keep every number, coefficient, and citation intact.
Use when a research task needs reproducible Kaggle discovery, metadata inspection, bounded public-data downloads, competition or kernel discovery, model discovery, or an explicitly approved Kaggle write/delete operation through the official CLI.
基于 SOC 职业分类
正在显示 SKILL.md
| name | clinical-trial-design-guide |
| description | Clinical trial methodology, biostatistics, and study design guidance |
| metadata | {"openclaw":{"emoji":"🧪","category":"domains","subcategory":"pharma","keywords":["clinical-trial","biostatistics","randomization","sample-size","survival-analysis","rct"],"source":"wentor"}} |
A skill for designing and analyzing clinical trials, covering study design selection, sample size calculation, randomization methods, interim analysis, survival endpoints, and regulatory considerations. Essential for pharmaceutical researchers, biostatisticians, and clinical scientists.
| Phase | Objective | Typical N | Duration | Primary Endpoints |
|---|---|---|---|---|
| Phase I | Safety, dose-finding | 20-80 | Months | MTD, DLT, PK profile |
| Phase II | Efficacy signal, dosing | 100-300 | 1-2 years | Response rate, biomarker |
| Phase III | Confirmatory efficacy | 300-3,000+ | 2-4 years | OS, PFS, clinical outcome |
| Phase IV | Post-marketing surveillance | 1,000+ | Ongoing | Safety, real-world effectiveness |
Parallel Group (most common Phase III):
R --> Treatment A --> Outcome assessment
R --> Treatment B --> Outcome assessment
Crossover:
R --> Treatment A --> Washout --> Treatment B --> Outcome
R --> Treatment B --> Washout --> Treatment A --> Outcome
Factorial (2x2):
R --> Drug A + Drug B
R --> Drug A + Placebo B
R --> Placebo A + Drug B
R --> Placebo A + Placebo B
Adaptive:
Stage 1: Enroll n1 patients --> Interim analysis
Stage 2: Modify design (dose, sample size, arm dropping) --> Continue
| Factor | Recommended Design |
|---|---|
| Chronic disease, stable condition | Crossover (within-subject comparison) |
| Acute condition, one-time treatment | Parallel group |
| Multiple drugs to evaluate | Factorial or multi-arm |
| High uncertainty in effect size | Adaptive (sample size re-estimation) |
| Rare disease, limited patients | Bayesian adaptive, single-arm with historical control |
from scipy.stats import norm
import numpy as np
def sample_size_two_means(delta: float, sigma: float,
alpha: float = 0.05, power: float = 0.80,
ratio: float = 1.0) -> dict:
"""
Sample size for comparing two group means (two-sided test).
delta: minimum clinically important difference
sigma: pooled standard deviation
alpha: type I error rate
power: desired power (1 - beta)
ratio: allocation ratio (n2/n1)
"""
z_alpha = norm.ppf(1 - alpha / 2)
z_beta = norm.ppf(power)
effect = delta / sigma
n1 = ((z_alpha + z_beta) ** 2 * (1 + 1 / ratio)) / effect ** 2
n2 = ratio * n1
return {
"n_per_group_1": int(np.ceil(n1)),
"n_per_group_2": int(np.ceil(n2)),
"total": int(np.ceil(n1) + np.ceil(n2)),
"effect_size": round(effect, 3),
}
# Example: detect 5-point difference, SD=15, 80% power
result = sample_size_two_means(delta=5, sigma=15)
print(f"Required: {result['total']} total patients")
def sample_size_logrank(hazard_ratio: float, alpha: float = 0.05,
power: float = 0.80, ratio: float = 1.0,
median_control: float = 12.0,
accrual_time: float = 24.0,
followup_time: float = 12.0) -> dict:
"""
Sample size for log-rank test comparing two survival curves.
hazard_ratio: expected HR (treatment/control), <1 means treatment better
median_control: median survival in control arm (months)
"""
z_alpha = norm.ppf(1 - alpha / 2)
z_beta = norm.ppf(power)
# Required number of events (Schoenfeld formula)
d = ((z_alpha + z_beta) ** 2 * (1 + ratio) ** 2) / (
ratio * (np.log(hazard_ratio)) ** 2
)
d = int(np.ceil(d))
# Estimate probability of event during study
lambda_c = np.log(2) / median_control
lambda_t = lambda_c * hazard_ratio
# Average probability of event (simplified uniform accrual)
p_event_c = 1 - np.exp(-lambda_c * followup_time)
p_event_t = 1 - np.exp(-lambda_t * followup_time)
p_event_avg = (p_event_c + ratio * p_event_t) / (1 + ratio)
n_total = int(np.ceil(d / p_event_avg))
return {
"events_required": d,
"total_patients": n_total,
"hazard_ratio": hazard_ratio,
"p_event_avg": round(p_event_avg, ),
}
import random
def stratified_block_randomization(strata: list[str],
block_sizes: list[int] = [4, 6],
ratio: tuple = (1, 1),
seed: int = 42) -> list[str]:
"""
Stratified permuted block randomization.
strata: list of stratum labels for each patient (in enrollment order)
block_sizes: list of possible block sizes (randomly selected)
ratio: allocation ratio (e.g., (1,1) for 1:1, (2,1) for 2:1)
Returns list of treatment assignments ('A' or 'B').
"""
rng = random.Random(seed)
stratum_queues = {}
assignments = []
for stratum in strata:
if stratum not in stratum_queues:
stratum_queues[stratum] = []
if not stratum_queues[stratum]:
# Generate new block
block_size = rng.choice(block_sizes)
n_a = block_size * ratio[0] // sum(ratio)
n_b = block_size - n_a
block = ["A"] * n_a + ["B"] * n_b
rng.shuffle(block)
stratum_queues[stratum] = block
assignments.append(stratum_queues[stratum].pop(0))
return assignments
def obrien_fleming_boundary(n_looks: int, alpha: float = 0.05) -> list[float]:
"""
Compute O'Brien-Fleming spending function boundaries.
Provides very conservative early stopping with near-nominal final alpha.
"""
from scipy.stats import norm
boundaries = []
for k in range(1, n_looks + 1):
info_fraction = k / n_looks
z_boundary = norm.ppf(1 - alpha / 2) / np.sqrt(info_fraction)
p_boundary = 2 * (1 - norm.cdf(z_boundary))
boundaries.append({
"look": k,
"info_fraction": round(info_fraction, 3),
"z_boundary": round(z_boundary, 4),
"p_boundary": round(p_boundary, 6),
})
return boundaries
# Example: 3 interim looks + 1 final
boundaries = obrien_fleming_boundary(4)
for b in boundaries:
print(f"Look {b['look']}: Z={b['z_boundary']}, p={b['p_boundary']}")
from lifelines import KaplanMeierFitter
from lifelines.statistics import logrank_test
def analyze_survival(time: pd.Series, event: pd.Series,
group: pd.Series) -> dict:
"""
Perform Kaplan-Meier estimation and log-rank test.
time: follow-up duration
event: 1=event occurred, 0=censored
group: treatment group labels
"""
groups = group.unique()
kmf_results = {}
for g in groups:
mask = group == g
kmf = KaplanMeierFitter()
kmf.fit(time[mask], event[mask], label=str(g))
kmf_results[g] = {
"median_survival": kmf.median_survival_time_,
"survival_at_12m": kmf.predict(12),
}
# Log-rank test
mask_a = group == groups[0]
lr = logrank_test(
time[mask_a], time[~mask_a],
event[mask_a], event[~mask_a],
)
return {
"group_results": kmf_results,
"logrank_statistic": lr.test_statistic,
"logrank_p_value": lr.p_value,
}
Key regulatory documents for clinical trial design: