/medistat-table1:clinical-table1from medistat-table1
Generates publishable Table 1 (baseline characteristics comparison) from clinical .xlsx/.csv data. Supports RCT, cohort, case-control, and other designs with automatic p-value policy (CONSORT 2010 for RCT), normality-based statistics, SMD color coding, and simultaneous HTML/Word/LaTeX output.
Ships in medistat-table1. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
의학연구 tabular 데이터(.xlsx/.csv)에서 publishable Table 1 한 세트 (HTML + Word + LaTeX)를 한 번에 생성한다. 행은 관찰 단위(환자·내원·병변 등), 열은 변수, 그리고 사용자는 비교 대상이 될 grouping variable(예: 배정군, 노출군, case/control)을 지정한다.
가설검정 본분석, 생존분석, Cox/로지스틱 회귀, propensity score matching은 본 스킬의 대상이 아니다. 그쪽은 survival-analysis나 다른 분석 도구를 안내하라.
patient_id, name, RRN 등)은 자동 감지 또는 --id-cols로 명시하여 표에서 제외.clinical-eda-report로 점검해야 한다.다음 항목을 사용자 메시지에서 추출하거나, 없으면 한 번에 묻는다.
RCT / Prospective cohort / Retrospective cohort / Case-control / Cross-sectional / Registry / Single-arm prospective / Othertreatment_arm, case_control, responderstratified-vars (RCT의 stratified randomization 변수), exclude-vars (outcome 변수 등 분석에서 제외), non-normal-vars (강제 median[IQR]), normal-vars (강제 mean±SD)사용자가 명시했으면 그대로 사용. 명시 안 했고 디자인이 명백히 추론 가능하면 (예: "ㅇㅇ RCT 데이터") 그렇게 가정하고 진행. 둘 다 불명이면 ask_user_input_v0로 한 번 묻고 끝낸다.
scripts/run_table1.py를 실행한다. 직접 pandas 코드를 새로 짜지 마라.
python3 scripts/run_table1.py \
--input <입력 파일 절대경로> \
--output-dir <출력 폴더 절대경로> \
--group-var <grouping 변수명> \
--study-design "<RCT|Prospective cohort|...|Other 자유텍스트>" \
[--sheet <xlsx 시트명>] \
[--id-cols patient_id,name,RRN] \
[--exclude-vars mace,time_to_mace_months,cv_death,recurrent_mi,stroke,hf_hospitalization,all_cause_death] \
[--stratified-vars site,age_group] \
[--non-normal-vars TG,CRP] \
[--normal-vars age] \
[--group-order GLP-1,Placebo] \
[--p-value-policy auto|always|never] \
[--formats html,docx,latex]
기본 정책:
--p-value-policy auto: RCT면 p-value 숨김, 나머지는 표시--formats: 기본 모두 (html, docx, latex)--id-cols 미지정 시 정규식 (?i)(id|name|rrn|registration|patient|chart|mrn|phone|address|birth) 매칭 컬럼은 자동 제외Outcome 변수 처리 — Table 1은 baseline만 다뤄야 하므로 outcome 변수는 명시적으로 --exclude-vars에 넣어야 한다. 사용자가 outcome 컬럼을 잘 모르겠다고 하면, 컬럼명에서 outcome, mace, death, event, time_to_, follow, _3yr, _3y, _fu 같은 키워드를 가진 것들을 추론해 안내하라.
스크립트가 정상 종료하면 stdout 마지막 줄에 OK <html_path> <docx_path> <tex_path> 형태로 출력한다.
성공 시 사용자에게:
리포트 본문을 채팅에 다시 풀어 쓰지 말 것.
|skewness| > 1 (Bulmer's rule) 또는 known-skewed lab 변수명 매칭 → 비정규로 분류mean ± SD, 비정규 → median [Q1, Q3](m₁−m₂)/√((s₁²+s₂²)/2)); ≥3군에서는 max pairwise SMD를 표시n (%), 분모는 비결측 n(p₁−p₂)/√((p₁q₁+p₂q₂)/2)--stratified-vars로 지정하면 그 변수는 분포만 표시하고 비교 통계 없이 "by design" 표기. 행이 background-highlighted.booktabs (toprule, midrule, bottomrule)longtable (페이지 넘김 자동)xcolor 로 SMD 색 코딩pdflatex file.tex)\begin{longtable}...\end{longtable} 블록만 자기 논문에 import 가능pandas, numpy, scipy (표준)python-docx (Word 출력용; pip install python-docx)pdflatex 또는 Overleaf 업로드)Outcome 변수가 baseline 표에 들어감: 사용자가 outcome 변수를 --exclude-vars에 안 넣었을 때 흔히 발생. 메타데이터 박스에서 "분석 대상 변수 N개" 옆에 의심 변수 (_3yr, time_to_, event, death, mace 등 매칭)가 보이면 사용자에게 확인 요청.
ID 컬럼이 표에 unique 개수만 표시되는 변수로 잘못 들어감: 정규식 자동 감지가 작동하지만, 한국어 컬럼명 (예: "환자번호")은 못 잡으니 --id-cols로 명시.
큰 표본 (n > 10,000)에서 모든 p-value < 0.001: 정상. p-value의 한계 — SMD를 우선 보라고 footnote에 명시되어 있음. 사용자에게 해석 시 강조.
Stratified randomization 변수에 p-value가 잡혀서 0.05 미만이 나옴: --stratified-vars로 지정하지 않으면 발생. RCT 사용자에게 stratification 변수가 있었는지 확인할 것.
범주형에 결측을 별도 level로 보이고 싶다: 현재 v0.1.0은 available-case (결측은 분모에서 제외). 별도 옵션은 v0.2.0+ 로 계획.
위 한계는 HTML 푸터 / Word 푸터 / LaTeX footnote에 자동 포함된다.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
npx claudepluginhub jeonkh81/medistat-table1 --plugin medistat-table1