$npx -y skills add Aperivue/medsci-skills --skill cross-nationalEnd-to-end cross-national comparison study using KNHANES + NHANES + CHNS (or other parallel surveys). Variable harmonization, parallel weighted analysis, and comparison tables. Supports 2-country (KR+US) and 3-country (KR+US+CN) designs.
| 1 | # Cross-National Comparison Study Skill |
| 2 | |
| 3 | You are assisting a medical researcher in conducting a cross-national comparison study |
| 4 | using parallel nationally representative surveys (e.g., KNHANES for Korea, NHANES for the US, CHNS for China). |
| 5 | |
| 6 | ## When to Use |
| 7 | |
| 8 | - Researcher has a clinical question to compare across two countries |
| 9 | - KNHANES + NHANES data available (or other parallel survey pairs) |
| 10 | - Goal: produce a complete analysis with country-stratified results + comparison table |
| 11 | |
| 12 | ## Inputs |
| 13 | |
| 14 | 1. **Research question**: exposure → outcome association to compare across countries |
| 15 | 2. **Korean data path**: KNHANES CSV file |
| 16 | 3. **US data path**: NHANES CSV directory (multiple tables to merge) |
| 17 | 4. **Harmonization table** (optional): CSV mapping variables across surveys |
| 18 | - Default: replicate-study skill's `harmonization_knhanes_nhanes.csv` |
| 19 | |
| 20 | ## Reference Files |
| 21 | |
| 22 | - Harmonization table: `medsci-skills/skills/replicate-study/references/harmonization_knhanes_nhanes.csv` |
| 23 | - Upstream: |
| 24 | - `medsci-skills/skills/write-paper/references/paper_types/cross_national.md` — writing template |
| 25 | - `medsci-skills/skills/analyze-stats/references/analysis_guides/survey_weighted.md` |
| 26 | |
| 27 | ## Workflow |
| 28 | |
| 29 | ### Phase 1: Study Definition |
| 30 | |
| 31 | 1. Confirm research question: Exposure → Outcome |
| 32 | 2. Define variable coding for both countries: |
| 33 | - Exposure: PHQ-9, BMI category, smoking, etc. |
| 34 | - Outcome: diabetes, hypertension, mortality, etc. |
| 35 | - Covariates: age, sex, education, income, smoking, alcohol, obesity, CVD |
| 36 | 3. Check harmonization table for variable availability |
| 37 | 4. Output: study protocol summary for user approval |
| 38 | |
| 39 | ### Phase 2: Data Preparation |
| 40 | |
| 41 | **KNHANES (single CSV)**: |
| 42 | 1. Load CSV, filter age ≥20 (or per protocol) |
| 43 | 2. Derive variables using KNHANES coding: |
| 44 | - Smoking: BS3_1 (1,2=current, 3=former, 8=never) |
| 45 | - Alcohol: BD1_11 (2-6=frequent, 1=occasional, 8=never) |
| 46 | - Obesity: HE_obe (≥4=obesity for BMI≥25 Asian cutoff) |
| 47 | - PHQ-9: BP_PHQ_1~9, sum score, ≥10=depression |
| 48 | - Diabetes: HE_glu≥126 | HE_HbA1c≥6.5 | DE1_dg=1 |
| 49 | - CVD: DI4_dg=1 | DI5_dg=1 | DI6_dg=1 |
| 50 | 3. Set survey design: svydesign(id=~psu, strata=~kstrata, weights=~wt_itvex, nest=TRUE) |
| 51 | |
| 52 | **NHANES (multiple CSVs)**: |
| 53 | 1. Load and merge tables by SEQN (DEMO_J, DPQ_J, GHB_J, BIOPRO_J, BMX_J, SMQ_J, ALQ_J, DIQ_J, MCQ_J, BPQ_J) |
| 54 | 2. Derive variables using NHANES coding: |
| 55 | - Smoking: SMQ020 + SMQ040 (100 cigs + now smoke) |
| 56 | - Alcohol: ALQ121 (past 12 mo frequency → categories) |
| 57 | - Obesity: BMXBMI ≥30 (WHO cutoff, NOT Asian) |
| 58 | - PHQ-9: DPQ010~DPQ090, sum score, ≥10=depression |
| 59 | - Diabetes: LBXSGL≥126 | LBXGH≥6.5 | DIQ010=="Yes" (CRITICAL: LBXSGL not LBXSGLU) |
| 60 | - CVD: MCQ160B=="Yes" (CHF) | MCQ160C=="Yes" (CHD) | MCQ160D=="Yes" (angina) | MCQ160E=="Yes" (MI) |
| 61 | - HTN: BPXOSY3≥140 | BPXODI3≥90 | BPQ020=="Yes" |
| 62 | 3. Set survey design: svydesign(id=~SDMVPSU, strata=~SDMVSTRA, weights=~WTMECPRP, nest=TRUE) |
| 63 | |
| 64 | ### Phase 3: Parallel Analysis |
| 65 | |
| 66 | For EACH country independently: |
| 67 | 1. **Table 1**: Baseline characteristics by exposure (weighted counts + percentages) |
| 68 | 2. **Main analysis**: Sequential logistic regression models |
| 69 | - Model 1 (unadjusted) |
| 70 | - Model 2 (age + sex) |
| 71 | - Model 3 (fully adjusted: + education, income, smoking, alcohol, obesity, CVD) |
| 72 | 3. **Subgroup analyses**: By sex, age group, education, income, alcohol, smoking, CVD, obesity |
| 73 | 4. **Dose-response** (if applicable): RCS with 3 knots |
| 74 | |
| 75 | ### Phase 4: Cross-National Comparison Table |
| 76 | |
| 77 | Generate a side-by-side comparison: |
| 78 | |
| 79 | | Analysis | Korea wOR (95% CI) | US wOR (95% CI) | Direction Agreement | |
| 80 | |----------|-------------------|-----------------|---------------------| |
| 81 | | Overall (fully adjusted) | ... | ... | ✓/✗ | |
| 82 | | Male | ... | ... | | |
| 83 | | Female | ... | ... | | |
| 84 | | ... | ... | ... | | |
| 85 | |
| 86 | ### Phase 5: Output Files |
| 87 | |
| 88 | ``` |
| 89 | {working_dir}/ |
| 90 | ├── cross_national_report.md — Study summary + comparison tables |
| 91 | ├── variable_mapping.csv — Variable mapping with match status |
| 92 | ├── analysis_korea.R — KNHANES analysis (self-contained) |
| 93 | ├── analysis_us.R — NHANES analysis (self-contained) |
| 94 | ├── results/ |
| 95 | │ ├── table1_korea.csv |
| 96 | │ ├── table1_us.csv |
| 97 | │ ├── main_results_comparison.csv |
| 98 | │ └── subgroup_comparison.csv |
| 99 | └── manuscript_draft/ — Optional: Methods + Results draft |
| 100 | ├── methods_draft.md |
| 101 | └── results_draft.md |
| 102 | ``` |
| 103 | |
| 104 | ## Critical Rules |
| 105 | |
| 106 | 1. **NEVER pool data across countries**. Each country analyzed with its own survey design. |
| 107 | 2. **Country-specific BMI cutoffs**: Korea ≥25 (Asian), US ≥30 (WHO). |
| 108 | 3. **Country-specific income**: KNHANES quartile, NHANES PIR → harmonize to binary. |
| 109 | 4. * |