- name
SKILL.md
技能檔案保留在發布者的儲存庫中。
在終端機中貼上複製的指令。它會將這個 SKILL.md 安裝到對應的代理中。
npx skills add Aperivue/medsci-skills --skill cross-national -a cursor -y在終端機中貼上複製的指令。它會將這個 SKILL.md 安裝到對應的代理中。
npx skills add Aperivue/medsci-skills --skill cross-national -a claude-code -y在終端機中貼上複製的指令。它會將這個 SKILL.md 安裝到對應的代理中。
npx skills add Aperivue/medsci-skills --skill cross-national -a codex -y在終端機中貼上複製的指令。它會將這個 SKILL.md 安裝到對應的代理中。
npx skills add Aperivue/medsci-skills --skill cross-national -a grok -y在 Grok Bot 聊天中傳送複製的訊息。Bot 會從 GitHub 取得這個 SKILL.md,並加入你所有 Bot 共用的技能中。
Install this skill: https://github.com/Aperivue/medsci-skills/tree/HEAD/skills/cross-national來自發布者
/replicate-study's references/harmonization_knhanes_nhanes.csv/write-paper's references/paper_types/cross_national.md — writing template/analyze-stats's references/analysis_guides/survey_weighted.md — survey-weighted analysis guidereferences/chns_coding.md — CHNS files, merge keys, coding and warnings; read it when the design
includes China (3-country design)references/additional_variables.md — asthma, sleep, physical activity, diet, treatment and
non-HDL-cholesterol coding, plus composite-score (LE8) warnings; read it when the study uses any of themNever guess a variable name, dataset column name, or variable coding. If a mapping is uncertain,
output [VERIFY: variable_name] and ask the user to confirm it against the data dictionary.
KNHANES (single CSV):
Load CSV and keep every row — the age ≥20 (or per-protocol) restriction is applied to the design in step 3
Derive variables using KNHANES coding:
Set survey design on the full file, then restrict to the analytic domain:
des <- svydesign(id=~psu, strata=~kstrata, weights=~wt_itvex, nest=TRUE, data=df);
des_ad <- subset(des, age >= 20). Never filter rows before svydesign() — dropping them
changes the standard errors (see survey_weighted.md, subpopulation analysis)
NHANES (multiple CSVs):
Load and merge tables by SEQN (DEMO_J, DPQ_J, GHB_J, GLU_J, BMX_J, SMQ_J, ALQ_J, DIQ_J, MCQ_J, BPQ_J, BPXO_J)
Derive variables using NHANES coding. CRITICAL: NHANES data downloaded via R nhanesA package
uses TEXT LABELS, not numeric codes.
CHNS (3-country design): read references/chns_coding.md before preparing China data.
For EACH country independently:
svyglm on the whole sample), not by comparing
the subgroups' P values.Generate a side-by-side comparison:
Compare the countries with the ratio of their odds ratios, not with whether the directions agree: two estimates in the same direction can differ, and opposite directions can be compatible. With log odds ratios b₁, b₂ and their design-based standard errors SE₁, SE₂ from the two independent surveys, the ratio is exp(b₁ − b₂) with 95% CI exp(b₁ − b₂ ± 1.96·√(SE₁² + SE₂²)) and z = (b₁ − b₂)/√(SE₁² + SE₂²) (Altman & Bland, BMJ 2003;326:219).
Every number comes from executed code output (analysis_korea.R, analysis_us.R) — never an
invented p-value, effect size, confidence interval, or sample size.
{working_dir}/
├── cross_national_report.md — Study summary + comparison tables
├── variable_mapping.csv — Variable mapping with match status
├── analysis_korea.R — KNHANES analysis (self-contained)
├── analysis_us.R — NHANES analysis (self-contained)
├── results/
│ ├── table1_korea.csv
│ ├── table1_us.csv
│ ├── main_results_comparison.csv
│ └── subgroup_comparison.csv
└── manuscript_draft/ — Optional: Methods + Results draft
├── methods_draft.md
└── results_draft.md
Take every citation in the report or draft from /search-lit (confirmed DOI/PMID); mark any other
[UNVERIFIED - NEEDS MANUAL CHECK], and never generate references from memory.
references/chns_coding.md).Use when comparing an exposure-outcome association across countries with parallel national surveys (KNHANES, NHANES, CHNS). Harmonizes variables, runs parallel weighted analyses and builds comparison
---name: cross-nationaldescription: Use when comparing an exposure-outcome association across countries with parallel national surveys (KNHANES…---# skills/cross-national/SKILL.md總覽
Use when comparing an exposure-outcome association across countries with parallel national surveys (KNHANES, NHANES, CHNS). Harmonizes variables, runs parallel weighted analyses and builds comparison tables for 2-country (KR+US) or 3-country (KR+US+CN) designs.
常見問題
從發布者下載 skills/cross-national/SKILL.md,或複製路徑後開啟儲存庫。PlugMCP 只收錄這項技能,不代管檔案。
發布者將它存放在 https://github.com/Aperivue/medsci-skills。
Claude、Cursor、Codex 和 Grok Build 可以讀取你從發布者儲存庫加入的 SKILL.md。在聊天中傳送技能的 GitHub 資料夾連結,Grok Bot 就會安裝它。
Set survey design on the full file, then subset() the design object to the analytic domain
(e.g. RIDAGEYR >= 20): svydesign(id=~SDMVPSU, strata=~SDMVSTRA, weights=~WTMEC2YR, nest=TRUE).
The weight follows the files: the single-cycle _J tables above take WTMEC2YR; WTMECPRP goes
only with the pre-pandemic P_ files (P_DEMO, P_BMX, ...). A variable from the fasting
subsample (GLU_J LBXGLU, TRIGLY_J LBXTR/LBDLDL) takes the fasting weight instead: WTSAF2YR
(_J) or WTSAFPRP (P_); a variable that combines a fasting-subsample component with full-sample ones
(diabetes above) is defined only in that fasting domain, so it cannot enter a WTMEC2YR model. Pooling cycles follows the NCHS rules: divide each cycle's weight by
the number of cycles pooled (1999–2002 has its own 4-year weights), and to combine 2015–2016
with 2017–March 2020 use 2/5.2 × WTMEC2YR and 3.2/5.2 × WTMECPRP.