Statistical Analysis logo

Statistical Analysis

CommunityPopular
Norman-bury
statistical-analysis

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

Overview

PublisherNorman-bury
Repositoryresearch-writing-skill
Skill namestatistical-analysis
Stars
3.2K
Forks
214
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by Norman-bury on GitHub. Read the source before you install it.

Installation

Install the Statistical Analysis AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Norman-bury/research-writing-skill.git /tmp/research-writing-skill
mkdir -p .claude/skills
cp -r /tmp/research-writing-skill/skills/statistical-analysis .claude/skills/statistical-analysis
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Statistical Analysis in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Statistical Analysis on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Statistical Analysis is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

统计分析指南

本技能提供学术论文中统计分析的选择、执行和报告指南。

一、统计检验选择

比较两组

数据特征推荐检验
独立、连续、正态独立样本t检验
独立、连续、非正态Mann-Whitney U检验
配对、连续、正态配对样本t检验
配对、连续、非正态Wilcoxon符号秩检验
二分类结果卡方检验或Fisher精确检验

比较三组及以上

数据特征推荐检验
独立、连续、正态单因素方差分析
独立、连续、非正态Kruskal-Wallis检验
配对、连续、正态重复测量方差分析
配对、连续、非正态Friedman检验

关系分析

分析目标推荐方法
两个连续变量关系Pearson相关(正态)或Spearman相关(非正态)
连续结果与预测变量线性回归
二分类结果与预测变量逻辑回归

二、假设检验

正态性检验

python
from scipy import stats

# Shapiro-Wilk检验(样本量<5000)
stat, p_value = stats.shapiro(data)
print(f"Shapiro-Wilk检验: W={stat:.4f}, p={p_value:.4f}")

if p_value > 0.05:
    print("数据符合正态分布假设")
else:
    print("数据不符合正态分布,考虑使用非参数检验")

方差齐性检验

python
from scipy import stats

# Levene检验
stat, p_value = stats.levene(group1, group2)
print(f"Levene检验: F={stat:.4f}, p={p_value:.4f}")

if p_value > 0.05:
    print("方差齐性假设满足")
else:
    print("方差不齐,使用Welch's t检验")

三、效应量

常用效应量参考

检验效应量
t检验Cohen's d0.200.500.80
ANOVAη²_p0.010.060.14
相关r0.100.300.50
回归0.020.130.26

Python计算效应量

python
import pingouin as pg

# t检验返回Cohen's d
result = pg.ttest(group1, group2)
d = result['cohen-d'].values[0]
print(f"Cohen's d = {d:.2f}")

# ANOVA返回偏η²
aov = pg.anova(dv='score', between='group', data=df)
eta_p2 = aov['np2'].values[0]
print(f"Partial η² = {eta_p2:.3f}")

四、APA格式报告

独立样本t检验

A组(n = 48, M = 75.2, SD = 8.5)得分显著高于B组
(n = 52, M = 68.3, SD = 9.2),t(98) = 3.82, p < .001, 
d = 0.77, 95% CI [0.36, 1.18]。

单因素方差分析

单因素方差分析显示处理条件对测试分数有显著主效应,
F(2, 147) = 8.45, p < .001, η²_p = .10。事后比较使用
Tukey HSD表明,条件A(M = 78.2, SD = 7.3)得分显著
高于条件B(M = 71.5, SD = 8.1, p = .002)。

多元回归

多元线性回归预测考试成绩,整体模型显著,
F(3, 146) = 45.2, p < .001, R² = .48。学习时间
(β = .35, p < .001)和先前GPA(β = .28, p < .001)
是显著预测变量。

五、常见统计陷阱

  1. P-hacking:不要测试多种方式直到出现显著性
  2. HARKing:不要将探索性发现呈现为验证性
  3. 忽视假设:检查并报告违反情况
  4. 混淆显著性与重要性:p < .05 ≠ 有意义的效应
  5. 不报告效应量:对解释至关重要
  6. 挑选结果:报告所有计划的分析
  7. 多重比较:适当时校正族错误率
  8. 过度解释非显著结果:无证据 ≠ 无效应的证据

六、Python示例

完整t检验流程

python
import numpy as np
import pingouin as pg
from scipy import stats

# 数据
group_a = np.array([75, 82, 68, 79, 85, 72, 88, 76])
group_b = np.array([65, 70, 62, 68, 75, 60, 72, 66])

# 1. 描述统计
print(f"A组: M={group_a.mean():.2f}, SD={group_a.std():.2f}")
print(f"B组: M={group_b.mean():.2f}, SD={group_b.std():.2f}")

# 2. 正态性检验
_, p_a = stats.shapiro(group_a)
_, p_b = stats.shapiro(group_b)
print(f"正态性: A组 p={p_a:.3f}, B组 p={p_b:.3f}")

# 3. t检验
result = pg.ttest(group_a, group_b)
print(f"t = {result['T'].values[0]:.2f}")
print(f"p = {result['p-val'].values[0]:.4f}")
print(f"Cohen's d = {result['cohen-d'].values[0]:.2f}")

七、统计分析检查清单

  • 定义研究问题和假设
  • 确定适当的统计检验
  • 进行功效分析确定样本量
  • 检查缺失数据和异常值
  • 验证假设(正态性、方差齐性)
  • 运行主要分析
  • 计算效应量和置信区间
  • 进行事后检验(如需要)
  • 按APA格式撰写结果

八、推荐资源

Python库

  • scipy.stats:核心统计检验
  • statsmodels:高级回归和诊断
  • pingouin:用户友好的统计检验,带效应量

Frequently asked questions

What does the Statistical Analysis AI skill do?

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

Why use Statistical Analysis on TypingMind?

Because you install it once and use it with any model. Statistical Analysis is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Statistical Analysis in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Norman-bury/research-writing-skill/tree/main/skills/statistical-analysis. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Statistical Analysis?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Statistical Analysis?

As many as you like. As long as a model supports skills, you can use Statistical Analysis with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Statistical Analysis AI skill free?

Yes. It is published on GitHub by Norman-bury under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇