Tooluck logoTooluck
SKILL.md

statistical-analysis

Agent skill fromNorman-bury/research-writing-skill

Use when planning or reporting statistical analysis - provides test selection, execution code, and APA format guidelines

How to install statistical-analysis

install statistical-analysis
# install the research-writing-skill pack with the skills CLI
npx skills add Norman-bury/research-writing-skill

# or add only this skill to Claude Code: copy the folder

skills/statistical-analysis/

# into

~/.claude/skills/statistical-analysis/ (all projects)

.claude/skills/statistical-analysis/ (one project)

skills/statistical-analysis/SKILL.md

MITFull file
1# 统计分析指南
2
3本技能提供学术论文中统计分析的选择、执行和报告指南。
4
5## 一、统计检验选择
6
7### 比较两组
8
9| 数据特征 | 推荐检验 |
10|----------|----------|
11| 独立、连续、正态 | 独立样本t检验 |
12| 独立、连续、非正态 | Mann-Whitney U检验 |
13| 配对、连续、正态 | 配对样本t检验 |
14| 配对、连续、非正态 | Wilcoxon符号秩检验 |
15| 二分类结果 | 卡方检验或Fisher精确检验 |
16
17### 比较三组及以上
18
19| 数据特征 | 推荐检验 |
20|----------|----------|
21| 独立、连续、正态 | 单因素方差分析 |
22| 独立、连续、非正态 | Kruskal-Wallis检验 |
23| 配对、连续、正态 | 重复测量方差分析 |
24| 配对、连续、非正态 | Friedman检验 |
25
26### 关系分析
27
28| 分析目标 | 推荐方法 |
29|----------|----------|
30| 两个连续变量关系 | Pearson相关(正态)或Spearman相关(非正态) |
31| 连续结果与预测变量 | 线性回归 |
32| 二分类结果与预测变量 | 逻辑回归 |
33
34## 二、假设检验
35
36### 正态性检验
37
38```python
39from scipy import stats
40
41# Shapiro-Wilk检验(样本量<5000)
42stat, p_value = stats.shapiro(data)
43print(f"Shapiro-Wilk检验: W={stat:.4f}, p={p_value:.4f}")
44
45if p_value > 0.05:
46 print("数据符合正态分布假设")
47else:
48 print("数据不符合正态分布,考虑使用非参数检验")
49```
50
51### 方差齐性检验
52
53```python
54from scipy import stats
55
56# Levene检验
57stat, p_value = stats.levene(group1, group2)
58print(f"Levene检验: F={stat:.4f}, p={p_value:.4f}")
59
60if p_value > 0.05:
61 print("方差齐性假设满足")
62else:
63 print("方差不齐,使用Welch's t检验")
64```
65
66## 三、效应量
67
68### 常用效应量参考
69
70| 检验 | 效应量 | 小 | 中 | 大 |
71|------|--------|-----|-----|-----|
72| t检验 | Cohen's d | 0.20 | 0.50 | 0.80 |
73| ANOVA | η²_p | 0.01 | 0.06 | 0.14 |
74| 相关 | r | 0.10 | 0.30 | 0.50 |
75| 回归 | R² | 0.02 | 0.13 | 0.26 |
76
77### Python计算效应量
78
79```python
80import pingouin as pg
81
82# t检验返回Cohen's d
83result = pg.ttest(group1, group2)
84d = result['cohen-d'].values[0]
85print(f"Cohen's d = {d:.2f}")
86
87# ANOVA返回偏η²
88aov = pg.anova(dv='score', between='group', data=df)
89…

Excerpt shown under the repository's MIT license.

More skills in research-writing-skill

Keep exploring

Similar skill repositories

thedotmack /

claude-mem
116k

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

CCCXGHGM+135 skills

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates