OSCR

Cardiometabolic medication exposures and cognitive outcomes in Alzheimer's disease.

Code ↔ Paper

5 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

2 blocks of code here have a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.

The 5 matches
  1. [1] § Methods › Statistical models ↔ code/Forest_plots_CDR(cognitive).Rmd, lines 498 to 552 · score 0.75 · Dem progressors, ADem, clinical progression, MCI progressors, parallel, tracks · block oscr:b:EM19ECWG1B03B-C · Report a mismatch
  2. [2] § Methods › Study design ↔ code/preprocessed_HABSHD.ipynb, lines 39 to 48 · score 0.75 · thyroid disease, high cholesterol, anxiety, depression, stroke, hypertension · Report a mismatch
  3. [3] § Methods › Study design ↔ code/preprocessed_NACC.ipynb, lines 50 to 59 · score 0.67 · high cholesterol, anxiety, depression, stroke, thyroid, hypertension · Report a mismatch
  4. [4] § Methods › Statistical models ↔ code/Forest_plots_CDR(cognitive).Rmd, lines 498 to 552 · score 0.60 · ADem, clinical progression, MCI progression, stratified, backgrounds, Cognitive · block oscr:b:EM19ECWG1B03B-C · Report a mismatch
  5. [5] § Methods › Statistical models ↔ code/Forest_plots_CDR(baseline cognitive).Rmd, lines 317 to 369 · score 0.52 · ADem, parallel, tracks, Diamond, blocks, forest · block oscr:b:RA57QSAWPCKJH-L · Report a mismatch

Paper

Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

R Markdown · 553 lines · 19 KB · no license · 2 matches

  1. ---
  2. title: "Forest Plots - Cognitive Progression Groups"
  3. author: "Yihan Wang"
  4. date: "2025-09-16"
  5. output:
  6. word_document: default
  7. pdf_document: default
  8. ---
  9. 1. PROGRESSION GROUPS (4 groups):
  10. Groups included:
  11. - Non-progression (CU stable + MCI stable combined)
  12. - CU-MCI progression (progression from CU to MCI)
  13. - CU/MCI-AD progression (progression to AD dementia)
  14. - AD (dementia patients)
  15. 2. COMORBIDITY ADJUSTMENTS:
  16. Added to ALL models as covariates:
  17. - CVD (Cardiovascular disease)
  18. - Endocrine (Endocrine disorders including diabetes)
  19. - Psychiatric (Psychiatric conditions)
  20. 3. MEDICATION × TIME INTERACTIONS:
  21. All 7 medications include interaction with year_since_baseline:
  22. - ACEi × Time, ARB × Time, β-Blocker × Time, CCB × Time
  23. - Diuretic × Time, Metformin × Time, Statin × Time
  24. This allows assessment of whether medication effects change over follow-up period.
  25. 4. MODEL FORMULA STRUCTURE:
  26. CDR ~ year_since_baseline +
  27. age + sex + edu + APOE4 +
  28. CVD + Endocrine + Psychiatric +
  29. ACEi + ARB + BetaBlk + CCB + Diuretic + Metformin + Statin +
  30. drug:year_since_baseline (for all 7 drugs) +
  31. (1 + year_since_baseline | id)
  32. ```{r}
  33. rm(list=ls())
  34. library(missRanger)
  35. library(dplyr)
  36. library(lubridate)
  37. library(lme4) # mixed models
  38. library(lmerTest) # p-values for lmer
  39. library(splines)
  40. library(conflicted)
  41. library(broom.mixed)
  42. library(dplyr)
  43. library(stringr)
  44. library(forcats)
  45. library(ggplot2)
  46. library(forestploter)
  47. library(grid)
  48. library(gridtext)
  49. conflicts_prefer(dplyr::lag)
  50. conflicts_prefer(lmerTest::lmer)
  51. conflicts_prefer(dplyr::filter)
  52. ```
  53. ```{r}
  54. source("medication-lmer-utility.R")
  55. source("plots.R")
  56. ```
  57. ```{r}
  58. NACC_full_df_cdr<-read.csv("../preprocessed_data/NACC/NACC_cdr_imputed_binary.csv")
  59. AIBL_full_df_cdr<-read.csv("../preprocessed_data/AIBL/AIBL_cdr_imputed_binary.csv")
  60. HABS_full_df_cdr<-read.csv("../preprocessed_data/HABSHD/HABSHD_cdr_imputed_binary.csv")
  61. NACC_full_df_cdr$edu <- scale(NACC_full_df_cdr$edu)
  62. NACC_full_df_cdr$age <- scale(NACC_full_df_cdr$age)
  63. AIBL_full_df_cdr$edu <- scale(AIBL_full_df_cdr$edu)
  64. AIBL_full_df_cdr$age <- scale(AIBL_full_df_cdr$age)
  65. HABS_full_df_cdr$edu <- scale(HABS_full_df_cdr$edu)
  66. HABS_full_df_cdr$age <- scale(HABS_full_df_cdr$age)
  67. ```
  68. ```{r}
  69. # Split by progression groups
  70. NACC_split <- split_by_progression(NACC_full_df_cdr, id_col = "id", visit_col = "visit_no", status_col = "status")
  71. AIBL_split <- split_by_progression(AIBL_full_df_cdr, id_col = "id", visit_col = "visit_no", status_col = "status")
  72. HABS_split <- split_by_progression(HABS_full_df_cdr, id_col = "id", visit_col = "visit_no", status_col = "status")
  73. # Extract groups (function now directly returns the 4 groups we need)
  74. # Non-progression (stable CU + stable MCI combined by the function)
  75. NACC_non_prog = NACC_split$groups$Non_progression
  76. AIBL_non_prog = AIBL_split$groups$Non_progression
  77. HABS_non_prog = HABS_split$groups$Non_progression
  78. # CU-MCI progression
  79. NACC_cu_mci_prog = NACC_split$groups$CU_MCI_progression
  80. AIBL_cu_mci_prog = AIBL_split$groups$CU_MCI_progression
  81. HABS_cu_mci_prog = HABS_split$groups$CU_MCI_progression
  82. # CU/MCI-AD progression
  83. NACC_to_ad_prog = NACC_split$groups$CU_MCI_AD_progression
  84. AIBL_to_ad_prog = AIBL_split$groups$CU_MCI_AD_progression
  85. HABS_to_ad_prog = HABS_split$groups$CU_MCI_AD_progression
  86. # AD
  87. NACC_ad = NACC_split$groups$AD_stable
  88. AIBL_ad = AIBL_split$groups$AD_stable
  89. HABS_ad = HABS_split$groups$AD_stable
  90. ```
  91. # Full
  92. ```{r}
  93. NACC_full_df_cdr$visit_date <- as.Date(NACC_full_df_cdr$visit_date, format = "%Y-%m-%d")
  94. fit_full_NACC <- lmer(
  95. CDR ~ year_since_baseline +
  96. age + sex + edu + APOE4 +
  97. CVD + Endocrine + Psychiatric +
  98. ACEi + ARB + BetaBlk + CCB + Diuretic + Metformin + Statin +
  99. ACEi:year_since_baseline + ARB:year_since_baseline + BetaBlk:year_since_baseline +
  100. CCB:year_since_baseline + Diuretic:year_since_baseline +
  101. Metformin:year_since_baseline + Statin:year_since_baseline +
  102. (1 + year_since_baseline | id),
  103. data = NACC_full_df_cdr
  104. )
  105. summary(fit_full_NACC)
  106. ```
  107. ```{r}
  108. AIBL_full_df_cdr$visit_date <- as.Date(AIBL_full_df_cdr$visit_date, format = "%Y-%m-%d")
  109. fit_full_AIBL <- lmer(
  110. CDR ~ year_since_baseline +
  111. age + sex + edu + APOE4 +
  112. CVD + Endocrine + Psychiatric +
  113. ACEi + ARB + BetaBlk + CCB + Diuretic + Metformin + Statin +
  114. ACEi:year_since_baseline + ARB:year_since_baseline + BetaBlk:year_since_baseline +
  115. CCB:year_since_baseline + Diuretic:year_since_baseline +
  116. Metformin:year_since_baseline + Statin:year_since_baseline +
  117. (1 + year_since_baseline | id),
  118. data = AIBL_full_df_cdr
  119. )
  120. summary(fit_full_AIBL)
  121. ```
  122. ```{r}
  123. HABS_full_df_cdr$visit_date <- as.Date(HABS_full_df_cdr$visit_date, format = "%Y-%m-%d")
  124. fit_full_HABS <- lmer(
  125. CDR ~ year_since_baseline +
  126. age + sex + edu + APOE4 +
  127. CVD + Endocrine + Psychiatric +
  128. ACEi + ARB + BetaBlk + CCB + Diuretic + Metformin + Statin +
  129. ACEi:year_since_baseline + ARB:year_since_baseline + BetaBlk:year_since_baseline +
  130. CCB:year_since_baseline + Diuretic:year_since_baseline +
  131. Metformin:year_since_baseline + Statin:year_since_baseline +
  132. (1 + year_since_baseline | id),
  133. data = HABS_full_df_cdr
  134. )
  135. summary(fit_full_HABS)
  136. ```
  137. # Non-progression (CU + MCI stable combined)
  138. ```{r}
  139. NACC_non_prog$visit_date <- as.Date(NACC_non_prog$visit_date, format = "%Y-%m-%d")
  140. fit_NACC_NON_PROG <- lmer(
  141. CDR ~ year_since_baseline +
  142. age + sex + edu + APOE4 +
  143. CVD + Endocrine + Psychiatric +
  144. ACEi + ARB + BetaBlk + CCB + Diuretic + Metformin + Statin +
  145. ACEi:year_since_baseline + ARB:year_since_baseline + BetaBlk:year_since_baseline +
  146. CCB:year_since_baseline + Diuretic:year_since_baseline +
  147. Metformin:year_since_baseline + Statin:year_since_baseline +
  148. (1 + year_since_baseline | id),
  149. data = NACC_non_prog
  150. )
  151. summary(fit_NACC_NON_PROG)
  152. # BH-adjusted p-values
  153. coef_summary <- coef(summary(fit_NACC_NON_PROG))
  154. p_values <- coef_summary[, "Pr(>|t|)"]
  155. p_adjusted <- p.adjust(p_values, method = "BH")
  156. cat("nBH-adjusted p-values:n")
  157. print(data.frame(Term = rownames(coef_summary), P.value = p_values, P.adjusted = p_adjusted))
  158. ```
  159. ```{r}
  160. AIBL_non_prog$visit_date <- as.Date(AIBL_non_prog$visit_date, format = "%Y-%m-%d")
  161. fit_AIBL_NON_PROG <- lmer(
  162. CDR ~ year_since_baseline +
  163. age + sex + edu + APOE4 +
  164. CVD + Endocrine + Psychiatric +
  165. ACEi + ARB + BetaBlk + CCB + Diuretic + Metformin + Statin +
  166. ACEi:year_since_baseline + ARB:year_since_baseline + BetaBlk:year_since_baseline +
  167. CCB:year_since_baseline + Diuretic:year_since_baseline +
  168. Metformin:year_since_baseline + Statin:year_since_baseline +
  169. (1 + year_since_baseline | id),
  170. data = AIBL_non_prog
  171. )
  172. summary(fit_AIBL_NON_PROG)
  173. # BH-adjusted p-values
  174. coef_summary <- coef(summary(fit_AIBL_NON_PROG))
  175. p_values <- coef_summary[, "Pr(>|t|)"]
  176. p_adjusted <- p.adjust(p_values, method = "BH")
  177. cat("nBH-adjusted p-values:n")
  178. print(data.frame(Term = rownames(coef_summary), P.value = p_values, P.adjusted = p_adjusted))
  179. ```
  180. ```{r}
  181. HABS_non_prog$visit_date <- as.Date(HABS_non_prog$visit_date, format = "%Y-%m-%d")
  182. fit_HABS_NON_PROG <- lmer(
  183. CDR ~ year_since_baseline +
  184. age + sex + edu + APOE4 +
  185. CVD + Endocrine + Psychiatric +
  186. ACEi + ARB + BetaBlk + CCB + Diuretic + Metformin + Statin +
  187. ACEi:year_since_baseline + ARB:year_since_baseline + BetaBlk:year_since_baseline +
  188. CCB:year_since_baseline + Diuretic:year_since_baseline +
  189. Metformin:year_since_baseline + Statin:year_since_baseline +
  190. (1 + year_since_baseline | id),
  191. data = HABS_non_prog
  192. )
  193. summary(fit_HABS_NON_PROG)
  194. # BH-adjusted p-values
  195. coef_summary <- coef(summary(fit_HABS_NON_PROG))
  196. p_values <- coef_summary[, "Pr(>|t|)"]
  197. p_adjusted <- p.adjust(p_values, method = "BH")
  198. cat("nBH-adjusted p-values:n")
  199. print(data.frame(Term = rownames(coef_summary), P.value = p_values, P.adjusted = p_adjusted))
  200. ```
  201. # CU-MCI Progression
  202. ```{r}
  203. NACC_cu_mci_prog$visit_date <- as.Date(NACC_cu_mci_prog$visit_date, format = "%Y-%m-%d")
  204. fit_NACC_CU_MCI_PROG <- lmer(
  205. CDR ~ year_since_baseline +
  206. age + sex + edu + APOE4 +
  207. CVD + Endocrine + Psychiatric +
  208. ACEi + ARB + BetaBlk + CCB + Diuretic + Metformin + Statin +
  209. ACEi:year_since_baseline + ARB:year_since_baseline + BetaBlk:year_since_baseline +
  210. CCB:year_since_baseline + Diuretic:year_since_baseline +
  211. Metformin:year_since_baseline + Statin:year_since_baseline +
  212. (1 + year_since_baseline | id),
  213. data = NACC_cu_mci_prog
  214. )
  215. summary(fit_NACC_CU_MCI_PROG)
  216. # BH-adjusted p-values
  217. coef_summary <- coef(summary(fit_NACC_CU_MCI_PROG))
  218. p_values <- coef_summary[, "Pr(>|t|)"]
  219. p_adjusted <- p.adjust(p_values, method = "BH")
  220. cat("nBH-adjusted p-values:n")
  221. print(data.frame(Term = rownames(coef_summary), P.value = p_values, P.adjusted = p_adjusted))
  222. ```
  223. ```{r}
  224. AIBL_cu_mci_prog$visit_date <- as.Date(AIBL_cu_mci_prog$visit_date, format = "%Y-%m-%d")
  225. fit_AIBL_CU_MCI_PROG <- lmer(
  226. CDR ~ year_since_baseline +
  227. age + sex + edu + APOE4 +
  228. CVD + Endocrine + Psychiatric +
  229. ACEi + ARB + BetaBlk + CCB + Diuretic + Metformin + Statin +
  230. ACEi:year_since_baseline + ARB:year_since_baseline + BetaBlk:year_since_baseline +
  231. CCB:year_since_baseline + Diuretic:year_since_baseline +
  232. Metformin:year_since_baseline + Statin:year_since_baseline +
  233. (1 + year_since_baseline | id),
  234. data = AIBL_cu_mci_prog
  235. )
  236. summary(fit_AIBL_CU_MCI_PROG)
  237. # BH-adjusted p-values
  238. coef_summary <- coef(summary(fit_AIBL_CU_MCI_PROG))
  239. p_values <- coef_summary[, "Pr(>|t|)"]
  240. p_adjusted <- p.adjust(p_values, method = "BH")
  241. cat("nBH-adjusted p-values:n")
  242. print(data.frame(Term = rownames(coef_summary), P.value = p_values, P.adjusted = p_adjusted))
  243. ```
  244. ```{r}
  245. HABS_cu_mci_prog$visit_date <- as.Date(HABS_cu_mci_prog$visit_date, format = "%Y-%m-%d")
  246. fit_HABS_CU_MCI_PROG <- lmer(
  247. CDR ~ year_since_baseline +
  248. age + sex + edu + APOE4 +
  249. CVD + Endocrine + Psychiatric +
  250. ACEi + ARB + BetaBlk + CCB + Diuretic + Metformin + Statin +
  251. ACEi:year_since_baseline + ARB:year_since_baseline + BetaBlk:year_since_baseline +
  252. CCB:year_since_baseline + Diuretic:year_since_baseline +
  253. Metformin:year_since_baseline + Statin:year_since_baseline +
  254. (1 + year_since_baseline | id),
  255. data = HABS_cu_mci_prog
  256. )
  257. summary(fit_HABS_CU_MCI_PROG)
  258. # BH-adjusted p-values
  259. coef_summary <- coef(summary(fit_HABS_CU_MCI_PROG))
  260. p_values <- coef_summary[, "Pr(>|t|)"]
  261. p_adjusted <- p.adjust(p_values, method = "BH")
  262. cat("nBH-adjusted p-values:n")
  263. print(data.frame(Term = rownames(coef_summary), P.value = p_values, P.adjusted = p_adjusted))
  264. ```
  265. # CU/MCI-AD Progression
  266. ```{r}
  267. NACC_to_ad_prog$visit_date <- as.Date(NACC_to_ad_prog$visit_date, format = "%Y-%m-%d")
  268. fit_NACC_TO_AD_PROG <- lmer(
  269. CDR ~ year_since_baseline +
  270. age + sex + edu + APOE4 +
  271. CVD + Endocrine + Psychiatric +
  272. ACEi + ARB + BetaBlk + CCB + Diuretic + Metformin + Statin +
  273. ACEi:year_since_baseline + ARB:year_since_baseline + BetaBlk:year_since_baseline +
  274. CCB:year_since_baseline + Diuretic:year_since_baseline +
  275. Metformin:year_since_baseline + Statin:year_since_baseline +
  276. (1 + year_since_baseline | id),
  277. data = NACC_to_ad_prog
  278. )
  279. summary(fit_NACC_TO_AD_PROG)
  280. # BH-adjusted p-values
  281. coef_summary <- coef(summary(fit_NACC_TO_AD_PROG))
  282. p_values <- coef_summary[, "Pr(>|t|)"]
  283. p_adjusted <- p.adjust(p_values, method = "BH")
  284. cat("nBH-adjusted p-values:n")
  285. print(data.frame(Term = rownames(coef_summary), P.value = p_values, P.adjusted = p_adjusted))
  286. ```
  287. ```{r}
  288. AIBL_to_ad_prog$visit_date <- as.Date(AIBL_to_ad_prog$visit_date, format = "%Y-%m-%d")
  289. fit_AIBL_TO_AD_PROG <- lmer(
  290. CDR ~ year_since_baseline +
  291. age + sex + edu + APOE4 +
  292. CVD + Endocrine + Psychiatric +
  293. ACEi + ARB + BetaBlk + CCB + Diuretic + Metformin + Statin +
  294. ACEi:year_since_baseline + ARB:year_since_baseline + BetaBlk:year_since_baseline +
  295. CCB:year_since_baseline + Diuretic:year_since_baseline +
  296. Metformin:year_since_baseline + Statin:year_since_baseline +
  297. (1 + year_since_baseline | id),
  298. data = AIBL_to_ad_prog
  299. )
  300. summary(fit_AIBL_TO_AD_PROG)
  301. # BH-adjusted p-values
  302. coef_summary <- coef(summary(fit_AIBL_TO_AD_PROG))
  303. p_values <- coef_summary[, "Pr(>|t|)"]
  304. p_adjusted <- p.adjust(p_values, method = "BH")
  305. cat("nBH-adjusted p-values:n")
  306. print(data.frame(Term = rownames(coef_summary), P.value = p_values, P.adjusted = p_adjusted))
  307. ```
  308. ```{r}
  309. HABS_to_ad_prog$visit_date <- as.Date(HABS_to_ad_prog$visit_date, format = "%Y-%m-%d")
  310. fit_HABS_TO_AD_PROG <- lmer(
  311. CDR ~ year_since_baseline +
  312. age + sex + edu + APOE4 +
  313. CVD + Endocrine + Psychiatric +
  314. ACEi + ARB + BetaBlk + CCB + Diuretic + Metformin + Statin +
  315. ACEi:year_since_baseline + ARB:year_since_baseline + BetaBlk:year_since_baseline +
  316. CCB:year_since_baseline + Diuretic:year_since_baseline +
  317. Metformin:year_since_baseline + Statin:year_since_baseline +
  318. (1 + year_since_baseline | id),
  319. data = HABS_to_ad_prog
  320. )
  321. summary(fit_HABS_TO_AD_PROG)
  322. # BH-adjusted p-values
  323. coef_summary <- coef(summary(fit_HABS_TO_AD_PROG))
  324. p_values <- coef_summary[, "Pr(>|t|)"]
  325. p_adjusted <- p.adjust(p_values, method = "BH")
  326. cat("nBH-adjusted p-values:n")
  327. print(data.frame(Term = rownames(coef_summary), P.value = p_values, P.adjusted = p_adjusted))
  328. ```
  329. # AD
  330. ```{r}
  331. NACC_ad$visit_date <- as.Date(NACC_ad$visit_date, format = "%Y-%m-%d")
  332. fit_NACC_AD <- lmer(
  333. CDR ~ year_since_baseline +
  334. age + sex + edu + APOE4 +
  335. CVD + Endocrine + Psychiatric +
  336. ACEi + ARB + BetaBlk + CCB + Diuretic + Metformin + Statin +
  337. ACEi:year_since_baseline + ARB:year_since_baseline + BetaBlk:year_since_baseline +
  338. CCB:year_since_baseline + Diuretic:year_since_baseline +
  339. Metformin:year_since_baseline + Statin:year_since_baseline +
  340. (1 + year_since_baseline | id),
  341. data = NACC_ad
  342. )
  343. summary(fit_NACC_AD)
  344. # BH-adjusted p-values
  345. coef_summary <- coef(summary(fit_NACC_AD))
  346. p_values <- coef_summary[, "Pr(>|t|)"]
  347. p_adjusted <- p.adjust(p_values, method = "BH")
  348. cat("nBH-adjusted p-values:n")
  349. print(data.frame(Term = rownames(coef_summary), P.value = p_values, P.adjusted = p_adjusted))
  350. ```
  351. ```{r}
  352. AIBL_ad$visit_date <- as.Date(AIBL_ad$visit_date, format = "%Y-%m-%d")
  353. fit_AIBL_AD <- lmer(
  354. CDR ~ year_since_baseline +
  355. age + sex + edu + APOE4 +
  356. CVD + Endocrine + Psychiatric +
  357. ACEi + ARB + BetaBlk + CCB + Diuretic + Metformin + Statin +
  358. ACEi:year_since_baseline + ARB:year_since_baseline + BetaBlk:year_since_baseline +
  359. CCB:year_since_baseline + Diuretic:year_since_baseline +
  360. Metformin:year_since_baseline + Statin:year_since_baseline +
  361. (1 + year_since_baseline | id),
  362. data = AIBL_ad
  363. )
  364. summary(fit_AIBL_AD)
  365. # BH-adjusted p-values
  366. coef_summary <- coef(summary(fit_AIBL_AD))
  367. p_values <- coef_summary[, "Pr(>|t|)"]
  368. p_adjusted <- p.adjust(p_values, method = "BH")
  369. cat("nBH-adjusted p-values:n")
  370. print(data.frame(Term = rownames(coef_summary), P.value = p_values, P.adjusted = p_adjusted))
  371. ```
  372. ```{r}
  373. HABS_ad$visit_date <- as.Date(HABS_ad$visit_date, format = "%Y-%m-%d")
  374. fit_HABS_AD <- lmer(
  375. CDR ~ year_since_baseline +
  376. age + sex + edu + APOE4 +
  377. CVD + Endocrine + Psychiatric +
  378. ACEi + ARB + BetaBlk + CCB + Diuretic + Metformin + Statin +
  379. ACEi:year_since_baseline + ARB:year_since_baseline + BetaBlk:year_since_baseline +
  380. CCB:year_since_baseline + Diuretic:year_since_baseline +
  381. Metformin:year_since_baseline + Statin:year_since_baseline +
  382. (1 + year_since_baseline | id),
  383. data = HABS_ad
  384. )
  385. summary(fit_HABS_AD)
  386. # BH-adjusted p-values
  387. coef_summary <- coef(summary(fit_HABS_AD))
  388. p_values <- coef_summary[, "Pr(>|t|)"]
  389. p_adjusted <- p.adjust(p_values, method = "BH")
  390. cat("nBH-adjusted p-values:n")
  391. print(data.frame(Term = rownames(coef_summary), P.value = p_values, P.adjusted = p_adjusted))
  392. ```
  393. # plots
  394. ```{r}
  395. terms_all <-c(
  396. "year_since_baseline","age","sex","edu","APOE4",
  397. "CVD", "Endocrine", "Psychiatric",
  398. "ACEi","ARB","BetaBlk","CCB",
  399. "Diuretic","Metformin", "Statin",
  400. "year_since_baseline:ACEi","year_since_baseline:ARB",
  401. "year_since_baseline:BetaBlk","year_since_baseline:CCB",
  402. "year_since_baseline:Diuretic", "year_since_baseline:Metformin",
  403. "year_since_baseline:Statin"
  404. )
  405. terms_rename <- c(
  406. "year_since_baseline"="Time",
  407. "age"="Age (baseline)",
  408. "sex"="Sex (ref: Male)",
  409. "edu"="Education (z-scored)",
  410. "APOE4"="APOE4 carrier (ref: No)",
  411. "CVD"="CVD",
  412. "Endocrine"="Endocrine disease",
  413. "Psychiatric"="Psychiatric disease",
  414. "ACEi"="ACEi",
  415. "ARB"="ARBs",
  416. "BetaBlk"="β-Blocker",
  417. "CCB"="CCBs",
  418. "Diuretic"="Diuretics",
  419. "Metformin"="Metformin",
  420. "Statin"="Statins",
  421. "year_since_baseline:ACEi"="ACEi × Time",
  422. "year_since_baseline:ARB"="ARBs × Time",
  423. "year_since_baseline:BetaBlk"="β-Blocker × Time",
  424. "year_since_baseline:CCB"="CCBs × Time",
  425. "year_since_baseline:Diuretic"="Diuretics × Time",
  426. "year_since_baseline:Metformin"="Metformin × Time",
  427. "year_since_baseline:Statin"="Statins × Time"
  428. )
  429. ```
  430. ```{r}
  431. dt_cog = make_dt_from_fits(
  432. fits = list(
  433. `Overall` = list(fit_full_NACC, fit_full_AIBL, fit_full_HABS),
  434. `Non-progression` = list(fit_NACC_NON_PROG, fit_AIBL_NON_PROG, fit_HABS_NON_PROG),
  435. `CU-MCI progression` = list(fit_NACC_CU_MCI_PROG, fit_AIBL_CU_MCI_PROG, fit_HABS_CU_MCI_PROG),
  436. `CU/MCI-ADem progression` = list(fit_NACC_TO_AD_PROG, fit_AIBL_TO_AD_PROG, fit_HABS_TO_AD_PROG),
  437. `ADem-stable` = list(fit_NACC_AD, fit_AIBL_AD, fit_HABS_AD)
  438. ),
  439. term= terms_all,
  440. cohorts = c("NACC","AIBL","HABS"),
  441. term_labels = terms_rename,
  442. method = "REML",
  443. digits = 3,
  444. p_adjust = "none"
  445. )
  446. ```
  447. ```{r}
  448. png_path <- "../plots/forestplot/Figure 2.png"
  449. dir.create(dirname(png_path), recursive = TRUE, showWarnings = FALSE)
  450. # Expanded width to 15 in for a wider landscape layout (5 parallel group tracks)
  451. img_w <- 15; img_h <- 10; img_dpi <- 500
  452. if (requireNamespace("ragg", quietly = TRUE)){
  453. ragg::agg_png(png_path, width = img_w, height = img_h,
  454. units = "in", res = img_dpi, background = "white")
  455. } else {
  456. png(png_path, width = img_w * img_dpi, height = img_h * img_dpi,
  457. res = img_dpi, bg = "white")
  458. }
  459. plot_forest_stratification_meta_expanded2(
  460. dt = dt_cog,
  461. terms = terms_all,
  462. term_labels = terms_rename,
  463. cohorts = c("NACC", "AIBL", "HABS"),
  464. interaction_only = TRUE, # Set to TRUE if you only want to plot the drug * time rows
  465. # Group tracking parameters for the 5 parallel blocks
  466. prog_groups = c("Overall", "Non-progression", "CU-MCI progression", "CU/MCI-ADem progression", "ADem-stable"),
  467. group_colors = c("#2F4F4F", "#BB9393", "#FEAD76", "#E64B35", "#756BB1"),
  468. # Custom x-axis window boundaries for each of your 5 clinical group columns
  469. xlim_cols = list(
  470. `Overall` = c(-0.05, 0.05),
  471. `Non-progression` = c(-0.025, 0.025),
  472. `CU-MCI progression` = c(-0.1, 0.2),
  473. `CU/MCI-AD progression` = c(-1, 1),
  474. `AD` = c(-1, 0.5)
  475. ),
  476. col_label_width = 0.08, # Space for left features/cohort labels
  477. forest_col_frac = 0.48, # 48% forest line graph / 52% text window ratio inside columns
  478. gap_feature = 0.60,
  479. sub_row_h = 0.55,
  480. cex_base = 0.90, # Sized perfectly for 5-column text spacing
  481. ci_lwd = 2.4,
  482. point_cex = 1.1,
  483. diamond_height = 0.38,
  484. # title = "Stratified Forest Plot – Cognitive Decline: Medication × Time Across Clinical Progression",
  485. title = " ",
  486. show_legend = TRUE,
  487. show_vline = TRUE,
  488. mar = c(6.5, 0.5, 5, 0.5) # Extended bottom cushion prevents legend clipping
  489. )
  490. dev.off()
  491. message("Saved: ", png_path)
  492. ```

Forest_plots_CDR(cognitive).Rmd at commit 81fba02, no license · at the source

Overview

Authors: Yihan Wang1, Benjamin Goudey2,3, Colin L Masters4, Liang Jin1, Yijun Pan1,5, The Health and Aging Brain Study (HABS-HD) Study Team
ORCID iDs: Yijun Pan
  1. Department of Neuroscience, School of Translational Medicine, Monash University, 99 Commercial Rd., Melbourne, VIC 3004, Australia
  2. Australia BioCommons, The University of Melbourne, 21 Bedford Street, North Melbourne, Melbourne, VIC 3051, Australia
  3. The ARC Training Centre in Cognitive Computing for Medical Technologies, The University of Melbourne, 700 Swanston Street, Carlton, Melbourne, VIC 3053, Australia
  4. Alzheimer's Research Australia, The University of Western Australia, Nedlands, WA 6009, Australia
  5. School of Health and Biomedical Sciences, RMIT University, 30 Janefield Drive, Bundoora, Melbourne, VIC 3083, Australia
Institutions: Monash University (Australia); The University of Melbourne (Australia); The University of Western Australia (Australia); RMIT University (Australia)
Journal: Age and ageing, volume 55, issue 9, article afag263
Dates: received 4 February 2026; accepted 20 July 2026; published online 14 September 2026; in print September 2026
Type: Research article · Language: English
License: CC BY-NC
Identifiers: DOI 10.1093/ageing/afag263 · PMID 42735389 · PMCID PMC13574286 · OpenAlex W7212916448
Open access: hybrid, a free copy (OpenAlex)
Status: code verified (how the code is found and verified)
Categories: human (organism), Alzheimer's / dementia (population)
Methods: Preprocessing, Statistics
Keywords: antihypertensive drugs, angiotensin-converting enzyme inhibitors, Alzheimer’s disease, dementia, metformin, older adults
MeSH: Alzheimer Disease*, Cardiovascular Agents*, Cognition*, Cognitive Dysfunction*, Aged, Aged, 80 and over, Angiotensin-Converting Enzyme Inhibitors, Australia, Disease Progression, Female, Humans, Hydroxymethylglutaryl-CoA Reductase Inhibitors, Male (* major topic)
Topic: Dementia and Cognitive Impairment Research (Psychiatry and Mental health, Medicine), according to OpenAlex
Funding: NIA NIH HHS (P30 AG062715, P30 AG066444, P30 AG066508, P30 AG066509, P30 AG066512, P30 AG066546, P30 AG072946, P30 AG086401, P30 AG066514, P30 AG072947, P30 AG072975, P30 AG072979, P30 AG062429, P30 AG066507, P30 AG066511, P30 AG066530, P30 AG072958, P30 AG072976, P30 AG072977, P30 AG072978, P30 AG066506, P30 AG066515, P30 AG066518, P30 AG066519, P30 AG072931, P30 AG072973, R01 AG070862, R01 AG079280, U19 AG078109, P20 AG068082, P30 AG066468, P30 AG086404, R01 AG058533, P30 AG062422, P30 AG062421, P30 AG062677, P30 AG066462, P30 AG072959, P30 AG072972, R01 AG054073); NIBIB NIH HHS (P41 EB015922)
Citations: not cited yet (Europe PMC); 49 references in the paper

Abstract

Background: People with dementia are often prescribed cardiometabolic medications; however, the impact of this medication exposome on cognitive trajectories remains unclear.

Methods: We analysed data from National Alzheimer’s Coordinating Center (n = 28 044), Australian Imaging, Biomarkers and Lifestyle study (n = 1708) and Health and Aging Brain Study: Health Disparities (n = 1425) to examine associations between seven classes of cardiometabolic medications and cognitive outcomes [CDR sum of boxes (CDR-SB)], using linear mixed-effects models with time-varying exposure. Subgroup analyses were conducted by sex, apolipoprotein E (APOE) ε4, baseline age group and four progression groups [i.e. non-progression, cognitively unimpaired-to-mild cognitive impairment (CU-to-MCI), CU/MCI-to-Alzheimer’s dementia (ADem) progression and ADem-stable group]. A meta-analysis was also performed.

Results: Angiotensin-converting enzyme inhibitors and metformin were associated with a slower cognitive decline. Diuretics showed comparable associations, although these effects were restricted to specific subgroups. Statins exhibited divergent, stage-specific associations, with inverse associations observed in the CU/MCI-to-ADem subgroup and positive associations in the ADem-stable subgroup. Angiotensin II receptor blockers were associated with a greater longitudinal increase in CDR-SB among participants in the non-progression subgroup. Calcium channel blockers showed limited subgroup-specific cognitive benefit but were also associated with an accelerated increase in CDR-SB over time. β-blockers demonstrated no consistent association with cognitive trajectories, with evidence of a lower CDR-SB slope observed only in a cohort-specific analysis.

Discussion: Future research should incorporate pharmacy-verified medication exposure, explicit dosing information and dynamically modelled trajectories, while routinely assessing baseline and follow-up cognitive outcomes in pharmacotherapy trials involving older adults.

Reproduced under the paper's license (CC BY-NC), from the paper cited above.

Repository

Its files are read in the Code ↔ Paper reader above, with 5 matches between paragraphs and lines of code.

Sabrina-wyh/Multicohort-Medication-AD

License: none: the authors keep all their rights
State: the link answers, verified on 26 September 2026
Evidence: files inventoried
Commit: 81fba021b0f759d2fa0355d681c4850717e55aea, 28 July 2026
Languages: R (12), Jupyter (3), Python (1)
Size: 45 files, 16 scripts
Software Heritage: not archived
Found in: “Data availability”
Holds: README, 12 notebooks
Not found: license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: tidyverse (12 files), ggplot2 (10 files), broom (4 files), pandas (4 files), lme4 (3 files), lmerTest (3 files), NumPy (3 files), metafor (2 files), psych (2 files), car (1 file), pheatmap (1 file), SciPy (1 file), statsmodels (1 file)
Availability: 1 check, the latest on 26 September 2026: the link answers
  • 26 September 2026: the link answers
17 files

The paper's code and data availability statement is in the Data section.

Tracing map

Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.

What the map holds:

  • 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 16 scripts, each with its path and the digest of its content;
  • 5 matches between paragraphs of the paper and lines of the code (method lexical-v1);
  • neither the text of the paper nor the code itself.

Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.

Data

No dataset and no data link were found in the paper.

Data availability

Analyses and model development were conducted in R (version 4.3.1) and Python (version 3.11.11). Data requests should be made to NACC (radc.rush.edu), AIBL (https://aibl.org.au/) and HABS-HD (https://apps.unthsc.edu/itr/our). Analysis files for general modelling and validation (not linked to the original datasets) are available on GitHub at: https://github.com/Sabrina-wyh/Multicohort-Medication-AD. Additional information and materials are available upon request.

Reproduced under the paper's license (CC BY-NC), from the paper cited above.

Versions

The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.

Version 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 6 authors, 6 keywords, 13 MeSH terms, 2 funders, 44 references.

Cite

This paper

Wang, Y., Goudey, B., Masters, C. L., Jin, L., Pan, Y., & The Health and Aging Brain Study (HABS-HD) Study Team. (2026). Cardiometabolic medication exposures and cognitive outcomes in Alzheimer's disease. Age and ageing, 55(9), afag263. https://doi.org/10.1093/ageing/afag263

BibTeX

@article{wang2026cardiometabolic,
author = {Wang, Yihan and Goudey, Benjamin and Masters, Colin L and Jin, Liang and Pan, Yijun and {The Health and Aging Brain Study (HABS-HD) Study Team}},
title = {{Cardiometabolic medication exposures and cognitive outcomes in Alzheimer's disease}},
journal = {Age and ageing},
year = {2026},
month = sep,
volume = {55},
number = {9},
pages = {afag263},
publisher = {Oxford University Press},
issn = {0002-0729},
doi = {10.1093/ageing/afag263},
url = {https://doi.org/10.1093/ageing/afag263},
pmid = {42735389},
pmcid = {PMC13574286}
}

RIS

TY - JOUR
AU - Wang, Yihan
AU - Goudey, Benjamin
AU - Masters, Colin L
AU - Jin, Liang
AU - Pan, Yijun
AU - The Health and Aging Brain Study (HABS-HD) Study Team
TI - Cardiometabolic medication exposures and cognitive outcomes in Alzheimer's disease
T2 - Age and ageing
J2 - Age Ageing
PY - 2026
DA - 2026/09/01
VL - 55
IS - 9
SP - afag263
SN - 0002-0729
PB - Oxford University Press
DO - 10.1093/ageing/afag263
UR - https://doi.org/10.1093/ageing/afag263
LA - en
ER -

CSL-JSON

{
"id": "10.1093/ageing/afag263",
"type": "article-journal",
"title": "Cardiometabolic medication exposures and cognitive outcomes in Alzheimer's disease",
"container-title": "Age and ageing",
"author": [
{
"family": "Wang",
"given": "Yihan"
},
{
"family": "Goudey",
"given": "Benjamin"
},
{
"family": "Masters",
"given": "Colin L"
},
{
"family": "Jin",
"given": "Liang"
},
{
"family": "Pan",
"given": "Yijun"
},
{
"literal": "The Health and Aging Brain Study (HABS-HD) Study Team"
}
],
"container-title-short": "Age Ageing",
"volume": "55",
"issue": "9",
"page": "afag263",
"DOI": "10.1093/ageing/afag263",
"PMID": "42735389",
"PMCID": "PMC13574286",
"ISSN": "0002-0729",
"publisher": "Oxford University Press",
"URL": "https://doi.org/10.1093/ageing/afag263",
"language": "en",
"issued": {
"date-parts": [
[
2026,
9,
1
]
]
}
}

The tracing map gets a citation of its own once an author has validated it and it has a DOI.

Similar papers

The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.

[1] doi:10.1038/s41467-026-73865-9 [code]
Histamine shapes the neurocomputational dynamics of human learning.
Journal: Nature communications
In common: metafor, broom, car, 7 other tools
[2] doi:10.1016/j.celrep.2026.117505 [code]
Impaired spatial coding and neuronal hyperactivity in the medial entorhinal cortex of aged APP knock-in mice.
Journal: Cell reports
In common: metafor, broom, car, 6 other tools, Alzheimer's / dementia
[3] doi:10.1038/s41586-025-10047-5 [code]
Developmental convergence and divergence in human stem cell models of autism.
Journal: Nature
In common: metafor, broom, car, 6 other tools
[4] doi:10.1038/s41398-024-03097-2 [code]
Magnitude and kinetics of a set of neuroanatomic volume and thickness together with white matter hyperintensity is definitive of cognitive status and brain age.
Journal: Translational psychiatry
In common: car, lmerTest, lme4, 6 other tools, Alzheimer's / dementia, 1 reference
[5] doi:10.1016/j.isci.2023.106701 [code]
Using brain cell-type-specific protein interactomes to interpret neurodevelopmental genetic signals in schizophrenia.
Journal: iScience
In common: metafor, broom, lmerTest, 6 other tools
[6] doi:10.1038/s41467-024-45165-7 [code]
Single nuclei transcriptomics in human and non-human primate striatum in opioid use disorder.
Journal: Nature communications
In common: metafor, broom, lmerTest, 6 other tools
[7] doi:10.1016/j.xgen.2025.101010 [code]
Cell-type-specific DNA methylation dynamics in the prenatal and postnatal human cortex.
Journal: Cell genomics
In common: metafor, car, lmerTest, 4 other tools
[8] doi:10.1038/s41588-026-02646-3 [code]
Co-expression-based models improve eQTL predictions for transcriptome-wide association studies and highlight new schizophrenia-associated genes.
Journal: Nature genetics
In common: metafor, broom, pheatmap, 5 other tools
[9] doi:10.1162/imag_a_00134 [code]
Broad brain networks support curiosity-motivated incidental learning of naturalistic dynamic stimuli with and without monetary incentives.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: metafor, psych, lme4, 5 other tools
[10] doi:10.1038/s42003-024-06551-5 [code]
Heritability of functional gradients in the human subcortico-cortical connectivity.
Journal: Communications biology
In common: metafor, psych, car, 4 other tools

Contribute

The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.

Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.

Add the badge to the code's README

OSCR: the badge of this paper

If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.

Markdown
<!-- oscr-badge:start -->
[![OSCR](https://openscicode.org/badge/doi/10.1093/ageing/afag263.svg)](https://openscicode.org/badge/doi/10.1093/ageing/afag263)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.1093/ageing/afag263.svg
   :target: https://openscicode.org/badge/doi/10.1093/ageing/afag263
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1093/ageing/afag263"><img src="https://openscicode.org/badge/doi/10.1093/ageing/afag263.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->

On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".

If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.

Request its removal

To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).

Discussion, reproductions, activity

Discussion: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.

Report a mismatch between the code and the paper · Report a code error (signed in)

Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.

Report a reproduction failure (signed in)

Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.