mcpField
S
statistics-verifier

statistics-verifier

github.com/travisjneuman数据与数据库106215 次安装1 天前更新
代码仓库

关于 statistics-verifier

面向研究人员和数据分析者的统计核验参考,帮助检查统计主张、研究方法、分析错误与偏差。内容包含检验选择、样本量、可视化和可重复性核对清单。

主要功能

  1. 01统计主张核验清单
  2. 02研究设计与分析错误检查
  3. 03显著性检验选择指南
  4. 04样本量与统计功效核验
  5. 05偏差、图表与可重复性检查

适用场景

  1. 01审查研究中的统计主张
  2. 02检查调查或实验方法
  3. 03核验显著性与多重比较
  4. 04审计数据图表是否误导

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/travisjneuman/.claude --skill statistics-verifier

安装后在 Claude Code 中输入/statistics-verifier确认已加载。

详细介绍

统计学验证器

用于验证统计学主张、核验研究方法并发现分析错误与偏差的结构化框架。

统计学主张验证清单

快速评估主张
CLAIM VERIFICATION PROTOCOL:

1. SOURCE CHECK
   - Who made the claim?
   - What is their expertise and incentive?
   - Where was it published (peer-reviewed, preprint, press release)?
   - Is the original data or study accessible?

2. METHODOLOGY CHECK
   - What type of study (RCT, observational, survey, meta-analysis)?
   - What was the sample size and population?
   - What was the measurement method?
   - Is the statistical test appropriate for the data type?

3. NUMBER SENSE CHECK
   - Does the claim pass a basic plausibility test?
   - Are units and denominators clearly stated?
   - Absolute vs relative numbers — which is being used?
   - Is the base rate provided for context?

4. REPLICATION CHECK
   - Have other studies found similar results?
   - Are the findings consistent across populations?
   - Has anyone attempted and failed to replicate?

5. CONCLUSION CHECK
   - Does the conclusion follow from the data?
   - Are alternative explanations addressed?
   - Is the scope of the claim proportional to the evidence?
主张中的危险信号
危险信号含义行动
未提供样本量无法评估可靠性要求提供或估算 N
仅报告相对风险可能掩盖较小的绝对效应计算绝对差异
使用“最高达 X%”的表述挑选了最佳情况询问中位数或均值
未提供置信区间精确度未知持怀疑态度
将相关性表述为因果关系可能忽视了混杂因素检查研究设计
样本由受访者自行选择可能存在选择偏差说明局限性
复合终点可能掩盖单项结果的微弱表现分解终点
突出显示亚组分析可能是事后筛选要求预注册

常见统计错误

错误检测框架
CATEGORY 1: DESIGN ERRORS
- Sampling bias (convenience, voluntary response, survivorship)
- Confounding variables not controlled
- Insufficient sample size (underpowered study)
- No control group or inappropriate comparator
- Measurement instrument not validated

CATEGORY 2: ANALYSIS ERRORS
- Multiple comparisons without correction (p-hacking)
- Treating ordinal data as interval
- Assuming normality without checking
- Ignoring missing data patterns (MCAR vs MNAR)
- Using parametric tests on non-parametric data

CATEGORY 3: INTERPRETATION ERRORS
- Confusing statistical significance with practical significance
- Interpreting non-significant result as "no effect"
- Ecological fallacy (group-level applied to individuals)
- Simpson's paradox not checked
- Ignoring effect size and confidence intervals

CATEGORY 4: REPORTING ERRORS
- Selective reporting of favorable results
- Omitting negative or null findings
- Misleading axis scales in visualizations
- Presenting percentages without base numbers
- Switching between absolute and relative metrics
错误严重程度评估
错误类型严重程度对结论的影响
P-hacking / HARKing严重使研究结果无效
选择偏差严重样本存在根本缺陷
未处理混杂因素高仍存在其他解释
统计检验错误高结果可能是人为造成的
未校正多重比较高假阳性率升高
样本量小且未进行功效分析中可能漏掉真实效应
缺少置信区间中无法判断精确度
可视化具有误导性中错误呈现效应大小
轻微舍入误差低影响极小

显著性检验框架

检验选择指南
CHOOSING THE RIGHT TEST:

DATA TYPE → COMPARISON → TEST

Continuous + 2 groups + independent → Independent t-test (or Mann-Whitney)
Continuous + 2 groups + paired     → Paired t-test (or Wilcoxon signed-rank)
Continuous + 3+ groups + independent → One-way ANOVA (or Kruskal-Wallis)
Continuous + 2+ factors            → Two-way ANOVA (or Friedman)
Continuous + continuous             → Pearson correlation (or Spearman)

Categorical + 2 groups             → Chi-square test (or Fisher's exact)
Categorical + ordered              → Cochran-Armitage trend test
Binary outcome + predictors        → Logistic regression

Time-to-event + groups             → Log-rank test / Cox regression
Count data                          → Poisson regression
Proportion + large sample           → Z-test for proportions
P 值解读指南
P-VALUE CONTEXT:

p-value = P(data this extreme | null hypothesis is true)

COMMON MISINTERPRETATIONS:
  p = 0.03 does NOT mean:
  - "There is a 3% chance the result is due to chance"
  - "There is a 97% probability the hypothesis is true"
  - "The effect is large or important"
  - "The study will replicate"

  p = 0.03 DOES mean:
  - If the null hypothesis were true, data this extreme
    would occur about 3% of the time by chance alone.

THRESHOLDS (conventional, not absolute):
  p < 0.001  — strong evidence against null
  p < 0.01   — moderate evidence against null
  p < 0.05   — conventional threshold (context-dependent)
  p > 0.05   — insufficient evidence to reject null
                (NOT evidence of no effect)

ALWAYS COMPLEMENT WITH:
  - Effect size (Cohen's d, odds ratio, etc.)
  - Confidence interval (range of plausible values)
  - Practical significance (is the effect meaningful?)
  - Study power (could it have detected a real effect?)
多重比较校正
方法适用场景保守程度
Bonferroni比较次数较少,需要严格控制非常保守
Holm-Bonferroni比较次数中等,采用逐步法保守程度较低
Benjamini-Hochberg比较次数较多(控制 FDR)宽松
Tukey's HSDANOVA 后进行所有成对比较中等
Dunnett's多个处理组与一个对照组比较中等

样本量验证

快速参考表
MINIMUM SAMPLE SIZE GUIDELINES:

Survey (population estimate):
  ±3% margin, 95% CI → n ≈ 1,067
  ±5% margin, 95% CI → n ≈ 385
  ±10% margin, 95% CI → n ≈ 97

A/B Test (detecting 5% relative lift):
  Baseline 10% conversion → n ≈ 3,200 per group
  Baseline 5% conversion  → n ≈ 6,400 per group
  Baseline 2% conversion  → n ≈ 16,000 per group

Clinical trial (medium effect d=0.5):
  Two-group comparison, 80% power → n ≈ 64 per group
  Two-group comparison, 90% power → n ≈ 86 per group

Correlation (detecting r=0.3):
  80% power, alpha=0.05 → n ≈ 85
  90% power, alpha=0.05 → n ≈ 113
功效分析清单
参数必须指定来源
Alpha(I 类错误率)是惯例(通常为 0.05)
功效(1 - II 类错误)是通常为 0.80 或 0.90
效应量是既往研究或 MCID
方差 / SD是试点数据或文献
样本量计算得出功效分析的输出
脱落率建议指定根据预期脱落率增加 N

相关性与因果关系清单

Bradford Hill 因果关系标准
DOES CORRELATION IMPLY CAUSATION? CHECK:

1. STRENGTH           Is the association large?
                      Larger effects harder to explain away.

2. CONSISTENCY        Replicated across settings, populations?
                      Multiple studies, same finding.

3. SPECIFICITY        Is X linked specifically to Y (not everything)?
                      Less useful for multifactorial diseases.

4. TEMPORALITY        Does X precede Y in time?
                      REQUIRED — cause must come before effect.

5. BIOLOGICAL GRADIENT  Does more X produce more Y (dose-response)?
                        Strong support for causation.

6. PLAUSIBILITY       Is there a credible mechanism?
                      Based on current knowledge.

7. COHERENCE          Consistent with known biology/theory?
                      No conflict with established facts.

8. EXPERIMENT         Does removing X reduce Y?
                      Strongest evidence (RCT).

9. ANALOGY            Similar exposures cause similar effects?
                      Weakest criterion, supporting only.

VERDICT:
  Criteria 1-3 met + Temporality → Suggestive of causation
  Criteria 1-6 met + Experiment  → Strong evidence of causation
  Only correlation observed      → Association only, cannot infer cause
常见的第三变量混杂因素
观察到的关联可能的混杂因素
冰淇淋销量与溺水事件天气炎热(季节)
鞋码与阅读能力年龄
就诊次数与死亡率病情严重程度
有机食品与健康社会经济地位
屏幕使用时间与抑郁社交孤立、睡眠

调查方法审查

调查质量评估
SURVEY METHODOLOGY CHECKLIST:

SAMPLING:
- [ ] Probability sampling method described?
- [ ] Sampling frame defined and appropriate?
- [ ] Response rate reported (acceptable: >60% mail, >80% in-person)?
- [ ] Non-response bias assessed?

QUESTIONNAIRE:
- [ ] Questions validated or adapted from validated instruments?
- [ ] Leading or double-barreled questions absent?
- [ ] Response options balanced and exhaustive?
- [ ] Pilot tested with target population?

ADMINISTRATION:
- [ ] Mode (online, phone, in-person) appropriate?
- [ ] Anonymity/confidentiality assured?
- [ ] Informed consent obtained?
- [ ] Social desirability bias mitigated?

ANALYSIS:
- [ ] Weighting applied for non-response or oversampling?
- [ ] Margin of error and confidence level reported?
- [ ] Subgroup analyses pre-specified (not exploratory)?

数据可视化完整性检查

图表审计清单
检查项检查内容不通过条件
Y 轴从零开始(柱状图)截断坐标轴会夸大差异坐标轴从零以上开始,且未明确标注
比例一致两个坐标轴的刻度增量成比例使用非线性比例,且未作说明
面积与数据成比例气泡/图标大小与数值相符面积无法准确表示数值大小
时间轴间距均匀数据点之间的间隔相等间距不均匀,导致趋势被压缩/拉伸
图表类型恰当数据类型与可视化方式相符饼图包含 20 个以上类别
提供上下文基准、比较对象、基线只有单个数据点,且没有参考信息
注明来源数据来源可追溯未注明来源
谨慎使用双轴两个 Y 轴可能造成虚假相关性任意缩放暗示两者存在关系
误导性可视化模式
WATCH FOR THESE TRICKS:

1. TRUNCATED AXIS
   Small differences look dramatic when baseline removed.
   FIX: Always check if y-axis starts at zero for bar charts.

2. CHERRY-PICKED TIME WINDOW
   Start/end dates chosen to show desired trend.
   FIX: Ask for longer time series with consistent intervals.

3. 3D EFFECTS
   Perspective distortion makes sizes unequal.
   FIX: Use flat 2D charts for accurate comparison.

4. DUAL AXIS MANIPULATION
   Two y-axes scaled to create apparent correlation.
   FIX: Normalize data or use separate panels.

5. CUMULATIVE VS DAILY
   Cumulative charts always go up — hides declining rates.
   FIX: Show rate of change alongside cumulative.

偏差检测框架

数据分析中的认知偏差
BIAS DETECTION CHECKLIST:

CONFIRMATION BIAS
- Are they only presenting data that supports their hypothesis?
- Were negative results reported?
- Was the analysis plan pre-registered?

ANCHORING BIAS
- Is the first number presented influencing interpretation of later data?
- Are comparisons made to appropriate benchmarks?

SURVIVORSHIP BIAS
- Are only successful cases included (ignoring failures)?
- Is the denominator complete (not just survivors)?

AVAILABILITY BIAS
- Are dramatic or recent events overweighted?
- Is systematic data used rather than anecdotal evidence?

PUBLICATION BIAS
- Is there a funnel plot asymmetry (meta-analyses)?
- Are null results published or only significant ones?

TEXAS SHARPSHOOTER FALLACY
- Were clusters or patterns found after looking at data?
- Was the hypothesis formed before or after seeing results?
偏差严重程度矩阵
偏差检测方法缓解措施
选择偏差将样本与总体的人口统计特征进行比较概率抽样、加权
测量偏差检查测量工具的有效性和校准情况使用经过验证的工具、盲法
报告偏差检查漏斗图是否不对称预注册、开放数据
回忆偏差与客观记录进行比较前瞻性数据收集
观察者偏差检查评估人员是否采用盲法双盲设计
脱落偏差比较完成研究者与退出者意向性治疗分析

可复现性清单

研究可复现性评估
REPRODUCIBILITY REQUIREMENTS:

DATA AVAILABILITY:
- [ ] Raw data accessible (repository, supplement, on request)?
- [ ] Data dictionary / codebook provided?
- [ ] Data collection protocol documented?

CODE / ANALYSIS:
- [ ] Analysis code shared (GitHub, OSF, supplement)?
- [ ] Software versions and packages specified?
- [ ] Random seeds set for reproducible computation?
- [ ] Pipeline documented end-to-end?

METHODOLOGY:
- [ ] Study pre-registered (OSF, ClinicalTrials.gov)?
- [ ] Deviations from protocol documented?
- [ ] All outcome measures reported (not just significant ones)?
- [ ] Sensitivity analyses included?

REPORTING:
- [ ] Follows reporting guidelines (CONSORT, STROBE, PRISMA)?
- [ ] Effect sizes and confidence intervals reported?
- [ ] Power analysis or sample size justification provided?
- [ ] Limitations section thorough and honest?
不同研究类型的报告规范
研究类型指南关键要素
随机试验CONSORT流程图、ITT 分析、盲法
观察性研究STROBE选择标准、混杂因素、缺失数据
系统综述PRISMA检索策略、纳入标准、偏倚风险
诊断准确性研究STARD指标检验、参考标准、流程图
定性研究COREQ研究团队、研究设计、数据分析
预测模型TRIPOD模型开发、验证、性能

快速验证工作流

FAST VERIFICATION (5 minutes):

1. Read the claim carefully — what exactly is being stated?
2. Check: source, sample size, study type
3. Ask: absolute or relative? What is the base rate?
4. Check: confidence interval or margin of error given?
5. Search: has this been replicated independently?

VERDICT CATEGORIES:
  VERIFIED    — multiple strong sources, robust methodology
  PLAUSIBLE   — reasonable evidence, some limitations
  UNCERTAIN   — mixed evidence, methodology concerns
  MISLEADING  — technically true but presented deceptively
  FALSE       — contradicted by strong evidence
  UNVERIFIABLE — cannot assess with available information

另请参阅

评论

支持 Markdown