data-analysis
БесплатноБез исполняемых скриптовНе проверенConduct exploratory data analysis and statistical testing with test selection guidance. Use when exploring datasets, selecting statistical tests, performing…
от ChicagoHAI★ 164 звезды на GitHubОб этом скилле
Data Analysis
Guidance for exploratory data analysis and statistical testing.
When to Use
- Exploring new datasets
- Selecting appropriate statistical tests
- Performing power analysis
- Reporting results in papers
- Validating experimental results
Exploratory Data Analysis (EDA)
EDA Workflow
- Load and Inspect: Basic data structure
- Summarize: Descriptive statistics
- Visualize: Distributions and relationships
- Identify Issues: Missing data, outliers
- Document Findings: Key insights
Initial Inspection
# Basic checks
df.shape # Dimensions
df.dtypes # Data types
df.head() # First rows
df.describe() # Summary stats
df.isnull().sum() # Missing values
Key Questions to Answer
| Question | What to Check |
|---|---|
| What's the size? | Rows, columns, data types |
| Any missing data? | Null counts, patterns |
| What's the distribution? | Histograms, descriptive stats |
| Any outliers? | Box plots, z-scores |
| Any relationships? | Correlations, scatter plots |
| Any patterns? | Trends, clusters, groups |
Visualization Guide
| Data Type | Visualization |
|---|---|
| Single continuous | Histogram, density plot, box plot |
| Single categorical | Bar chart, pie chart |
| Two continuous | Scatter plot, line plot |
| Two categorical | Grouped bar chart, heatmap |
| Continuous + categorical | Box plot by group, violin plot |
| Time series | Line plot with time axis |
Statistical Test Selection
Decision Tree
Question: What are you trying to do?
│
├─ Compare groups
│ │
│ ├─ How many groups?
│ │ ├─ 2 groups → See "Two Group Comparisons"
│ │ └─ 3+ groups → See "Multiple Group Comparisons"
│ │
│ └─ Related or independent?
│ ├─ Independent (different subjects)
│ └─ Related (same subjects, before/after)
│
├─ Examine relationships
│ ├─ Two variables → Correlation, regression
│ └─ Multiple variables → Multiple regression
│
└─ Test proportions
└─ Chi-square test
Two Group Comparisons
| Data Type | Independent Groups | Related Groups |
|---|---|---|
| Normal | Independent t-test | Paired t-test |
| Non-normal | Mann-Whitney U | Wilcoxon signed-rank |
Multiple Group Comparisons
| Data Type | Independent Groups | Related Groups |
|---|---|---|
| Normal | One-way ANOVA | Repeated measures ANOVA |
| Non-normal | Kruskal-Wallis | Friedman test |
Checking Assumptions
Normality Tests:
- Shapiro-Wilk (n < 50)
- Kolmogorov-Smirnov (n ≥ 50)
- Visual: Q-Q plot
Homogeneity of Variance:
- Levene's test
- Visual: Box plots by group
Independence:
- By experimental design
- Durbin-Watson (for residuals)
When Assumptions Fail
| Violation | Solution |
|---|---|
| Non-normality | Non-parametric test, transformation |
| Unequal variance | Welch's t-test, transformation |
| Non-independence | Mixed-effects model |
| Outliers | Robust methods, removal (with justification) |
Effect Sizes
Why Effect Sizes Matter
- p-values tell you if effect exists, not how big
- Effect sizes quantify the magnitude
- Required for power analysis
- Better for meta-analysis
Common Effect Sizes
| Measure | Context | Interpretation |
|---|---|---|
| Cohen's d | Two means | 0.2=small, 0.5=medium, 0.8=large |
| Pearson's r | Correlation | 0.1=small, 0.3=medium, 0.5=large |
| Eta-squared | ANOVA | 0.01=small, 0.06=medium, 0.14=large |
| Odds ratio | Categorical | 1.5=small, 2.5=medium, 4=large |
Computing Effect Sizes
# Cohen's d for two groups
import numpy as np
def cohens_d(group1, group2):
n1, n2 = len(group1), len(group2)
var1, var2 = np.var(group1, ddof=1), np.var(group2, ddof=1)
pooled_std = np.sqrt(((n1-1)*var1 + (n2-1)*var2) / (n1+n2-2))
return (np.mean(group1) - np.mean(group2)) / pooled_std
Power Analysis
Key Concepts
| Term | Definition |
|---|---|
| Power | Probability of detecting true effect (1-β) |
| α (alpha) | False positive rate (typically 0.05) |
| β (beta) | False negative rate (typically 0.20) |
| Effect size | Magnitude of effect |
| Sample size | Number of observations |
Power Analysis Uses
- A priori: Before study, determine needed sample size
- Post hoc: After study, calculate achieved power
- Sensitivity: Given n and power, what effect detectable?
Sample Size Calculation
from statsmodels.stats.power import TTestIndPower
analysis = TTestIndPower()
# Sample size for t-test
n = analysis.solve_power(
effect_size=0.5, # Cohen's d
alpha=0.05, # Significance level
power=0.80, # Desired power
ratio=1.0, # n2/n1
alternative='two-sided'
)
Power Guidelines
| Power | Interpretation |
|---|
Установить data-analysis в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл data-analysis?
Conduct exploratory data analysis and statistical testing with test selection guidance. Use when exploring datasets, selecting statistical tests, performing power analysis, or preparing results for publication.
Как установить скилл data-analysis?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл data-analysis запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic