stat-analyze-distribution
Characterize the distribution of one or more numeric variables with summary statistics, normality tests, and diagnostic plots.
- License 许可
- MIT
- 最近更新
- 2026-11-03
- Stars
- ★ 4
- Forks
- 1
01 前言 Front Matter
- name
- stat-analyze-distribution
- description
- Characterize the distribution of one or more numeric variables with summary statistics, normality tests, and diagnostic plots.
02 资源文件 3
- 参考文档agents/claude.yaml326 B
- 参考文档agents/openai.yaml327 B
- 参考文档config.yaml319 B
03 SKILL.md 正文
Skill: Statistical Distribution Analysis
Use When
- User wants to understand the distribution of a numeric variable before choosing a statistical test
- User needs to check whether data is approximately normally distributed
- User wants summary statistics (mean, median, variance, skewness, kurtosis) for one or more columns
- User is preparing an EDA (exploratory data analysis) report
Inputs
- Required:
- Data table (CSV or TSV) with at least one numeric column
- Optional:
- Column(s) to analyze (default: all numeric columns)
- Normality test method:
shapiro(default, n ≤ 5000) oranderson(Anderson-Darling, recommended for larger samples) - Output directory (default:
./dist_output)
Workflow
- Read the data file; identify numeric columns to analyze (or use user-specified subset).
- For each target column, compute summary statistics: mean, median, standard deviation, variance, min, max, 25th/75th percentiles, skewness, kurtosis.
- Run normality test:
- Shapiro-Wilk when n ≤ 5000
- Anderson-Darling when n > 5000 Report test statistic, p-value (or significance level where applicable), and sample size.
- Classify each variable as
approximately_normalornon_normalusing both test output and Q-Q plot inspection (do not classify from hypothesis-test p-value alone). - Generate plots for each variable: histogram with density overlay, Q-Q plot.
- If multiple variables, produce a summary table across all variables.
- Write summary statistics table (TSV) and plots (PDF) to output directory.
- Save an executable analysis script (
analysis_code.pyoranalysis_code.R) and software version manifest (session_info.txt) used to produce results. - Report which variables appear normally distributed and suggest appropriate downstream tests.
Output Contract
- Summary statistics table (TSV): variable, n, mean, median, sd, variance, skewness, kurtosis, normality_test, test_statistic, p_value_or_significance, normality_call
- Histogram + density plot per variable (PDF)
- Q-Q plot per variable (PDF)
- Reproducibility artifacts:
analysis_code.pyoranalysis_code.R, plussession_info.txt
Limits
- Shapiro-Wilk test is unreliable for very large n; use Anderson-Darling and visual diagnostics instead.
- Avoid one-sample KS tests against a fitted normal distribution unless a corrected procedure is explicitly implemented.
- Normality tests have low power for small samples (n < 20); visual inspection of Q-Q plot is recommended.
- Does not handle categorical or date columns; these are silently skipped.
- Common failure: non-numeric columns passed explicitly cause an error — pre-filter if needed.
04 同仓库更多 Skills
structured-intelligence-skill-creator
Create or update repository skills that conform to local templates, provider metadata requirements, registry rules, and validation workflows.
stat-survival-analysis
Estimate and compare survival functions using Kaplan-Meier curves and log-rank test, with optional Cox proportional hazards regression.
stat-pca
Perform PCA on a numeric data matrix to reduce dimensionality, visualize sample structure, and identify top contributing features.
stat-pairwise-correlation
Compute pairwise correlations and significance tests across all numeric variables, and produce a correlation heatmap.
stat-nonlinear-embedding
Embed high-dimensional data into 2D using t-SNE or UMAP for exploratory visualization of sample or cell relationships.
stat-logistic-regression
Fit a logistic regression model for binary outcomes, report odds ratios and model performance (AUC-ROC, confusion matrix).