OSCR

Effects of a three-month exercise programme on cognition, mood and neurogenesis: the NeuroFit randomised 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.

The 1 match
  1. [1] § Methods › Statistical analysis ↔ NeuroFit_RCT_Clinical_and_Cognitive_Outcomes_Analysis_Examples.Rmd, lines 102–117 · score 0.69 · glmmTMB, beta family, beta regression, logit, GLMMs, education

Paper

Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

R Markdown · 279 lines · 6.5 KB · MIT · 1 match

  1. ---
  2. title: "Farmand et al 2026 - NeuroFit RCT Clinical and Cognitive Outcomes Analysis Examples"
  3. output: html_document
  4. ---
  5. ```{r setup, message=FALSE, warning=FALSE}
  6. library(readxl)
  7. library(dplyr)
  8. library(tidyr)
  9. library(glmmTMB)
  10. library(nlme)
  11. library(ordinal)
  12. library(DHARMa)
  13. library(emmeans)
  14. library(ggplot2)
  15. ```
  16. ## 1. Import dataset
  17. ```{r import-data}
  18. df <- read_excel("Farmand et al - NeuroFit_RCT_Clinical_Cognitive_Dataframe_ITT_Population.xlsx")
  19. ```
  20. ## 2. Reshape data to long format
  21. ```{r reshape-data}
  22. ldat <- df %>%
  23. pivot_longer(
  24. cols = starts_with(c("A_", "B_")),
  25. names_to = c("time", ".value"),
  26. names_sep = "_"
  27. ) %>%
  28. mutate(
  29. Participant_ID = as.factor(Participant_ID),
  30. Intervention_group = factor(
  31. Intervention_group,
  32. levels = c(0, 1),
  33. labels = c("Control", "Exercise")
  34. ),
  35. time = factor(time, levels = c("A", "B")),
  36. Sex = as.factor(Sex),
  37. Education = as.factor(Education)
  38. )
  39. ```
  40. ## 3. Create baseline covariates
  41. ```{r baseline-covariates}
  42. ldat <- ldat %>%
  43. group_by(Participant_ID) %>%
  44. mutate(
  45. baselineLDI = LDI[time == "A"],
  46. baselineREC = REC[time == "A"],
  47. baselineMCS12 = MCS12[time == "A"],
  48. baselinePCS12 = PCS12[time == "A"],
  49. baselinePHQ9 = PHQ9[time == "A"],
  50. baselineMOCA = MOCA[time == "A"],
  51. baselinePSQI = PSQI[time == "A"],
  52. baselineBMI = BMI[time == "A"],
  53. baselineBF = BF[time == "A"],
  54. baselineHR = HR[time == "A"],
  55. baselineFit = Fit[time == "A"],
  56. baselineSysBP = SysBP[time == "A"],
  57. baselineDiaBP = DiaBP[time == "A"],
  58. baselineWeight = Weight[time == "A"],
  59. baselineWtH = WtH[time == "A"]
  60. ) %>%
  61. ungroup()
  62. ```
  63. ## 4. Transform variables for beta regression
  64. Beta regression was used for bounded continuous outcomes. Variables were min-max normalised to lie between 0 and 1, with a small epsilon adjustment to avoid exact 0 or 1 values.
  65. Beta regression outcomes:
  66. ```{r beta-outcomes}
  67. beta_outcomes <- c("LDI", "REC", "MCS12", "PCS12", "PHQ9", "BF")
  68. ```
  69. ```{r beta-transformation}
  70. epsilon <- 1e-5
  71. normalize_beta <- function(x) {
  72. min_val <- min(x, na.rm = TRUE)
  73. max_val <- max(x, na.rm = TRUE)
  74. scaled <- (x - min_val) / (max_val - min_val)
  75. adjusted <- scaled * (1 - 2 * epsilon) + epsilon
  76. return(adjusted)
  77. }
  78. ldat <- ldat %>%
  79. mutate(across(
  80. all_of(beta_outcomes),
  81. normalize_beta,
  82. .names = "n{col}"
  83. ))
  84. ```
  85. ## 5. Example beta GLMM
  86. The following model illustrates the beta GLMM approach. The same model structure was applied to other beta-regression outcomes by replacing the dependent variable and corresponding baseline covariate.
  87. ```{r beta-glmm-example}
  88. m_LDI <- glmmTMB(
  89. nLDI ~ Intervention_group * time + Sex + Age + Education + baselineLDI +
  90. (1 | Participant_ID),
  91. data = ldat,
  92. family = beta_family(link = "logit"),
  93. REML = FALSE
  94. )
  95. summary(m_LDI)
  96. confint(m_LDI, parm = "beta_", level = 0.95, method = "Wald")
  97. ```
  98. ## 6. Beta GLMM diagnostics
  99. ```{r beta-diagnostics}
  100. sim_LDI <- simulateResiduals(m_LDI)
  101. plot(sim_LDI)
  102. testDispersion(sim_LDI)
  103. testUniformity(sim_LDI)
  104. testOutliers(sim_LDI)
  105. ```
  106. ## 7. Example linear mixed-effects model
  107. Linear mixed-effects models were used for normally distributed continuous outcomes.
  108. LME outcomes:
  109. ```{r lme-outcomes}
  110. lme_outcomes <- c(
  111. "MOCA", "BMI", "HR", "SysBP", "DiaBP",
  112. "Fit", "PSQI", "Weight", "WtH"
  113. )
  114. ```
  115. Example model using MOCA:
  116. ```{r lme-example}
  117. m_MOCA <- lme(
  118. MOCA ~ Intervention_group * time + Sex + Age + baselineMOCA + Education,
  119. random = ~ 1 | Participant_ID,
  120. data = ldat,
  121. na.action = na.exclude
  122. )
  123. summary(m_MOCA)
  124. intervals(m_MOCA)
  125. ```
  126. ## 8. LME diagnostics
  127. ```{r lme-diagnostics}
  128. res_MOCA <- resid(m_MOCA, type = "normalized")
  129. fit_MOCA <- fitted(m_MOCA)
  130. plot(fit_MOCA, res_MOCA,
  131. xlab = "Fitted values",
  132. ylab = "Normalised residuals")
  133. abline(h = 0, lty = 2)
  134. qqnorm(res_MOCA)
  135. qqline(res_MOCA)
  136. hist(res_MOCA, main = "Residuals histogram", xlab = "Normalised residuals")
  137. ```
  138. ## 9. Ordinal mixed model for IPAQ
  139. IPAQ was analysed using a cumulative link mixed model because it was an ordered categorical variable.
  140. ```{r ipaq-model}
  141. ldat <- ldat %>%
  142. mutate(
  143. IPAQ = factor(IPAQ, levels = c(0, 1, 2), ordered = TRUE),
  144. time = factor(time, levels = c("A", "B"))
  145. )
  146. m_IPAQ <- clmm(
  147. IPAQ ~ Intervention_group * time + Sex + Age + Education +
  148. (1 | Participant_ID),
  149. data = ldat,
  150. link = "logit",
  151. Hess = TRUE
  152. )
  153. summary(m_IPAQ)
  154. ```
  155. ## 10. Estimated marginal means
  156. Estimated marginal means were calculated using `emmeans`. The following example uses the LDI beta GLMM.
  157. ```{r emmeans-example}
  158. LDI_emm <- emmeans(m_LDI, ~ Intervention_group * time)
  159. LDI_emm_summary <- summary(
  160. LDI_emm,
  161. infer = TRUE,
  162. type = "response"
  163. )
  164. LDI_emm_summary
  165. ```
  166. ## 11. Back-transform beta-regression estimates
  167. For beta-regression outcomes, estimated marginal means were back-transformed to the original outcome scale.
  168. ```{r back-transform-beta}
  169. min_LDI <- min(ldat$LDI, na.rm = TRUE)
  170. max_LDI <- max(ldat$LDI, na.rm = TRUE)
  171. back_transform_LDI <- function(z) {
  172. ((z - epsilon) / (1 - 2 * epsilon)) * (max_LDI - min_LDI) + min_LDI
  173. }
  174. LDI_emm_raw <- as.data.frame(LDI_emm_summary) %>%
  175. mutate(
  176. Mean = back_transform_LDI(response),
  177. Lower95 = back_transform_LDI(asymp.LCL),
  178. Upper95 = back_transform_LDI(asymp.UCL),
  179. Mean_CI = sprintf("%.2f [%.2f, %.2f]", Mean, Lower95, Upper95),
  180. Time = recode(time, A = "Baseline", B = "Endpoint")
  181. ) %>%
  182. select(
  183. Group = Intervention_group,
  184. Time,
  185. Mean,
  186. Lower95,
  187. Upper95,
  188. Mean_CI
  189. )
  190. LDI_emm_raw
  191. ```
  192. ## 12. Example estimated marginal means plot
  193. ```{r emm-plot}
  194. plot_df <- as.data.frame(LDI_emm_summary) %>%
  195. mutate(
  196. fit_orig = back_transform_LDI(response),
  197. ymin_orig = back_transform_LDI(asymp.LCL),
  198. ymax_orig = back_transform_LDI(asymp.UCL),
  199. time = factor(time, levels = c("A", "B")),
  200. Intervention_group = factor(
  201. Intervention_group,
  202. levels = c("Control", "Exercise")
  203. )
  204. )
  205. ggplot(plot_df, aes(x = time, y = fit_orig, group = Intervention_group)) +
  206. geom_point(aes(colour = Intervention_group), size = 2) +
  207. geom_line(aes(colour = Intervention_group), linewidth = 0.25) +
  208. geom_ribbon(
  209. aes(ymin = ymin_orig, ymax = ymax_orig, fill = Intervention_group),
  210. alpha = 0.2
  211. ) +
  212. scale_x_discrete(labels = c("A" = "Baseline", "B" = "Endpoint")) +
  213. labs(
  214. x = "Time point",
  215. y = "LDI",
  216. colour = "Intervention group",
  217. fill = "Intervention group"
  218. ) +
  219. theme_bw(base_size = 12) +
  220. theme(
  221. legend.title = element_blank(),
  222. panel.grid.major = element_blank(),
  223. panel.grid.minor = element_blank()
  224. )
  225. ```

NeuroFit_RCT_Clinical_and_Cognitive_Outcomes_Analysis_Examples.Rmd at commit 151f24a, under MIT · at the source

Overview

Authors: Sahand Farmand1, Curie Kim1, Andrea Du Preez1, André O. Werneck2, Lucia Batzu1, Dominic Pearce2, Kirsten Brady1, Markos Khir1, Sarah Nicolas3,4, John F. Cryan3,4, Yvonne M. Nolan3,4, Brendon Stubbs2,5,6,7,8, Sandrine Thuret1
  1. Department of Basic and Clinical Neuroscience, Institute of Psychiatry, Psychology and Neuroscience, King’s College London,London, UK
  2. Department of Psychological Medicine, Institute of Psychiatry, Psychology and Neuroscience, King’s College London,London, UK
  3. Department of Anatomy and Neuroscience, University College Cork,Cork, Ireland
  4. APC Microbiome Ireland, University College Cork,Cork, Ireland
  5. Clinical Division of Social Psychiatry, Department of Psychiatry and Psychotherapy, Medical University of Vienna,Vienna, Austria
  6. Comprehensive Center for Clinical Neurosciences and Mental Health (C3NMH), Medical University of Vienna,Vienna, Austria
  7. Department of Psychiatry and Neurosciences, Charité Campus Mitte, Charité, Universitätsmedizin Berlin,Berlin, Germany
  8. Division of Psychology and Mental Health, Manchester Academic Health Science Centre, University of Manchester,Manchester, UK
Journal: npj aging, volume 12, issue 1, article 124
Dates: received 9 March 2026; accepted 26 June 2026; published online 17 September 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1038/s41514-026-00439-w · PMID 42754613 · PMCID PMC13586222 · OpenAlex W7167728052
Open access: hybrid, a free copy (OpenAlex)
Status: code verified
Categories: human (organism)
Methods: Statistics
Keywords: Neurology, Neuroscience
Topic: Neurogenesis and neuroplasticity mechanisms (Developmental Neuroscience, Neuroscience), according to OpenAlex
Citations: not cited yet (Europe PMC); 66 references in the paper

Abstract

Middle age represents a critical window for mental and cognitive change, yet it remains relatively understudied as a target period for preventative lifestyle interventions. We conducted a three-month randomised controlled trial in healthy middle-aged adults in the UK (n = 52) to examine the effects of exercise on pattern separation, cognition and well-being, blood-based biomarkers, and hippocampal neurogenesis, using an in vitro parabiosis assay. No significant intervention-by-time effect was observed for the primary outcome, pattern separation (β = 0.33, p = 0.26). However, significant intervention-by-time effects were detected for depressive symptoms, as measured by the PHQ-9 (β = −1.18, adjusted p = 0.011), and for the percentage of proliferative cells in vitro (β = −0.23, adjusted p = 0.02), suggesting that exercise remodels the circulating milieu in ways that directly influence hippocampal progenitor biology. Overall, our findings suggest that a structured, instructor-led, live online exercise programme in midlife is feasible and may produce temporally staged adaptations, with early effects on mood, intermediate systemic biological changes influencing hippocampal progenitor dynamics, and cognitive benefits that may require longer exposure to emerge. The trial was prospectively registered at Clinicaltrials.gov (NCT05397990).

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.

thuretlabkcl/NeuroFit-RCT-Statistical-Code

License: MIT
State: the link answers, verified on 26 September 2026
Evidence: files inventoried
Commit: 151f24a71135bc98a54a7a7409ac6213c9caed6d, 3 July 2026
Languages: R (3)
Size: 5 files, 3 scripts
Software Heritage: not archived
Found in: “Code availability”
Holds: README, license file, 3 notebooks
Not found: CITATION.cff, environment file, tests, continuous integration, documentation
Tools: emmeans (3 files), ggplot2 (3 files), nlme (3 files), tidyverse (3 files), glmmTMB (2 files)
Availability: 1 check, the latest on 26 September 2026: the link answers
  • 26 September 2026: the link answers
5 files

Code availability

Representative R Markdown scripts illustrating the statistical analyses performed in this study are publicly available at: https://github.com/thuretlabkcl/NeuroFit-RCT-Statistical-Code.git.

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

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 availability

The de-identified data supporting this article is available under a Data Access Agreement from the King’s College London research data repository, KORDS, at https://doi.org/10.18742/32642109.

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, issue, pages, dates, 13 authors, 2 keywords, 2 funders, 64 references.

Cite

This paper

Farmand, S., Kim, C., Du Preez, A., Werneck, A. O., Batzu, L., Pearce, D., Brady, K., Khir, M., Nicolas, S., Cryan, J. F., Nolan, Y. M., Stubbs, B., & Thuret, S. (2026). Effects of a three-month exercise programme on cognition, mood and neurogenesis: the NeuroFit randomised controlled trial. npj aging, 12(1), 124. https://doi.org/10.1038/s41514-026-00439-w

BibTeX

@article{farmand2026effects,
author = {Farmand, Sahand and Kim, Curie and Du Preez, Andrea and Werneck, André O. and Batzu, Lucia and Pearce, Dominic and Brady, Kirsten and Khir, Markos and Nicolas, Sarah and Cryan, John F. and Nolan, Yvonne M. and Stubbs, Brendon and Thuret, Sandrine},
title = {{Effects of a three-month exercise programme on cognition, mood and neurogenesis: the NeuroFit randomised controlled trial}},
journal = {npj aging},
year = {2026},
month = sep,
volume = {12},
number = {1},
pages = {124},
publisher = {Nature Publishing Group},
issn = {2731-6068},
doi = {10.1038/s41514-026-00439-w},
url = {https://doi.org/10.1038/s41514-026-00439-w},
pmid = {42754613},
pmcid = {PMC13586222}
}

RIS

TY - JOUR
AU - Farmand, Sahand
AU - Kim, Curie
AU - Du Preez, Andrea
AU - Werneck, André O.
AU - Batzu, Lucia
AU - Pearce, Dominic
AU - Brady, Kirsten
AU - Khir, Markos
AU - Nicolas, Sarah
AU - Cryan, John F.
AU - Nolan, Yvonne M.
AU - Stubbs, Brendon
AU - Thuret, Sandrine
TI - Effects of a three-month exercise programme on cognition, mood and neurogenesis: the NeuroFit randomised controlled trial
T2 - npj aging
J2 - NPJ Aging
PY - 2026
DA - 2026/09/17
VL - 12
IS - 1
SP - 124
SN - 2731-6068
PB - Nature Publishing Group
DO - 10.1038/s41514-026-00439-w
UR - https://doi.org/10.1038/s41514-026-00439-w
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41514-026-00439-w",
"type": "article-journal",
"title": "Effects of a three-month exercise programme on cognition, mood and neurogenesis: the NeuroFit randomised controlled trial",
"container-title": "npj aging",
"author": [
{
"family": "Farmand",
"given": "Sahand"
},
{
"family": "Kim",
"given": "Curie"
},
{
"family": "Du Preez",
"given": "Andrea"
},
{
"family": "Werneck",
"given": "André O."
},
{
"family": "Batzu",
"given": "Lucia"
},
{
"family": "Pearce",
"given": "Dominic"
},
{
"family": "Brady",
"given": "Kirsten"
},
{
"family": "Khir",
"given": "Markos"
},
{
"family": "Nicolas",
"given": "Sarah"
},
{
"family": "Cryan",
"given": "John F."
},
{
"family": "Nolan",
"given": "Yvonne M."
},
{
"family": "Stubbs",
"given": "Brendon"
},
{
"family": "Thuret",
"given": "Sandrine"
}
],
"container-title-short": "NPJ Aging",
"volume": "12",
"issue": "1",
"page": "124",
"DOI": "10.1038/s41514-026-00439-w",
"PMID": "42754613",
"PMCID": "PMC13586222",
"ISSN": "2731-6068",
"publisher": "Nature Publishing Group",
"URL": "https://doi.org/10.1038/s41514-026-00439-w",
"language": "en",
"issued": {
"date-parts": [
[
2026,
9,
17
]
]
}
}

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-74104-x [code]
TNF-α induces type I IFN signalling to suppress neurogenesis and recruit T cells.
Journal: Nature communications
In common: ggplot2, tidyverse, 7 references, 2 authors
[2] doi:10.1186/s13195-026-02036-1 [code]
Genetic drivers of progression in Alzheimer's disease are distinct from disease risk.
Journal: Alzheimer's research & therapy
In common: glmmTMB, nlme, emmeans, 2 other tools
[3] 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: emmeans, ggplot2, tidyverse, 3 references
[4] 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: glmmTMB, nlme, emmeans, 2 other tools
[5] doi:10.1162/imag.a.1306 [code]
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.)
In common: tidyverse, 4 references
[6] doi:10.1093/braincomms/fcag255 [code]
Impaired consolidation of spatial memory during sleep in patients with leucine-rich glioma-inactivated 1-associated limbic encephalitis.
Journal: Brain communications
In common: emmeans, ggplot2, tidyverse, 2 references
[7] doi:10.1038/s41467-026-76675-1 [code]
Long-read proteogenomic atlas of human neuronal differentiation reveals isoform diversity informing neurodevelopmental risk mechanisms.
Journal: Nature communications
In common: glmmTMB, emmeans, ggplot2, 1 other tool
[8] doi:10.7554/elife.107088 [code]
Development of auditory and spontaneous movement responses to music over the first postnatal year.
Journal: eLife
In common: glmmTMB, emmeans, ggplot2, 1 other tool
[9] doi:10.1038/s41586-026-10444-4 [code]
A brain reward circuit inhibited by next-generation weight-loss drugs in mice.
Journal: Nature
In common: glmmTMB, emmeans, ggplot2, 1 other tool
[10] doi:10.1007/s12311-026-02006-1 [code]
Innovative 3D-Image Analysis of Cerebellar Vascularization Highlights Angiogenic Gene Dysregulations in a Murine Model of Apnea of Prematurity.
Journal: Cerebellum (London, England)
In common: glmmTMB, emmeans, ggplot2, 1 other tool

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.

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: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.

Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.

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