EN — Analysis code (data extraction + statistical modelling) for the parsimonious model predicting infection-related acute brain dysfunction in critically ill patients with connective tissue disease (CTD). Developed on MIMIC-IV, externally validated on eICU-CRD. 中文 — 本研究"结缔组织病重症患者感染相关急性脑功能障碍"简约预测模型的分析代码(数据提取 + 统计建模),基于 MIMIC-IV 开发、eICU-CRD 外部验证。
sql/ # PostgreSQL extraction scripts (MIMIC-IV / eICU-CRD): cohort, phenotype, features, attrition
R/ # R analysis pipeline (run in the order below)
index.html # Interactive web risk calculator (English) — also live at the GitHub Pages site
index_zh.html # Interactive web risk calculator (Chinese)
.nojekyll # Disables Jekyll so all files are served as static assets
data/ # (gitignored) derived patient-level tables — NOT included (PhysioNet DUA prohibits redistribution)
out/ # (gitignored) aggregate outputs regenerated by the pipeline
A self-contained, client-side (no server, no data leaves the browser) risk calculator is included and deployed via GitHub Pages:
- English: https://morrosun.github.io/ctd-icu-abd-prediction/index.html
- 中文: https://morrosun.github.io/ctd-icu-abd-prediction/index_zh.html
The calculator embeds the final parsimonious model coefficients; open the file directly or host it anywhere static.
sql/— run the.sqlscripts in PostgreSQL to build the analysis schema (internally namednpsle2for backward compatibility) and exportdata/mimic_final.csv/data/eicu_final.csv.R/01_table1.R,R/01b_check_ns.R— descriptive tables / sample check.R/02_harmonize.R— cross-database variable alignment ->data/dev.rds,data/ext.rds.R/04_model_dev.R— MICE imputation -> LASSO stability selection -> parsimonious logistic -> bootstrap optimism correction.R/05_external_val.R— external validation on eICU-CRD.R/06_clinical_utility.R,R/06b_strategy_unbiased.R— decision-curve analyses.R/07_figures.R— forest plot, ROC, etc.R/08_secondary.R…R/12_culture_dca.R— secondary / sensitivity / culture-positive analyses.R/03_table1_eicu.R,R/04b_sanity.R,R/09_strobe.R— eICU Table 1, sanity checks, STROBE flowchart numbers.
Each R script sets the repository root via setwd() at the top — adjust it to your clone location (or use here::here()).
- R >= 4.0 with:
dplyr,mice,glmnet,rms,pROC,rmda,ggplot2, … - PostgreSQL 14+ with MIMIC-IV v2.2 and eICU-CRD loaded (PhysioNet credentialing required).
MIMIC-IV and eICU-CRD are credentialed de-identified databases from PhysioNet under a data use agreement that prohibits public redistribution. data/ is therefore gitignored; researchers must obtain the raw databases independently and re-run sql/ + R/ to reproduce all aggregate results.
The analysis code, full model equation, and interactive bilingual (EN/ZH) web risk calculator are archived under the version-specific DOI 10.5281/zenodo.22007064 and deployed at https://morrosun.github.io/ctd-icu-abd-prediction/.
Code released under the MIT License. No license is asserted over MIMIC-IV / eICU-CRD data.