stat-pairwise-correlation
Compute pairwise correlations and significance tests across all numeric variables, and produce a correlation heatmap.
- License 许可
- MIT
- 最近更新
- 2026-11-03
- Stars
- ★ 4
- Forks
- 1
01 前言 Front Matter
- name
- stat-pairwise-correlation
- description
- Compute pairwise correlations and significance tests across all numeric variables, and produce a correlation heatmap.
02 资源文件 3
- 参考文档agents/claude.yaml328 B
- 参考文档agents/openai.yaml329 B
- 参考文档config.yaml306 B
03 SKILL.md 正文
Skill: Pairwise Correlation Analysis
Use When
- User wants to scan for linear or monotonic relationships among multiple numeric variables
- User needs a correlation matrix with p-values for gene expression, neural activity, or metabolomics data
- User wants to identify highly correlated features before modeling (collinearity check)
- User is building a co-expression or co-activity network
Inputs
- Required:
- Data matrix (CSV or TSV): rows = observations, columns = numeric variables
- Optional:
- Correlation method:
pearson(default),spearman, orkendall - Multiple-testing correction method:
fdr(Benjamini-Hochberg, default) orbonferroni - Significance threshold for highlighting (default:
0.05) - Output directory (default:
./corr_output)
- Correlation method:
Workflow
- Read the data matrix; keep only numeric columns.
- Compute the full pairwise correlation matrix using the specified method.
- Compute p-values for each pair using the appropriate test (Pearson: t-distribution; Spearman/Kendall: permutation or asymptotic).
- Apply multiple-testing correction across all variable pairs.
- Generate a correlation heatmap: color-coded by correlation coefficient, asterisks for significant pairs (adjusted p < threshold).
- Generate a scatter plot matrix (pairs plot) for datasets with ≤ 10 variables.
- Report the top 20 strongest positive and top 20 strongest negative correlations.
- Write correlation matrix (TSV), adjusted p-value matrix (TSV), and plots (PDF) to output directory.
- Save the executable analysis script (
analysis_code.pyoranalysis_code.R) and software version manifest (session_info.txt) used to produce results.
Output Contract
- Correlation matrix (TSV): variable × variable, values = correlation coefficients
- Adjusted p-value matrix (TSV): variable × variable, values = corrected p-values
- Correlation heatmap (PDF)
- Pairs plot (PDF, only if ≤ 10 variables)
- Top correlations summary table (TSV): var1, var2, correlation, p_value, adj_p_value
- Reproducibility artifacts:
analysis_code.pyoranalysis_code.R, plussession_info.txt
Limits
- Pearson correlation assumes linearity; use Spearman or Kendall for non-linear monotonic relationships or ordinal data.
- Correlation does not imply causation.
- Kendall's tau is slow for n > 10000; Spearman is preferred for large samples.
- Common failure: constant or near-constant columns produce undefined correlations — remove before running.
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-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).
stat-learn-bayesian-network
Learn the structure and conditional probabilities of a Bayesian network from observational data for causal discovery or dependency modeling.