OSCR

Beneficial effects of foreign language learning and aerobic exercise on dentate gyrus volume and mnemonic discrimination in healthy older adults: Results from a randomized controlled trial.

Code ↔ Paper

1 match 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.

One block of code here has 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 1 match
  1. [1] § Results › Baseline subiculum volume predicts change in MDT-OS performance › Demographic factors and cardiovascular fitness do not explain bivariate relationships ↔ code/3_hc-md_bivariate-LCSM.R, lines 345 to 413 · score 0.52 · pseudo LCSM, vo2peak, CFI, RMSEA, bivariate, Fit · block oscr:b:KK2WECG6XNH4X-O · 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 · 417 lines · 26 KB · no license · 1 match

  1. # -------------------------------------------------------------------------
  2. # Program: 3_hc-md_bivariate-LCSM.R
  3. # Author: Sarah E. Polk
  4. # Date: 2024-08-22 15:00:54 CEST
  5. #
  6. # This script sets up bilateral LCSMs in OpenMx to test for baseline-baseline,
  7. # baseline-change, and change-change associations across bilateral hippocampal
  8. # subfield volume and MDT-OS performance
  9. #
  10. # -------------------------------------------------------------------------
  11. # Prepare environment -----------------------------------------------------
  12. library(OpenMx)
  13. library(tidyverse)
  14. # Set paths ---------------------------------------------------------------
  15. path.base <- file.path("your", "base", "path")
  16. path.data <- file.path(path.base, "data")
  17. path.results <- file.path(path.base, "results")
  18. # Functions ---------------------------------------------------------------
  19. # get bootstrapped parameters and perform Wald test
  20. getStdParam <- function(params, param) {
  21. b <- round((params %>% filter(label == param))$Std.Value[1], 3)
  22. se <- round((params %>% filter(label == param))$Boot.SE[1], 3)
  23. z <- round(b / se, 3)
  24. p <- round(2*pnorm(abs(z), lower.tail = F), 3)
  25. return(paste0("b = ", b, " [", round(b - (se * 1.96), 3), ", ", round(b + (se * 1.96), 3), "], z = ", z, ", p = ", p))
  26. }
  27. getStdParam.noBoot <- function(params, param) {
  28. b <- round((params %>% filter(label == param))$Std.Value[1], 3)
  29. se <- round((params %>% filter(label == param))$Std.SE[1], 3)
  30. z <- round(b / se, 3)
  31. p <- round(2*pnorm(abs(z), lower.tail = F), 3)
  32. return(paste0("b = ", b, " [", round(b - (se * 1.96), 3), ", ", round(b + (se * 1.96), 3), "], z = ", z, ", p = ", p))
  33. }
  34. # Get data ----------------------------------------------------------------
  35. data <- read.csv(file.path(path.data, "data_hc-md_clean-std.csv"))
  36. results.invar.hc <- read.csv(file.path(path.results, "invariance_hc.csv"))
  37. results.invar.mdt <- read.csv(file.path(path.results, "invariance_mdt.csv"))
  38. # Build bivariate LCSMs for bilateral hippocampal volume and MDT ----------
  39. vars.hc <- c("CA12", "CA3DG", "Sub", "ERC")
  40. vars.mdt <- "MDT"
  41. # set up list to save results
  42. results.biLCSM <- vector(mode = "list", length = 0)
  43. results.biLCSM.covar <- vector(mode = "list", length = 0)
  44. results.biLCSM.vo2peak <- vector(mode = "list", length = 0)
  45. seed <- 234
  46. nrep <- 400
  47. extraTries <- 100
  48. for (i in 1:length(vars.hc)){
  49. hc.cur <- vars.hc[i]
  50. mdt.cur <- vars.mdt
  51. print(hc.cur)
  52. data.cur <- data %>%
  53. select(id, spanish, exercise, combined,
  54. paste0(hc.cur, "_Left_1"), paste0(hc.cur, "_Right_1"),
  55. paste0(hc.cur, "_Left_2"), paste0(hc.cur, "_Right_2"),
  56. paste0(hc.cur, "_Left_3"), paste0(hc.cur, "_Right_3"),
  57. paste0(mdt.cur, "_Parcel1_1"), paste0(mdt.cur, "_Parcel2_1"), paste0(mdt.cur, "_Parcel3_1"),
  58. paste0(mdt.cur, "_Parcel1_2"), paste0(mdt.cur, "_Parcel2_2"), paste0(mdt.cur, "_Parcel3_2"),
  59. paste0(mdt.cur, "_Parcel1_3"), paste0(mdt.cur, "_Parcel2_3"), paste0(mdt.cur, "_Parcel3_3"))
  60. # set up model
  61. manifests.hc <- names(data.cur)[5:10]
  62. manifests.mdt <- names(data.cur)[11:19]
  63. latents.hc <- c("HC_1", "HC_2", "HC_3", "Delta_HC_12", "Delta_HC_23")
  64. latents.mdt <- c("MDT_1", "MDT_2", "MDT_3", "Delta_MDT_12", "Delta_MDT_23")
  65. result.invar.hc <- (results.invar.hc %>% filter(roi == hc.cur))$time.strict
  66. ifelse(result.invar.hc > .050,
  67. residuals.hc <- rep(c("RES_Left","RES_Right"), 3),
  68. residuals.hc <- paste("RES", manifests.hc, sep = "_"))
  69. resCov.hc <- "COV_hemi"
  70. result.invarMetric.mdt <- (results.invar.mdt %>% filter(roi == mdt.cur))$time.metric
  71. ifelse(result.invarMetric.mdt > .050,
  72. loadings.mdt <- rep(paste("LOAD", c(1:3), sep = "_"), 3),
  73. loadings.mdt <- c(paste(rep(paste("LOAD", c(1:3), sep = "_"), 3), "1", sep = "_"),
  74. paste(rep(paste("LOAD", c(1:3), sep = "_"), 3), "2", sep = "_"),
  75. paste(rep(paste("LOAD", c(1:3), sep = "_"), 3), "3", sep = "_"))
  76. )
  77. result.invarStrict.mdt <- (results.invar.mdt %>% filter(roi == mdt.cur))$time.strict
  78. ifelse(result.invarMetric.mdt > .050 & result.invarStrict.mdt > .050,
  79. residuals.mdt <- "RES",
  80. residuals.mdt <- paste("RES", c(rep("_1", 3),
  81. rep("_2", 3),
  82. rep("_3", 3))))
  83. lbound <- .00001
  84. set.seed(seed)
  85. bivarLCSM <- mxModel(model = "bivarLCSM",
  86. type = "RAM",
  87. manifestVars = c(manifests.hc, manifests.mdt),
  88. latentVars = c(latents.hc, latents.mdt),
  89. # set up subfield LCSM
  90. # loadings
  91. mxPath(from = "HC_1", to = manifests.hc[grep("_1", manifests.hc)], arrows = 1, free = F, values = 1),
  92. mxPath(from = "HC_2", to = manifests.hc[grep("_2", manifests.hc)], arrows = 1, free = F, values = 1),
  93. mxPath(from = "HC_3", to = manifests.hc[grep("_3", manifests.hc)], arrows = 1, free = F, values = 1),
  94. # residual variance and covariance
  95. mxPath(from = manifests.hc, arrows = 2, free = T, values = .1, lbound = lbound, labels = residuals.hc),
  96. mxPath(from = manifests.hc[grep("Left", manifests.hc)[1]], to = manifests.hc[grep("Left", manifests.hc)[2:3]], arrows = 2, free = T, values = .2, labels = resCov.hc),
  97. mxPath(from = manifests.hc[grep("Left", manifests.hc)[2]], to = manifests.hc[grep("Left", manifests.hc)[3]], arrows = 2, free = T, values = .2, labels = resCov.hc),
  98. mxPath(from = manifests.hc[grep("Right", manifests.hc)[1]], to = manifests.hc[grep("Right", manifests.hc)[2:3]], arrows = 2, free = T, values = .2, labels = resCov.hc),
  99. mxPath(from = manifests.hc[grep("Right", manifests.hc)[2]], to = manifests.hc[grep("Right", manifests.hc)[3]], arrows = 2, free = T, values = .2, labels = resCov.hc),
  100. # latent structure
  101. mxPath(from = c("HC_1", "Delta_HC_12"), to = "HC_2", arrows = 1, free = F, values = 1),
  102. mxPath(from = c("HC_2", "Delta_HC_23"), to = "HC_3", arrows = 1, free = F, values = 1),
  103. mxPath(from = c("HC_1", "Delta_HC_12", "Delta_HC_23"), arrows = 2, free = T, values = .8, lbound = lbound, labels = paste("VAR", c("HC_1", "Delta_HC", "Delta_HC"), sep = "_")),
  104. mxPath(from = "HC_1", to = c("Delta_HC_12", "Delta_HC_23"), arrows = 2, free = T, values = 0, labels = c("COV_HC_1_Delta_HC_12", "COV_HC_1_Delta_HC_23")),
  105. mxPath(from = "Delta_HC_12", to = "Delta_HC_23", arrows = 2, free = T, values = 0, labels = "COV_Delta_HC_12_Delta_HC_23"),
  106. # group means
  107. mxPath(from = "one", to = c("HC_1", "Delta_HC_12", "Delta_HC_23"), arrows = 1, free = T, values = 0, labels = paste("M", c("HC_1", "Delta_HC", "Delta_HC"), sep = "_")),
  108. # set up MDT LCSM
  109. # loadings
  110. mxPath(from = "MDT_1", to = manifests.mdt[grep("_1", manifests.mdt)], arrows = 1, free = c(F, T, T), values = 1, labels = loadings.mdt[1:3]),
  111. mxPath(from = "MDT_2", to = manifests.mdt[grep("_2", manifests.mdt)], arrows = 1, free = c(F, T, T), values = 1, labels = loadings.mdt[4:6]),
  112. mxPath(from = "MDT_3", to = manifests.mdt[grep("_3", manifests.mdt)], arrows = 1, free = c(F, T, T), values = 1, labels = loadings.mdt[7:9]),
  113. # residual variance
  114. mxPath(from = manifests.mdt, arrows = 2, free = T, values = .1, lbound = lbound, labels = residuals.mdt),
  115. # latent structure
  116. mxPath(from = c("MDT_1", "Delta_MDT_12"), to = "MDT_2", arrows = 1, free = F, values = 1),
  117. mxPath(from = c("MDT_2", "Delta_MDT_23"), to = "MDT_3", arrows = 1, free = F, values = 1),
  118. mxPath(from = c("MDT_1", "Delta_MDT_12", "Delta_MDT_23"), arrows = 2, free = T, values = .8, lbound = lbound, labels = paste("VAR", c("MDT_1", "Delta_MDT", "Delta_MDT"), sep = "_")),
  119. mxPath(from = "MDT_1", to = c("Delta_MDT_12", "Delta_MDT_23"), arrows = 2, free = T, values = 0, labels = c("COV_MDT_1_Delta_MDT_12", "COV_MDT_1_Delta_MDT_23")),
  120. mxPath(from = "Delta_MDT_12", to = "Delta_MDT_23", arrows = 2, free = T, values = 0, labels = "COV_Delta_MDT_12_Delta_MDT_23"),
  121. # group means
  122. mxPath(from = "one", to = c("MDT_1", "Delta_MDT_12", "Delta_MDT_23"), arrows = 1, free = T, values = 0, labels = paste("M", c("MDT_1", "Delta_MDT", "Delta_MDT"), sep = "_")),
  123. # set up bivariate structure
  124. # baseline-baseline
  125. mxPath(from = "MDT_1", to = "HC_1", arrows = 2, free = T, values = .05, labels = "COV_Baseline"),
  126. # baseline MDT-change hc
  127. mxPath(from = "MDT_1", to = c("Delta_HC_12", "Delta_HC_23"), arrows = 1, free = T, values = 0, labels = "MDT_Baseline_Delta_HC"),
  128. # baseline hc-change MDT
  129. mxPath(from = "HC_1", to = c("Delta_MDT_12", "Delta_MDT_23"), arrows = 1, free = T, values = 0, labels = "HC_Baseline_Delta_MDT"),
  130. # change-change
  131. mxPath(from = "Delta_MDT_12", to = "Delta_HC_12", arrows = 2, free = T, values = 0, labels = "COV_Delta"),
  132. mxPath(from = "Delta_MDT_23", to = "Delta_HC_23", arrows = 2, free = T, values = 0, labels = "COV_Delta"))
  133. # fit model and print results with fit indices
  134. model.bivarLCSM <- mxModel(model = bivarLCSM,
  135. name = "bivarLCSM",
  136. mxData(observed = data.cur, type = "raw"))
  137. fit.bivarLCSM <- mxTryHard(model.bivarLCSM, extra = extraTries)
  138. ref.bivarLCSM <- mxRefModels(fit.bivarLCSM, run = T)
  139. print(fitIndices <- summary(fit.bivarLCSM, refModels = ref.bivarLCSM))
  140. results.biLCSM[[paste0(hc.cur, "~MDT")]]["CFI"] <- round(fitIndices$CFI, 3)
  141. results.biLCSM[[paste0(hc.cur, "~MDT")]]["RMSEA"] <- paste0(round(fitIndices$RMSEA, 3),
  142. " [", round(fitIndices[["RMSEACI"]][["lower"]], 3), ", ",
  143. round(fitIndices[["RMSEACI"]][["upper"]], 3), "]")
  144. # bootstrap model and get parameters
  145. boot.bivarLCSM <- mxBootstrap(fit.bivarLCSM, nrep)
  146. bootStd.bivarLCSM <- mxBootstrapStdizeRAMpaths(boot.bivarLCSM)
  147. # baseline-baseline
  148. results.biLCSM[[paste0(hc.cur, "~MDT")]]["COV_Baseline"] <- getStdParam(bootStd.bivarLCSM, "COV_Baseline")
  149. # mdt baseline predicting hc change
  150. results.biLCSM[[paste0(hc.cur, "~MDT")]]["MDT_Baseline_Delta_HC"] <- getStdParam(bootStd.bivarLCSM, "MDT_Baseline_Delta_HC")
  151. # hc baseline predicting mdt change
  152. results.biLCSM[[paste0(hc.cur, "~MDT")]]["HC_Baseline_Delta_MDT"] <- getStdParam(bootStd.bivarLCSM, "HC_Baseline_Delta_MDT")
  153. # change-change
  154. results.biLCSM[[paste0(hc.cur, "~MDT")]]["COV_Delta"] <- getStdParam(bootStd.bivarLCSM, "COV_Delta")
  155. # subiculum baseline predicts mdt change
  156. # test for difference across non-exercisers and exercisers
  157. p <- as.numeric(str_sub(getStdParam(bootStd.bivarLCSM, "HC_Baseline_Delta_MDT"), -4, -1))
  158. if (p < .050){
  159. data.noExercise <- data.cur %>% filter(exercise == 0)
  160. data.exercise <- data.cur %>% filter(exercise == 1)
  161. model.bivarLCSM.noExercise <- mxModel(model = bivarLCSM,
  162. name = "bivarLCSM_noEx",
  163. mxData(observed = data.noExercise, type = "raw"))
  164. model.bivarLCSM.exercise <- mxModel(model = bivarLCSM,
  165. name = "bivarLCSM_ex",
  166. mxData(observed = data.exercise, type = "raw"))
  167. model.bivarLCSM.groupsEqual <- mxModel(model = "bivarLCSM_groupsEqual",
  168. model.bivarLCSM.noExercise,
  169. model.bivarLCSM.exercise,
  170. mxFitFunctionMultigroup(c("bivarLCSM_noEx",
  171. "bivarLCSM_ex")))
  172. fit.bivarLCSM.groupsEqual <- mxTryHard(model.bivarLCSM.groupsEqual, extra = extraTries)
  173. model.bivarLCSM.noExercise <- mxModel(model = bivarLCSM,
  174. name = "bivarLCSM_noEx",
  175. mxPath(from = "HC_1", to = c("Delta_MDT_12", "Delta_MDT_23"), arrows = 1, free = T, values = 0, labels = "HC_Baseline_Delta_MDT_noEx"),
  176. mxData(observed = data.noExercise, type = "raw"))
  177. model.bivarLCSM.exercise <- mxModel(model = bivarLCSM,
  178. name = "bivarLCSM_ex",
  179. mxPath(from = "HC_1", to = c("Delta_MDT_12", "Delta_MDT_23"), arrows = 1, free = T, values = 0, labels = "HC_Baseline_Delta_MDT_ex"),
  180. mxData(observed = data.exercise, type = "raw"))
  181. model.bivarLCSM.groupsInequal <- mxModel(model = "bivarLCSM_groupsInequal",
  182. model.bivarLCSM.noExercise,
  183. model.bivarLCSM.exercise,
  184. mxFitFunctionMultigroup(c("bivarLCSM_noEx",
  185. "bivarLCSM_ex")))
  186. fit.bivarLCSM.groupsInequal <- mxTryHard(model.bivarLCSM.groupsInequal, extra = extraTries)
  187. # test equality across groups
  188. lrt.groupsEqual <- mxCompare(fit.bivarLCSM.groupsInequal, fit.bivarLCSM.groupsEqual)
  189. results.biLCSM[[paste0(hc.cur, "~MDT")]]["HC_Baseline_Delta_MDT LRT exercise"] <- paste("chi2 =", round(lrt.groupsEqual$diffLL[2], 3),
  190. "p =", round(lrt.groupsEqual$p[2], 3))
  191. # get parameters
  192. std.bivarLCSM.groupsInequal <- mxStandardizeRAMpaths(fit.bivarLCSM.groupsInequal, SE = T)
  193. results.biLCSM[[paste0(hc.cur, "~MDT")]]["HC_Baseline_Delta_MDT no exercise"] <- getStdParam.noBoot(do.call(rbind, std.bivarLCSM.groupsInequal), "HC_Baseline_Delta_MDT_noEx")
  194. results.biLCSM[[paste0(hc.cur, "~MDT")]]["HC_Baseline_Delta_MDT exercise"] <- getStdParam.noBoot(do.call(rbind, std.bivarLCSM.groupsInequal), "HC_Baseline_Delta_MDT_ex")
  195. }
  196. # add age, sex, and education to the model
  197. data.cur <- data %>%
  198. select(id, age, sex, eduYrs,
  199. paste0(hc.cur, "_Left_1"), paste0(hc.cur, "_Right_1"),
  200. paste0(hc.cur, "_Left_2"), paste0(hc.cur, "_Right_2"),
  201. paste0(hc.cur, "_Left_3"), paste0(hc.cur, "_Right_3"),
  202. paste0(mdt.cur, "_Parcel1_1"), paste0(mdt.cur, "_Parcel2_1"), paste0(mdt.cur, "_Parcel3_1"),
  203. paste0(mdt.cur, "_Parcel1_2"), paste0(mdt.cur, "_Parcel2_2"), paste0(mdt.cur, "_Parcel3_2"),
  204. paste0(mdt.cur, "_Parcel1_3"), paste0(mdt.cur, "_Parcel2_3"), paste0(mdt.cur, "_Parcel3_3"))
  205. model.bivarLCSM.covar <- mxModel(model = bivarLCSM,
  206. name = "bivarLCSM_covars",
  207. manifestVars = c("age", "sex", "eduYrs"),
  208. mxPath(from = "age", to = c("HC_1", "Delta_HC_12", "Delta_HC_23", "MDT_1", "Delta_MDT_12", "Delta_MDT_23"), arrows = 1, free = T, values = 0,
  209. labels = paste("age", c("HC_1", "Delta_HC", "Delta_HC", "MDT_1", "Delta_MDT", "Delta_MDT"), sep = "_")),
  210. mxPath(from = "sex", to = c("HC_1", "Delta_HC_12", "Delta_HC_23", "MDT_1", "Delta_MDT_12", "Delta_MDT_23"), arrows = 1, free = T, values = 0,
  211. labels = paste("sex", c("HC_1", "Delta_HC", "Delta_HC", "MDT_1", "Delta_MDT", "Delta_MDT"), sep = "_")),
  212. mxPath(from = "eduYrs", to = c("HC_1", "Delta_HC_12", "Delta_HC_23", "MDT_1", "Delta_MDT_12", "Delta_MDT_23"), arrows = 1, free = T, values = 0,
  213. labels = paste("edu", c("HC_1", "Delta_HC", "Delta_HC", "MDT_1", "Delta_MDT", "Delta_MDT"), sep = "_")),
  214. mxPath(from = c("age", "sex", "eduYrs"), arrows = 2, free = T, values = 1, lbound = lbound, labels = paste("VAR", c("age", "sex", "edu"), sep = "_")),
  215. mxData(observed = data.cur, type = "raw"))
  216. fit.bivarLCSM.covar <- mxTryHard(model.bivarLCSM.covar, extra = extraTries)
  217. ref.bivarLCSM.covar <- mxRefModels(fit.bivarLCSM.covar, run = T)
  218. print(fitIndices <- summary(fit.bivarLCSM.covar, refModels = ref.bivarLCSM.covar))
  219. results.biLCSM.covar[[paste0(hc.cur, "~MDT")]]["CFI"] <- round(fitIndices$CFI, 3)
  220. results.biLCSM.covar[[paste0(hc.cur, "~MDT")]]["RMSEA"] <- paste0(round(fitIndices$RMSEA, 3),
  221. " [", round(fitIndices[["RMSEACI"]][["lower"]], 3), ", ",
  222. round(fitIndices[["RMSEACI"]][["upper"]], 3), "]")
  223. # bootstrap model and get parameters
  224. boot.bivarLCSM.covar <- mxBootstrap(fit.bivarLCSM.covar, nrep)
  225. bootStd.bivarLCSM.covar <- mxBootstrapStdizeRAMpaths(boot.bivarLCSM.covar)
  226. # age
  227. results.biLCSM.covar[[paste0(hc.cur, "~MDT")]]["age_HC_1"] <- getStdParam(bootStd.bivarLCSM.covar, "age_HC_1")
  228. results.biLCSM.covar[[paste0(hc.cur, "~MDT")]]["age_Delta_HC"] <- getStdParam(bootStd.bivarLCSM.covar, "age_Delta_HC")
  229. results.biLCSM.covar[[paste0(hc.cur, "~MDT")]]["age_MDT_1"] <- getStdParam(bootStd.bivarLCSM.covar, "age_MDT_1")
  230. results.biLCSM.covar[[paste0(hc.cur, "~MDT")]]["age_Delta_MDT"] <- getStdParam(bootStd.bivarLCSM.covar, "age_Delta_MDT")
  231. # sex
  232. results.biLCSM.covar[[paste0(hc.cur, "~MDT")]]["sex_HC_1"] <- getStdParam(bootStd.bivarLCSM.covar, "sex_HC_1")
  233. results.biLCSM.covar[[paste0(hc.cur, "~MDT")]]["sex_Delta_HC"] <- getStdParam(bootStd.bivarLCSM.covar, "sex_Delta_HC")
  234. results.biLCSM.covar[[paste0(hc.cur, "~MDT")]]["sex_MDT_1"] <- getStdParam(bootStd.bivarLCSM.covar, "sex_MDT_1")
  235. results.biLCSM.covar[[paste0(hc.cur, "~MDT")]]["sex_Delta_MDT"] <- getStdParam(bootStd.bivarLCSM.covar, "sex_Delta_MDT")
  236. # edu
  237. results.biLCSM.covar[[paste0(hc.cur, "~MDT")]]["edu_HC_1"] <- getStdParam(bootStd.bivarLCSM.covar, "edu_HC_1")
  238. results.biLCSM.covar[[paste0(hc.cur, "~MDT")]]["edu_Delta_HC"] <- getStdParam(bootStd.bivarLCSM.covar, "edu_Delta_HC")
  239. results.biLCSM.covar[[paste0(hc.cur, "~MDT")]]["edu_MDT_1"] <- getStdParam(bootStd.bivarLCSM.covar, "edu_MDT_1")
  240. results.biLCSM.covar[[paste0(hc.cur, "~MDT")]]["edu_Delta_MDT"] <- getStdParam(bootStd.bivarLCSM.covar, "edu_Delta_MDT")
  241. # baseline-baseline
  242. results.biLCSM.covar[[paste0(hc.cur, "~MDT")]]["COV_Baseline"] <- getStdParam(bootStd.bivarLCSM.covar, "COV_Baseline")
  243. # mdt baseline predicting hc change
  244. results.biLCSM.covar[[paste0(hc.cur, "~MDT")]]["MDT_Baseline_Delta_HC"] <- getStdParam(bootStd.bivarLCSM.covar, "MDT_Baseline_Delta_HC")
  245. # hc baseline predicting mdt change
  246. results.biLCSM.covar[[paste0(hc.cur, "~MDT")]]["HC_Baseline_Delta_MDT"] <- getStdParam(bootStd.bivarLCSM.covar, "HC_Baseline_Delta_MDT")
  247. # change-change
  248. results.biLCSM.covar[[paste0(hc.cur, "~MDT")]]["COV_Delta"] <- getStdParam(bootStd.bivarLCSM.covar, "COV_Delta")
  249. # add VO2Peak to the model
  250. data.cur <- data %>%
  251. select(id, VO2Peak_1, VO2Peak_3,
  252. paste0(hc.cur, "_Left_1"), paste0(hc.cur, "_Right_1"),
  253. paste0(hc.cur, "_Left_2"), paste0(hc.cur, "_Right_2"),
  254. paste0(hc.cur, "_Left_3"), paste0(hc.cur, "_Right_3"),
  255. paste0(mdt.cur, "_Parcel1_1"), paste0(mdt.cur, "_Parcel2_1"), paste0(mdt.cur, "_Parcel3_1"),
  256. paste0(mdt.cur, "_Parcel1_2"), paste0(mdt.cur, "_Parcel2_2"), paste0(mdt.cur, "_Parcel3_2"),
  257. paste0(mdt.cur, "_Parcel1_3"), paste0(mdt.cur, "_Parcel2_3"), paste0(mdt.cur, "_Parcel3_3"))
  258. model.bivarLCSM.vo2peak <- mxModel(model = bivarLCSM,
  259. name = "bivarLCSM_vo2peak",
  260. manifestVars = c("VO2Peak_1", "VO2Peak_3"),
  261. latentVars = "Delta_VO2Peak",
  262. # pseudo-LCSM
  263. mxPath(from = c("VO2Peak_1", "Delta_VO2Peak"), to = "VO2Peak_3", arrows = 1, free = F, values = 1),
  264. mxPath(from = "VO2Peak_1", to = "Delta_VO2Peak", arrows = 2, free = T, values = 0, labels = "COV_VO2Peak_1_Delta_VO2Peak"),
  265. mxPath(from = "one", to = c("VO2Peak_1", "Delta_VO2Peak"), arrows = 1, free = T, values = c(-.2, .2), labels = paste("M", c("VO2Peak_1", "Delta_VO2Peak"), sep = "_")),
  266. mxPath(from = "one", to = "VO2Peak_3", arrows = 1, free = F, values = 0),
  267. mxPath(from = c("VO2Peak_1", "Delta_VO2Peak"), arrows = 2, free = T, values = .5, lbound = lbound, labels = c("RES_VO2Peak_1", "VAR_Delta_VO2Peak")),
  268. # HC
  269. mxPath(from = "VO2Peak_1", to = "HC_1", arrows = 2, free = T, values = .2, labels = c("COV_VO2Peak_1_HC_1")),
  270. mxPath(from = "HC_1", to = "Delta_VO2Peak", arrows = 1, free = T, values = 0, labels = "HC_1_Delta_VO2Peak"),
  271. mxPath(from = "VO2Peak_1", to = c("Delta_HC_12", "Delta_HC_23"), arrows = 1, free = T, values = 0, labels = c("VO2Peak_1_Delta_HC")),
  272. mxPath(from = "Delta_VO2Peak", to = c("Delta_HC_12", "Delta_HC_23"), arrows = 2, free = T, values = .2, labels = "COV_Delta_VO2Peak_Delta_HC"),
  273. # MDT
  274. mxPath(from = "VO2Peak_1", to = "MDT_1", arrows = 2, free = T, values = .2, labels = c("COV_VO2Peak_1_MDT_1")),
  275. mxPath(from = "MDT_1", to = "Delta_VO2Peak", arrows = 1, free = T, values = 0, labels = "MDT_1_Delta_VO2Peak"),
  276. mxPath(from = "VO2Peak_1", to = c("Delta_MDT_12", "Delta_MDT_23"), arrows = 1, free = T, values = 0, labels = c("VO2Peak_1_Delta_MDT")),
  277. mxPath(from = "Delta_VO2Peak", to = c("Delta_MDT_12", "Delta_MDT_23"), arrows = 2, free = T, values = .2, labels = "COV_Delta_VO2Peak_Delta_MDT"),
  278. mxData(observed = data.cur, type = "raw"))
  279. fit.bivarLCSM.vo2peak <- mxTryHard(model.bivarLCSM.vo2peak, extra = extraTries)
  280. ref.bivarLCSM.vo2peak <- mxRefModels(fit.bivarLCSM.vo2peak, run = T)
  281. print(fitIndices <- summary(fit.bivarLCSM.vo2peak, refModels = ref.bivarLCSM.vo2peak))
  282. results.biLCSM.vo2peak[[paste0(hc.cur, "~MDT")]]["CFI"] <- round(fitIndices$CFI, 3)
  283. results.biLCSM.vo2peak[[paste0(hc.cur, "~MDT")]]["RMSEA"] <- paste0(round(fitIndices$RMSEA, 3),
  284. " [", round(fitIndices[["RMSEACI"]][["lower"]], 3), ", ",
  285. round(fitIndices[["RMSEACI"]][["upper"]], 3), "]")
  286. # bootstrap model and get parameters
  287. boot.bivarLCSM.vo2peak <- mxBootstrap(fit.bivarLCSM.vo2peak, nrep)
  288. bootStd.bivarLCSM.vo2peak <- mxBootstrapStdizeRAMpaths(boot.bivarLCSM.vo2peak)
  289. # vo2peak
  290. results.biLCSM.vo2peak[[paste0(hc.cur, "~MDT")]]["COV_VO2Peak_1_HC_1"] <- getStdParam(bootStd.bivarLCSM.vo2peak, "COV_VO2Peak_1_HC_1")
  291. results.biLCSM.vo2peak[[paste0(hc.cur, "~MDT")]]["HC_1_Delta_VO2Peak"] <- getStdParam(bootStd.bivarLCSM.vo2peak, "HC_1_Delta_VO2Peak")
  292. results.biLCSM.vo2peak[[paste0(hc.cur, "~MDT")]]["VO2Peak_1_Delta_HC"] <- getStdParam(bootStd.bivarLCSM.vo2peak, "VO2Peak_1_Delta_HC")
  293. results.biLCSM.vo2peak[[paste0(hc.cur, "~MDT")]]["COV_Delta_VO2Peak_Delta_HC"] <- getStdParam(bootStd.bivarLCSM.vo2peak, "COV_Delta_VO2Peak_Delta_HC")
  294. results.biLCSM.vo2peak[[paste0(hc.cur, "~MDT")]]["COV_VO2Peak_1_MDT_1"] <- getStdParam(bootStd.bivarLCSM.vo2peak, "COV_VO2Peak_1_MDT_1")
  295. results.biLCSM.vo2peak[[paste0(hc.cur, "~MDT")]]["MDT_1_Delta_VO2Peak"] <- getStdParam(bootStd.bivarLCSM.vo2peak, "MDT_1_Delta_VO2Peak")
  296. results.biLCSM.vo2peak[[paste0(hc.cur, "~MDT")]]["VO2Peak_1_Delta_MDT"] <- getStdParam(bootStd.bivarLCSM.vo2peak, "VO2Peak_1_Delta_MDT")
  297. results.biLCSM.vo2peak[[paste0(hc.cur, "~MDT")]]["COV_Delta_VO2Peak_Delta_MDT"] <- getStdParam(bootStd.bivarLCSM.vo2peak, "COV_Delta_VO2Peak_Delta_MDT")
  298. # baseline-baseline
  299. results.biLCSM.vo2peak[[paste0(hc.cur, "~MDT")]]["COV_Baseline"] <- getStdParam(bootStd.bivarLCSM.vo2peak, "COV_Baseline")
  300. # mdt baseline predicting hc change
  301. results.biLCSM.vo2peak[[paste0(hc.cur, "~MDT")]]["MDT_Baseline_Delta_HC"] <- getStdParam(bootStd.bivarLCSM.vo2peak, "MDT_Baseline_Delta_HC")
  302. # hc baseline predicting mdt change
  303. results.biLCSM.vo2peak[[paste0(hc.cur, "~MDT")]]["HC_Baseline_Delta_MDT"] <- getStdParam(bootStd.bivarLCSM.vo2peak, "HC_Baseline_Delta_MDT")
  304. # change-change
  305. results.biLCSM.vo2peak[[paste0(hc.cur, "~MDT")]]["COV_Delta"] <- getStdParam(bootStd.bivarLCSM.vo2peak, "COV_Delta")
  306. }
  307. # Format results and save -------------------------------------------------
  308. results.biLCSM.format <- data.frame(results = unlist(results.biLCSM))
  309. write.csv(results.biLCSM.format, file.path(path.results, "results_bivarLCSM.csv"), row.names = T)
  310. results.biLCSM.covar.format <- data.frame(results = unlist(results.biLCSM.covar))
  311. write.csv(results.biLCSM.covar.format, file.path(path.results, "results_bivarLCSM_covars.csv"), row.names = T)
  312. results.biLCSM.vo2peak.format <- data.frame(results = unlist(results.biLCSM.vo2peak))
  313. write.csv(results.biLCSM.vo2peak.format, file.path(path.results, "results_bivarLCSM_vo2peak.csv"), row.names = T)

3_hc-md_bivariate-LCSM.R, no license · at the source

Overview

  1. Center for Lifespan Psychology, Max Planck Institute for Human Development, Berlin, Germany
  2. Clinical Cognitive Neuroscience, DZNE German Center for Neurodegenerative Diseases, Magdeburg, Germany
  3. Department of Psychology, University of Trier, Trier, Germany
  4. Friede Springer Cardiovascular Prevention Center, Charité – Universitätsmedizin Berlin, Berlin, Germany
  5. Department of Psychology, MSB Medical School Berlin, Berlin, Germany
  6. Max Planck UCL Centre for Computational Psychiatry and Ageing Research, Berlin, Germany
  7. Lise Meitner Group for Environmental Neuroscience, Max Planck Institute for Human Development, Berlin, Germany
  8. Department of Psychiatry and Psychotherapy, University Clinic Hamburg-Eppendorf, Hamburg, Germany
  9. Institute for Mind, Brain and Behavior, HMU Health and Medical University, Potsdam, Germany
Journal: Imaging neuroscience (Cambridge, Mass.), volume 4, article IMAG.a.1306
Dates: received 18 September 2024; accepted 26 June 2026; published online 24 July 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1162/imag.a.1306 · PMID 42516172 · PMCID PMC13403954 · OpenAlex W7167090708
Open access: diamond, a free copy (OpenAlex)
Status: code verified (how the code is found and verified)
Categories: human (organism), healthy (population)
Methods: Preprocessing, Statistics
Keywords: healthy aging, aerobic exercise, language learning, hippocampal subfields, mnemonic discrimination
Topic: Neurobiology of Language and Bilingualism (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Citations: not cited yet (Europe PMC); 110 references in the paper

Abstract

Protecting hippocampal structures, such as the cornu ammonis 3 and dentate gyrus (CA3/DG), that are tied to mnemonic discrimination could be a promising approach to mitigate the age-related decline in episodic memory. This study examines the potential benefits of cognitive and physical engagement, specifically language learning and moderate aerobic exercise, for maintaining hippocampal subfield integrity and memory performance. In a randomized controlled trial involving 142 healthy older adults (aged 63–78 years), we investigated the effects of a 6-month regime comprising language learning, aerobic exercise, and their combination. Participants were assigned to one of four groups: an active control, language-only, exercise-only, or combined language and exercise group. CA3/DG volume remained stable in the language-only and combined groups, while the non-language groups showed a significantly greater decrease in volume, suggesting that foreign language learning may protect against normal aging-related CA3/DG volume loss. Comparatively, the exercise-only and combined groups showed significant improvements in mnemonic discrimination performance, while the non-exercise groups did not, indicating that aerobic exercise can improve this aspect of memory in older adults. Notably, the combined group was the only group to exhibit both preserved CA3/DG volume and improved mnemonic discrimination. No evidence for a boosting effect of the combined intervention on either outcome was observed. This suggests that, while the effects of language learning and aerobic exercise may be independent at the level of measured outcomes, they provide complementary benefits when combined. Finally, the initial volume of the subiculum was found to predict changes in mnemonic discrimination performance across all groups, indicating that this region may play a potential role in episodic memory changes over time. Contrary to our expectations, changes in hippocampal subfields were not directly associated with changes in mnemonic discrimination. In conclusion, this study highlights the potentially separate roles of foreign language learning and aerobic exercise in enhancing aspects of episodic memory in older adults; future research may address whether their combination may yield broader functional benefits than either intervention alone.

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

Repository

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

OSF mz83w

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Languages: R (3)
Size: 15 files, 3 scripts
Software Heritage: not checked
Found in: “Data and Code Availability”
Holds: README
Not found: license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: tidyverse (3 files)
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
  • 27 September 2026: the link answers (HTTP 200)
4 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;
  • 3 scripts, each with its path and the digest of its content;
  • 1 match 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 and Code Availability

Data and code are available on OSF (view-only link: https://osf.io/mz83w/?view_only=2c197ee180604db3aaae59808dd21044).

Reproduced under the paper's license (CC BY), 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, pages, dates, 8 authors, 5 keywords, 1 funder, 107 references.

Cite

This paper

Polk, S. E., Fandakova, Y., Berron, D., Düzel, S., Brandmaier, A. M., Kühn, S., Lindenberger, U., & Wenger, E. (2026). Beneficial effects of foreign language learning and aerobic exercise on dentate gyrus volume and mnemonic discrimination in healthy older adults: Results from a randomized controlled trial. Imaging neuroscience (Cambridge, Mass.), 4, IMAG.a.1306. https://doi.org/10.1162/imag.a.1306

BibTeX

@article{polk2026beneficial,
author = {Polk, Sarah E. and Fandakova, Yana and Berron, David and Düzel, Sandra and Brandmaier, Andreas M. and Kühn, Simone and Lindenberger, Ulman and Wenger, Elisabeth},
title = {{Beneficial effects of foreign language learning and aerobic exercise on dentate gyrus volume and mnemonic discrimination in healthy older adults: Results from a randomized controlled trial}},
journal = {Imaging neuroscience (Cambridge, Mass.)},
year = {2026},
month = jul,
volume = {4},
pages = {IMAG.a.1306},
publisher = {MIT Press},
issn = {2837-6056},
doi = {10.1162/imag.a.1306},
url = {https://doi.org/10.1162/imag.a.1306},
pmid = {42516172},
pmcid = {PMC13403954}
}

RIS

TY - JOUR
AU - Polk, Sarah E.
AU - Fandakova, Yana
AU - Berron, David
AU - Düzel, Sandra
AU - Brandmaier, Andreas M.
AU - Kühn, Simone
AU - Lindenberger, Ulman
AU - Wenger, Elisabeth
TI - Beneficial effects of foreign language learning and aerobic exercise on dentate gyrus volume and mnemonic discrimination in healthy older adults: Results from a randomized controlled trial
T2 - Imaging neuroscience (Cambridge, Mass.)
J2 - Imaging Neurosci (Camb)
PY - 2026
DA - 2026/07/24
VL - 4
SP - IMAG.a.1306
SN - 2837-6056
PB - MIT Press
DO - 10.1162/imag.a.1306
UR - https://doi.org/10.1162/imag.a.1306
LA - en
ER -

CSL-JSON

{
"id": "10.1162/imag.a.1306",
"type": "article-journal",
"title": "Beneficial effects of foreign language learning and aerobic exercise on dentate gyrus volume and mnemonic discrimination in healthy older adults: Results from a randomized controlled trial",
"container-title": "Imaging neuroscience (Cambridge, Mass.)",
"author": [
{
"family": "Polk",
"given": "Sarah E."
},
{
"family": "Fandakova",
"given": "Yana"
},
{
"family": "Berron",
"given": "David"
},
{
"family": "Düzel",
"given": "Sandra"
},
{
"family": "Brandmaier",
"given": "Andreas M."
},
{
"family": "Kühn",
"given": "Simone"
},
{
"family": "Lindenberger",
"given": "Ulman"
},
{
"family": "Wenger",
"given": "Elisabeth"
}
],
"container-title-short": "Imaging Neurosci (Camb)",
"volume": "4",
"page": "IMAG.a.1306",
"DOI": "10.1162/imag.a.1306",
"PMID": "42516172",
"PMCID": "PMC13403954",
"ISSN": "2837-6056",
"publisher": "MIT Press",
"URL": "https://doi.org/10.1162/imag.a.1306",
"language": "en",
"issued": {
"date-parts": [
[
2026,
7,
24
]
]
}
}

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.3389/fnhum.2022.852737 [code]
Change in Latent Gray-Matter Structural Integrity Is Associated With Change in Cardiovascular Fitness in Older Adults Who Engage in At-Home Aerobic Exercise.
Journal: Frontiers in human neuroscience
In common: tidyverse, 14 references, author Sarah E. Polk
[2] doi:10.1002/hbm.25870 [code]
Reliability of quantitative multiparameter maps is high for magnetization transfer and proton density but attenuated for R<sub>1</sub> and R<sub>2</sub> * in healthy young adults.
Journal: Human brain mapping
In common: healthy, 4 authors
[3] doi:10.1038/s41467-025-66354-y [code]
Vulnerability to memory decline in aging revealed by a mega-analysis of structural brain change.
Journal: Nature communications
In common: tidyverse, 4 references, 2 authors
[4] doi:10.1162/imag.a.1242 [code]
Stable individual differences dominate adult brain volume variation until later life.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: 1 reference, 3 authors
[5] doi:10.7554/elife.69995 [code]
Individual variations in 'brain age' relate to early-life factors more than to longitudinal brain change.
Journal: eLife
In common: tidyverse, 3 authors
[6] doi:10.1016/j.ynirp.2022.100155
Aerobic exercise is associated with region-specific changes in volumetric, tensor-based, and fixel-based measures of white matter integrity in healthy older adults.
Journal: Neuroimage. Reports
In common: healthy, 5 references, author Sarah E. Polk
[7] doi:10.1101/2025.05.26.655710 [code]
Stable Individual Differences Dominate Adult Brain Volume Variation Until Later Life
Journal: bioRxiv (preprint)
In common: 3 authors
[8] doi:10.1038/s41598-024-68380-0 [code]
Discrimination of semantically similar verbal memory traces is affected in healthy aging.
Journal: Scientific reports
In common: healthy, 9 references
[9] doi:10.1162/imag_a_00547 [code]
Reliability of structural brain change in cognitively healthy adult samples.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: tidyverse, healthy, 2 authors
[10] doi:10.1073/pnas.2603114123 [code]
The human hippocampus can pattern separate memories by meaning.
Journal: Proceedings of the National Academy of Sciences of the United States of America
In common: tidyverse, 7 references

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.1162/imag.a.1306.svg)](https://openscicode.org/badge/doi/10.1162/imag.a.1306)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.1162/imag.a.1306.svg
   :target: https://openscicode.org/badge/doi/10.1162/imag.a.1306
   :alt: OSCR

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

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)

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