agentleFS
Scientific-ToolingScientific-Tooling/structured-intelligence/skills/stat-pairwise-correlation/SKILL.md

stat-pairwise-correlation

Skill4 starsChanged 12 days agoMITView on GitHub

Compute pairwise correlations and significance tests across all numeric variables, and produce a correlation heatmap.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read the data matrix; keep only numeric columns.

    line 27
  2. Distinctive:

    Write correlation matrix (TSV), adjusted p-value matrix (TSV), and plots (PDF) to output directory.

    line 34

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
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, or kendall
    • Multiple-testing correction method: fdr (Benjamini-Hochberg, default) or bonferroni
    • Significance threshold for highlighting (default: 0.05)
    • Output directory (default: ./corr_output)

Workflow

  1. Read the data matrix; keep only numeric columns.
  2. Compute the full pairwise correlation matrix using the specified method.
  3. Compute p-values for each pair using the appropriate test (Pearson: t-distribution; Spearman/Kendall: permutation or asymptotic).
  4. Apply multiple-testing correction across all variable pairs.
  5. Generate a correlation heatmap: color-coded by correlation coefficient, asterisks for significant pairs (adjusted p < threshold).
  6. Generate a scatter plot matrix (pairs plot) for datasets with ≤ 10 variables.
  7. Report the top 20 strongest positive and top 20 strongest negative correlations.
  8. Write correlation matrix (TSV), adjusted p-value matrix (TSV), and plots (PDF) to output directory.
  9. Save the executable analysis script (analysis_code.py or analysis_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.py or analysis_code.R, plus session_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.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.