본문으로 건너뛰기
cccskills
무료GitHub에 공개

sample-correlation-analysis

Use when performing correlation analysis between two variables including Pearson and Spearman correlation methods. Supports command-line parameter input, automatic data format detection, parameter validation, result directory creation, and CSV or TXT format result export.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(12)

  • SKILL.md5.0 KB
  • eval_report_sample-correlation-analysis_result.json15.6 KB
  • references/algorithm.md5.6 KB
  • references/cli-guide.md6.8 KB
  • references/troubleshooting.md8.5 KB
  • scripts/functions.R4.3 KB
  • scripts/main.R3.2 KB
  • scripts/run_analysis.R3.4 KB
  • scripts/utils.R3.1 KB
  • tests/data/sample_correlation_1.csv110 B
  • tests/data/sample_correlation_2.csv69.2 KB
  • tests/data/sample_correlation_3.csv6.0 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Source: https://github.com/aipoch/medical-research-skills

Correlation Analysis

Use this skill to run correlation analysis on two variables from a tabular data file.

Use This Skill When

  • You need Pearson or Spearman correlation between two variables stored either as columns or as first-column row labels.
  • You need a command-line workflow with parameter validation.
  • You need standardized output files in CSV or TXT format.

Primary Command

Rscript scripts/main.R \
  --data_file <input_file> \
  --method <pearson|spearman> \
  --x_var <variable_name> \
  --y_var <variable_name> \
  --output_dir <output_dir>

Prerequisites

  • Rscript is available in the shell.
  • Required R packages: optparse, data.table.
  • Install missing packages with Rscript -e 'install.packages(c("optparse", "data.table"), repos="https://cloud.r-project.org")'.

Core Arguments

ArgumentRequiredDescription
--data_fileYesInput data file in CSV, TXT, or TSV format
--methodNoCorrelation method: pearson or spearman. Default pearson
--x_varNoFirst variable name. It can match a column name or a first-column row label. Default variable1
--y_varNoSecond variable name. It can match a column name or a first-column row label. Default variable2
--output_dirNoOutput directory, default ./Correlation_Results
--alternativeNotwo.sided, less, or greater. Default two.sided
--conf_levelNoConfidence level between 0 and 1, default 0.95
--output_formatNocsv or txt, default csv
--output_prefixNoOutput filename prefix, default correlation

Input Requirements

  • The input file must contain both target variables.
  • Both variables must contain numeric values.
  • If the first column stores variable names and the remaining columns are samples, the script automatically reads variables by row label.
  • Rows with missing values in either variable are excluded.
  • At least 3 complete observation pairs are needed.

Example input:

variable1,variable2
10.2,8.5
11.5,9.2
9.8,7.9

Minimal Workflow

  1. Confirm the input file exists and variable names are correct.
  2. Run scripts/main.R with the requested method and variable names.
  3. Check the output directory for result files under table/.

If you omit --data_file, the script exits with SKILL_MISSING_INPUT.

Outputs

Expected output structure:

<output_dir>/
├── table/
├── figure/
└── data/

Primary result file:

  • table/<output_prefix>_<method>.csv
  • table/<output_prefix>_<method>.txt

Result fields include:

  • method
  • correlation
  • statistic
  • p_value
  • conf_low
  • conf_high
  • sample_size
  • x_variable
  • y_variable
  • variable_orientation

Choose the Method

  • Use pearson for linear relationships between continuous variables.
  • Use spearman for monotonic relationships, non-normal data, or outlier-prone data.

Read These Files When Needed

NeedFile
Statistical details and assumptionsreferences/algorithm.md
More CLI examplesreferences/cli-guide.md
Error diagnosisreferences/troubleshooting.md
Main execution entry pointscripts/main.R
Sample test datatests/data/

Quick Examples

Pearson:

Rscript scripts/main.R \
  --data_file tests/data/sample_correlation_1.csv \
  --method pearson \
  --x_var variable1 \
  --y_var variable2 \
  --output_dir tests/output_pearson

Spearman:

Rscript scripts/main.R \
  --data_file tests/data/sample_correlation_3.csv \
  --method spearman \
  --x_var "Activated CD8 T cell" \
  --y_var "Central memory CD8 T cell" \
  --output_dir tests/output_spearman

Validation

Rscript scripts/main.R --help
Rscript scripts/main.R \
  --data_file tests/data/sample_correlation_1.csv \
  --method pearson \
  --x_var variable1 \
  --y_var variable2 \
  --output_dir tests/validation_output

After running analysis, verify that tests/validation_output/table/correlation_pearson.csv exists.

Common Errors

  • SKILL_FILE_NOT_FOUND: Input file path is wrong or inaccessible.
  • SKILL_MISSING_COLUMNS: One or both requested variables are missing.
  • SKILL_INVALID_DATA: Input data is malformed or unsuitable for analysis.
  • SKILL_INVALID_PARAMETER: An argument value is invalid.
  • SKILL_INSUFFICIENT_DATA: Too few complete observations remain after filtering.
  • SKILL_DEPENDENCY_MISSING: A required R package such as optparse or data.table is unavailable.

If the issue is not obvious, read references/troubleshooting.md.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Transform lengthy academic papers into concise, structured 250-word abstracts.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aipoch/medical-research-skills2천2026년 9월 17일 업데이트

Precision editing tool that reduces abstract word count through intelligent compression techniques, maintaining scientific rigor while meeting strict journal and conference requirements.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aipoch/medical-research-skills2천2026년 9월 17일 업데이트

Refines long medical academic texts into SCI-style unstructured Chinese and English abstracts; use when you need to condense drafts/reports/summaries into bilingual abstracts and generate Summary_Report.md.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aipoch/medical-research-skills2천2026년 9월 17일 업데이트

Generates submission-ready Elsevier/SCI Highlights from manuscript text or extracted PDF/DOCX/TXT content. Use when a user needs 3-5 concise, evidence-grounded highlight bullets for a research paper, review, meta-analysis, case report, or bioinformatics manuscript.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aipoch/medical-research-skills2천2026년 9월 17일 업데이트

Generates complete FAERS pharmacovigilance study designs for multi-drug or class-level safety comparison inside one predefined SOC or AE family using active comparators, disproportionality analysis, subgroup characterization, and reviewer-facing evidence control.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aipoch/medical-research-skills2천2026년 9월 17일 업데이트

Analyze data with `adme-property-predictor` using a reproducible workflow, explicit validation, and structured outputs for review-ready interpretation.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aipoch/medical-research-skills2천2026년 9월 17일 업데이트

aipoch의 스킬 모두 보기

이 스킬의 문제 신고