Agent skill

Statistical Analysis

by aipoch in aipoch/medical-research-skills

Guided statistical analysis for test selection, assumption checks, power analysis, and APA-style reporting.

MITAuto-check passedData & Analytics

Install Statistical Analysis

skills CLI
$ npx skills add aipoch/medical-research-skills --skill statistical-analysis -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install aipoch/medical-research-skills statistical-analysis --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/aipoch/medical-research-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/'scientific-skills/Data Analysis/statistical-analysis' .claude/skills/statistical-analysis && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
statistical-analysis
GitHub stars
2k
Token cost
~2.8k tokens
SKILL.md length
1,023 words
Files
8 (incl. scripts, references)
Skills in repo
567
Repo updated
First seen
Licence
MIT

At a glance

Guided statistical analysis for test selection, assumption checks, power analysis, and APA-style reporting.

  • Works in 5 steps: Test Selection Logic (Conceptual) → Assumption Checks and Diagnostics → Effect Sizes and Uncertainty → …
  • Tasks that involve Statistics
  • SKILL.md covers When to Use, Key Features, Dependencies and Example Usage, plus 8 more sections
  • Runs Python scripts from its folder

What it does

Statistical Analysis is an agent skill from aipoch/medical-research-skills. Guided statistical analysis for test selection, assumption checks, power analysis, and APA-style reporting. Use when you need to choose an appropriate statistical test for your data and produce publication-ready results (including effect sizes and diagnostics).

Its SKILL.md is about 2.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 9 other files, including scripts and reference files (for example `POLISH_CHANGELOG.md`, `eval_report_statistical-analysis_result.json` and `references/assumptions_and_diagnostics.md`).

It sits in Data & Analytics, covering Statistics and Experimental design. The repository describes itself as: Hundreds of agent skills for medical research, including protocol design, data analysis, evidence insights, and academic writing. The licence is MIT.

When your agent uses it

  • Tasks that involve Statistics
  • Tasks that involve Experimental design

Example prompts

  • “/statistical-analysis”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Test Selection Logic (Conceptual)
  2. Assumption Checks and Diagnostics
  3. Effect Sizes and Uncertainty
  4. Power Analysis
  5. APA-Style Reporting Requirements

What it can do on your machine

Read from SKILL.md and the folder at commit 686e09d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Statistical Analysis loads about 2.8k tokens when it runs, and up to ~20k if it reads all its reference files. Until then it costs about 71 tokens; SKILL.md has 1,023 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~71
When it runs · the whole SKILL.md, loaded when a task matches
~2.8k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~20k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from aipoch/medical-research-skills at commit 686e09d, republished under its MIT licence (© aipoch). 1,023 words, ~2,805 tokens.

Download SKILL.mdSave it as .claude/skills/statistical-analysis/SKILL.md (or your agent's skills folder). This skill also uses 7 other files; get the full folder from GitHub.
name
statistical-analysis
description
Guided statistical analysis for test selection, assumption checks, power analysis, and APA-style reporting. Use when you need to choose an appropriate statistical test for your data and produce publication-ready results (including effect sizes and diagnostics).
license
MIT
author
AIPOCH

Source: https://github.com/aipoch/medical-research-skills

When to Use

Use this skill when you need to:

  1. Choose an appropriate statistical test (e.g., t-test vs. ANOVA vs. non-parametric vs. Bayesian) based on study design and variable types.
  2. Validate assumptions before inference (normality, homoscedasticity, linearity, outliers) and decide on remedies when assumptions fail.
  3. Run common inferential analyses (hypothesis tests, correlation, regression) and interpret results with effect sizes and uncertainty.
  4. Plan studies with a priori power analysis (sample size planning) or run sensitivity analysis after data collection.
  5. Write results in APA style with complete reporting elements (test statistic, df, p, effect size, CI, assumption checks).

For programming model-specific workflows (especially regression variants and custom diagnostics), prefer statsmodels directly; this skill focuses on guided selection, checks, interpretation, and reporting.

Key Features

  • Test selection guidance by research question, design (independent/paired; 2+ groups), outcome type, and distributional properties (see references/test_selection_guide.md).
  • Assumption checking and diagnostics with automated checks and plots (Q–Q, residual plots, boxplots) via scripts/assumption_checks.py (see references/assumptions_and_diagnostics.md).
  • Frequentist analyses: t-tests, ANOVA (+ post-hoc), chi-square/Fisher, correlation (Pearson/Spearman), linear/logistic regression with diagnostics.
  • Bayesian alternatives with posterior summaries and Bayes Factors (see references/bayesian_statistics.md).
  • Effect sizes + confidence intervals for interpretation beyond p-values (see references/effect_sizes_and_power.md).
  • APA-style reporting templates and required reporting elements (see references/reporting_standards.md).

Dependencies

Python (recommended 3.10+) with:

  • numpy>=1.24
  • pandas>=2.0
  • scipy>=1.10
  • statsmodels>=0.14
  • pingouin>=0.5
  • matplotlib>=3.7
  • pymc>=5.0 (Bayesian workflows)
  • arviz>=0.16 (Bayesian diagnostics/plots)

Example Usage

The example below is designed to be runnable end-to-end: it generates synthetic data, checks assumptions, runs an independent-samples t-test with effect size, performs power analysis, and prints an APA-style result string.

python
import numpy as np
import pandas as pd
import pingouin as pg

from statsmodels.stats.power import tt_ind_solve_power

# If your repo provides this module, use it; otherwise comment it out.
from scripts.assumption_checks import comprehensive_assumption_check

# ----------------------------
# 1) Create example dataset
# ----------------------------
rng = np.random.default_rng(7)
n_a, n_b = 50, 52

group_a = rng.normal(loc=75, scale=9, size=n_a)
group_b = rng.normal(loc=69, scale=9, size=n_b)

df = pd.DataFrame({
    "score": np.r_[group_a, group_b],
    "group": ["A"] * n_a + ["B"] * n_b
})

# ----------------------------
# 2) Assumption checks
# ----------------------------
assump = comprehensive_assumption_check(
    data=df,
    value_col="score",
    group_col="group",
    alpha=0.05
)
print("Assumption check summary:")
print(assump["summary"] if "summary" in assump else assump)

# ----------------------------
# 3) Run test + effect size
# ----------------------------
res = pg.ttest(group_a, group_b, correction="auto")  # Welch if needed
t_stat = float(res["T"].iloc[0])
dfree = float(res["dof"].iloc[0])
pval = float(res["p-val"].iloc[0])
d = float(res["cohen-d"].iloc[0])
ci_low, ci_high = res["CI95%"].iloc[0]

# ----------------------------
# 4) Power analysis (planning)
# ----------------------------
n_required = tt_ind_solve_power(
    effect_size=0.5, alpha=0.05, power=0.80, ratio=1.0, alternative="two-sided"
)

# ----------------------------
# 5) APA-style reporting string
# ----------------------------
m_a, sd_a = group_a.mean(), group_a.std(ddof=1)
m_b, sd_b = group_b.mean(), group_b.std(ddof=1)

apa = (
    f"Group A (n = {n_a}, M = {m_a:.2f}, SD = {sd_a:.2f}) and "
    f"Group B (n = {n_b}, M = {m_b:.2f}, SD = {sd_b:.2f}) differed, "
    f"t({dfree:.0f}) = {t_stat:.2f}, p = {pval:.3f}, d = {d:.2f}, "
    f"95% CI [{ci_low:.2f}, {ci_high:.2f}]."
)

print("\nAPA-style result:")
print(apa)

print(f"\nPlanning note: to detect d = 0.50 with 80% power, "
      f"required n per group ≈ {n_required:.0f}.")

Implementation Details

1) Test Selection Logic (Conceptual)

Use references/test_selection_guide.md as the primary decision aid. The selection is typically driven by:

  • Design: independent vs. paired/repeated measures; number of groups (2 vs. 3+).
  • Outcome type: continuous, ordinal, binary/categorical counts.
  • Distribution/assumptions:
    • approximate normality (overall or within groups),
    • homogeneity of variance (between-group comparisons),
    • linearity and residual behavior (regression),
    • outliers and leverage points.

Common mappings:

  • Two independent groups, continuous outcome:
    • normal + equal variances → Student’s t-test
    • normal + unequal variances → Welch’s t-test
    • non-normal/ordinal → Mann–Whitney U
  • 3+ independent groups:
    • normal + equal variances → one-way ANOVA
    • unequal variances → Welch/Brown–Forsythe ANOVA
    • non-normal/ordinal → Kruskal–Wallis
  • Relationships:
    • continuous–continuous → Pearson (normal) or Spearman (rank/non-normal)
    • continuous outcome + predictors → linear regression
    • binary outcome + predictors → logistic regression
2) Assumption Checks and Diagnostics

The automated workflow in scripts/assumption_checks.py (referenced in the original documentation) is expected to cover:

  • Outlier detection: IQR rule and/or z-score thresholds.
  • Normality: Shapiro–Wilk test plus Q–Q plot.
  • Homogeneity of variance: Levene’s test plus group boxplots.
  • Linearity (regression): residuals vs fitted; optional component-plus-residual checks.

Key parameter:

  • alpha (default commonly 0.05): decision threshold for assumption tests.

Recommended remedies (see references/assumptions_and_diagnostics.md):

  • Normality violations: consider robust/non-parametric tests, transformations, or bootstrap CIs.
  • Variance heterogeneity: Welch variants; robust standard errors in regression.
  • Linearity violations: transformations, polynomial terms, splines/GAMs.
3) Effect Sizes and Uncertainty

Effect sizes should be reported alongside inferential results (see references/effect_sizes_and_power.md):

  • t-tests: Cohen’s d (or Hedges’ g for small samples)
  • ANOVA: partial η² (or ω² depending on convention)
  • correlation: r (already an effect size)
  • chi-square: Cramér’s V
  • regression: R² / adjusted R², plus standardized coefficients where appropriate

Always prefer confidence intervals (frequentist) or credible intervals (Bayesian) to communicate precision.

4) Power Analysis

Implemented via statsmodels.stats.power:

  • A priori power: solve for required n given target effect size, alpha, and desired power.
  • Sensitivity analysis: solve for detectable effect size given achieved n, alpha, and desired power.

Avoid “post-hoc power” computed from observed p-values; use sensitivity analysis instead.

5) APA-Style Reporting Requirements

Use references/reporting_standards.md to ensure inclusion of:

  • descriptive statistics (M, SD, n) per group/condition,
  • test statistic + df + exact p (or thresholded p where required),
  • effect size + CI,
  • assumption checks performed and any corrective actions,
  • post-hoc procedures and multiple-comparison corrections when applicable.

For Bayesian reporting (see references/bayesian_statistics.md), include:

  • priors (type and scale),
  • posterior summaries and credible intervals,
  • Bayes Factor (if used),
  • convergence diagnostics (e.g., R̂, ESS) and posterior predictive checks when relevant.
Show full SKILL.md (392 more words)Show less

When Not to Use

  • Do not proceed when required input files, identifiers, parameters, or context are missing — ask the user to provide them first.
  • Do not assume capabilities beyond this skill's declared scope when the user requests external operations or inferences.
  • Do not proceed without user confirmation when overwriting existing results, executing high-cost batch operations, or expanding task scope.

Required Inputs

FieldRequiredFormat/SourceExampleIf Missing
User task descriptionYesTextResearch question, writing goal, analysis objectiveStop and ask user to provide
Primary input materialDepends on taskText, file path, ID, table, or literaturePMID, PDF, CSV, DOCX, keywords, etc.Specify which material type is missing
Output preferenceNoTextLanguage, format, target journal, templateUse skill default format

Output Contract

  • Primary output: Structured result or target file aligned with this skill's objective.
  • Optional output: Intermediate check notes, issue list, supplementary suggestions, or generated file paths.
  • Format requirement: Unless the user specifies otherwise, prefer stable, reviewable Markdown or JSON; if the skill's bundled script requires a fixed format, use that format.
  • If partially complete: Must explicitly mark as PARTIAL and state which steps are completed and which remain.

Failure Handling

  • Missing critical input: Explicitly state which fields, files, or identifiers are missing and pause.
  • Script, template, or resource execution failure: Report the failing step, likely cause, and recovery suggestions — do not silently degrade.
  • Partial completion only: Return the verified portion first, then list remaining blockers and suggested next steps.

User Checkpoints

  • Before executing batch processing, overwriting files, long-running searches, or multi-stage generation, confirm scope and output format with the user.
  • Before proceeding when a key judgment is ambiguous, evidence is insufficient, or the workflow is entering the next stage, confirm with the user.

Input Validation

This skill accepts requests that match the documented purpose of statistical-analysis and include enough context to complete the workflow safely.

Do not continue the workflow when the request is out of scope, missing a critical input, or would require unsupported assumptions. Instead respond:

statistical-analysis only handles its documented workflow. Please provide the missing required inputs or switch to a more suitable skill.

Quick Validation

  • Check that key scripts, templates, or reference file paths this skill depends on exist.
  • Check that the final output contains the core fields, sections, or files specified for this task.
  • Check that results clearly mark assumptions, limitations, and incomplete items.

© aipoch, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 7 other files (scripts, references) in scientific-skills/Data Analysis/statistical-analysis of aipoch/medical-research-skills.

  • SKILL.md
  • POLISH_CHANGELOG.md
  • eval_report_statistical-analysis_result.json
  • references/assumptions_and_diagnostics.md
  • references/bayesian_statistics.md
  • references/effect_sizes_and_power.md
  • references/reporting_standards.md
  • scripts/assumption_checks.py

Open the folder on GitHubat commit 686e09d

Compare with similar skills

Statistical Analysis next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Statistical Analysis compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Statistical Analysis this skillaipoch/medical-research-skills2k—~2.8kAutomated safety check: PassMIT
Statistical Analysisspacering-net/codeg3.8k4 repos~5kAutomated safety check: PassMIT
Statistical Powerspacering-net/codeg3.8k2 repos~3.6kAutomated safety check: NotesMIT
Data Scientistdavila7/claude-code-templates32k9 repos~2.6kAutomated safety check: PassMIT
Statistical Analystalirezarezvani/claude-skills28k1 repos~2.5kAutomated safety check: PassMIT
Experimentation Analyticsrampstackco/claude-skills9401 repos~8.9kAutomated safety check: PassMIT

Similar skills

  • Statistical Analysis

    spacering-net/codeg

    Guided statistical analysis for research data - test selection, assumption checking, effect sizes, power analysis, Bayesian alternatives, and APA-formatted reporting.

    3.8k GitHub starsUsed in 4 repos~5k tokens
    Data & AnalyticsAuto-check passed
  • Statistical Power

    spacering-net/codeg

    Sample-size and statistical power calculations for planning studies.

    3.8k GitHub starsUsed in 2 repos~3.6k tokens
    Data & AnalyticsAuto-check: notes
  • Data Scientist

    davila7/claude-code-templates

    Expert data scientist for advanced analytics, machine learning, and statistical modeling.

    32k GitHub starsUsed in 9 repos~2.6k tokens
    Data & AnalyticsAuto-check passed
  • Statistical Analyst

    alirezarezvani/claude-skills

    Run hypothesis tests, analyze A/B experiment results, calculate sample sizes, and interpret statistical significance with effect sizes.

    28k GitHub starsUsed in 1 repo~2.5k tokens
    Data & AnalyticsAuto-check passed
  • Experimentation Analytics

    rampstackco/claude-skills

    How to read experiment results without fooling yourself. An agent skill from rampstackco/claude-skills.

    940 GitHub starsUsed in 1 repo~8.9k tokens
    Data & AnalyticsAuto-check passed
  • Quantitative Analysis

    poemswe/co-researcher

    You must use this when selecting statistical tests, interpreting effect sizes, or conducting power analysis.

    130 GitHub stars~841 tokensUpdated today
    Data & AnalyticsAuto-check passed

More from aipoch/medical-research-skills

All 567 skills in this repo
  • Academic Poster Generator

    aipoch/medical-research-skills

    Complete workflow for generating academic research posters from PDF literature; use when you need to extract paper content from PDFs and produce a LaTeX-based poster…

    2k GitHub stars~2.2k tokensUpdated 21 days ago
    Auto-check passed
  • Diagnostic Study Quality Assessment Quadas

    aipoch/medical-research-skills

    Analyzes clinical diagnostic accuracy studies for bias using the QUADAS-2 tool.

    2k GitHub stars~1.4k tokensUpdated 21 days ago
    Auto-check passed
  • Exploratory Data Analysis

    aipoch/medical-research-skills

    Perform comprehensive exploratory data analysis on scientific data files across 200+ file formats.

    2k GitHub stars~3.7k tokensUpdated 21 days ago
    Auto-check passed
  • Iso Certification

    aipoch/medical-research-skills

    A toolkit for preparing ISO 13485:2016 certification documentation for medical device QMS.

    2k GitHub stars~1.8k tokensUpdated 21 days ago
    Auto-check passed
  • Journal Skills

    aipoch/medical-research-skills

    Recommends target journals for manuscript submission by analyzing the paper topic/abstract and the journal distribution of similar PubMed literature; use when users ask for journal…

    2k GitHub stars~1.7k tokensUpdated 21 days ago
    Auto-check passed
  • Latex Posters

    aipoch/medical-research-skills

    Creates academic-poster writing packages for LaTeX using beamerposter, tikzposter, or baposter.

    2k GitHub stars~1.3k tokensUpdated 21 days ago
    Auto-check passed

Questions about Statistical Analysis

What does Statistical Analysis do?

Guided statistical analysis for test selection, assumption checks, power analysis, and APA-style reporting. Statistical Analysis is an agent skill from aipoch/medical-research-skills. Guided statistical analysis for test selection, assumption checks, power analysis, and APA-style reporting.

When should I use Statistical Analysis?

Statistical Analysis fits situations like: tasks that involve Statistics; tasks that involve Experimental design.

How do I install Statistical Analysis in Claude Code?

Run `npx skills add aipoch/medical-research-skills --skill statistical-analysis -a claude-code`. Or copy the skill folder (scientific-skills/Data Analysis/statistical-analysis in aipoch/medical-research-skills) into .claude/skills/statistical-analysis in your project. Claude Code loads it when a task matches its description.

How do I install Statistical Analysis in Codex?

Run `npx skills add aipoch/medical-research-skills --skill statistical-analysis -a codex`. Or copy the skill folder (scientific-skills/Data Analysis/statistical-analysis in aipoch/medical-research-skills) into .agents/skills/statistical-analysis in your project. Codex loads it when a task matches its description.

Can I use Statistical Analysis in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add aipoch/medical-research-skills --skill statistical-analysis -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/statistical-analysis, .gemini/skills/statistical-analysis, .github/skills/statistical-analysis and .opencode/skills/statistical-analysis in your project.

What does Statistical Analysis need to run?

Going by SKILL.md and its folder, Statistical Analysis needs Python for the scripts in its folder. Our summary lists: Python 3.

Does Statistical Analysis access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Statistical Analysis safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Statistical Analysis use?

Statistical Analysis is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Statistical Analysis use?

About 2.8k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 17k tokens, read only when the agent opens those files.

What are the alternatives to Statistical Analysis?

Skills that share tags, products or a category with Statistical Analysis: Statistical Analysis (spacering-net/codeg, 3.8k stars), Statistical Power (spacering-net/codeg, 3.8k stars), Data Scientist (davila7/claude-code-templates, 32k stars) and Statistical Analyst (alirezarezvani/claude-skills, 28k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Statistical Analysis?

aipoch (a GitHub organization) maintains it in aipoch/medical-research-skills, which has 1,974 GitHub stars. The repository holds 567 skills in this directory. The repository was last updated on September 17, 2026.

Source: aipoch/medical-research-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.