statistical-analysis

Guides statistical test selection, assumption checking, power analysis, and APA-formatted reporting.

Updated Oct 7, 2022
One-click install
npx skills add https://github.com/tamagusko/linux-cfg --skill statistical-analysis-tamagusko
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: statistical-analysis
Source: https://github.com/tamagusko/linux-cfg/tree/main/dotfiles/claude/skills/statistical-analysis
Command: npx skills add https://github.com/tamagusko/linux-cfg --skill statistical-analysis-tamagusko

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires numpy, pandas, scipy, matplotlib, seaborn, statsmodels, pingouin, pymc, arviz, and includes scripts (resource) and references (resource) components.

What problem does it solve? Choosing the right statistical test, verifying its assumptions, and reporting results correctly is error-prone for researchers. This Skill provides a guided workflow for hypothesis testing, effect size calculation, power analysis, and APA-style reporting so analyses are methodologically sound and publication-ready. ## Core Features & Use Cases - Test Selection and Assumption Checking: Decision trees for choosing t-tests, ANOVA, chi-square, regression, or non-parametric alternatives, plus an automated assumption_checks.py module for normality, homogeneity of variance, outliers, and linearity diagnostics. - Effect Sizes, Power Analysis, and Bayesian Methods: Compute Cohen's d, eta-squared, Cramér's V with confidence intervals, run a priori power analyses, and fit Bayesian models with PyMC including Bayes Factors and credible intervals. - Use Case: A graduate student comparing exam scores across three teaching conditions uses the test selection guide to pick one-way ANOVA, validates assumptions with the provided script, runs the analysis with pingouin, and writes up results using the APA report templates. ## Quick Start Ask the assistant to help you choose and run the appropriate statistical test for your dataset, check its assumptions, and report the results in APA format.

Frequently Asked Questions about statistical-analysis

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose the right statistical test for my data?

Test selection depends on your research question, number of groups, and data distribution. The included test selection guide maps scenarios to tests: independent t-test or Mann-Whitney for two groups, ANOVA or Kruskal-Wallis for three or more, and Pearson or Spearman for correlations.

How do I check normality and homogeneity of variance in Python?

Use the provided assumption_checks.py module, which runs Shapiro-Wilk tests for normality and Levene's test for homogeneity of variance. It also generates Q-Q plots, box plots, and outlier detection with IQR and z-score methods, plus recommendations when assumptions fail.

What Python libraries are used for statistical analysis here?

The workflow uses scipy.stats for core tests, statsmodels for regression and power analysis, pingouin for tests with built-in effect sizes, and pymc with arviz for Bayesian modeling. Matplotlib and seaborn handle diagnostic visualizations.

What should I do when statistical assumptions are violated?

For violated normality, use non-parametric alternatives like Mann-Whitney or Kruskal-Wallis, or transform the data. For unequal variances, use Welch's t-test or Welch's ANOVA. For regression non-linearity, add polynomial terms or use generalized additive models.

When should I use Bayesian statistics instead of frequentist tests?

Bayesian methods are preferable when you have prior information, want direct probability statements about hypotheses, have small samples, or need to quantify evidence for the null hypothesis. They provide credible intervals and Bayes Factors rather than p-values.

Is post-hoc power analysis recommended after a study?

Post-hoc power analysis is generally not recommended because observed power is a direct function of the p-value and adds no information. Instead, conduct a sensitivity analysis to determine the minimum detectable effect size given your sample, or report confidence intervals.