Effects of a three-month exercise programme on cognition, mood and neurogenesis: the NeuroFit randomised controlled trial.
The 1 match
- [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
- ---
- title: "Farmand et al 2026 - NeuroFit RCT Clinical and Cognitive Outcomes Analysis Examples"
- output: html_document
- ---
- ```{r setup, message=FALSE, warning=FALSE}
- library(readxl)
- library(dplyr)
- library(tidyr)
- library(glmmTMB)
- library(nlme)
- library(ordinal)
- library(DHARMa)
- library(emmeans)
- library(ggplot2)
- ```
- ## 1. Import dataset
- ```{r import-data}
- df <- read_excel("Farmand et al - NeuroFit_RCT_Clinical_Cognitive_Dataframe_ITT_Population.xlsx")
- ```
- ## 2. Reshape data to long format
- ```{r reshape-data}
- ldat <- df %>%
- pivot_longer(
- cols = starts_with(c("A_", "B_")),
- names_to = c("time", ".value"),
- names_sep = "_"
- ) %>%
- mutate(
- Participant_ID = as.factor(Participant_ID),
- Intervention_group = factor(
- Intervention_group,
- levels = c(0, 1),
- labels = c("Control", "Exercise")
- ),
- time = factor(time, levels = c("A", "B")),
- Sex = as.factor(Sex),
- Education = as.factor(Education)
- )
- ```
- ## 3. Create baseline covariates
- ```{r baseline-covariates}
- ldat <- ldat %>%
- group_by(Participant_ID) %>%
- mutate(
- baselineLDI = LDI[time == "A"],
- baselineREC = REC[time == "A"],
- baselineMCS12 = MCS12[time == "A"],
- baselinePCS12 = PCS12[time == "A"],
- baselinePHQ9 = PHQ9[time == "A"],
- baselineMOCA = MOCA[time == "A"],
- baselinePSQI = PSQI[time == "A"],
- baselineBMI = BMI[time == "A"],
- baselineBF = BF[time == "A"],
- baselineHR = HR[time == "A"],
- baselineFit = Fit[time == "A"],
- baselineSysBP = SysBP[time == "A"],
- baselineDiaBP = DiaBP[time == "A"],
- baselineWeight = Weight[time == "A"],
- baselineWtH = WtH[time == "A"]
- ) %>%
- ungroup()
- ```
- ## 4. Transform variables for beta regression
- 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.
- Beta regression outcomes:
- ```{r beta-outcomes}
- beta_outcomes <- c("LDI", "REC", "MCS12", "PCS12", "PHQ9", "BF")
- ```
- ```{r beta-transformation}
- epsilon <- 1e-5
- normalize_beta <- function(x) {
- min_val <- min(x, na.rm = TRUE)
- max_val <- max(x, na.rm = TRUE)
- scaled <- (x - min_val) / (max_val - min_val)
- adjusted <- scaled * (1 - 2 * epsilon) + epsilon
- return(adjusted)
- }
- ldat <- ldat %>%
- mutate(across(
- all_of(beta_outcomes),
- normalize_beta,
- .names = "n{col}"
- ))
- ```
- ## 5. Example beta GLMM
- 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.
- ```{r beta-glmm-example}
- m_LDI <- glmmTMB(
- nLDI ~ Intervention_group * time + Sex + Age + Education + baselineLDI +
- (1 | Participant_ID),
- data = ldat,
- family = beta_family(link = "logit"),
- REML = FALSE
- )
- summary(m_LDI)
- confint(m_LDI, parm = "beta_", level = 0.95, method = "Wald")
- ```
- ## 6. Beta GLMM diagnostics
- ```{r beta-diagnostics}
- sim_LDI <- simulateResiduals(m_LDI)
- plot(sim_LDI)
- testDispersion(sim_LDI)
- testUniformity(sim_LDI)
- testOutliers(sim_LDI)
- ```
- ## 7. Example linear mixed-effects model
- Linear mixed-effects models were used for normally distributed continuous outcomes.
- LME outcomes:
- ```{r lme-outcomes}
- lme_outcomes <- c(
- "MOCA", "BMI", "HR", "SysBP", "DiaBP",
- "Fit", "PSQI", "Weight", "WtH"
- )
- ```
- Example model using MOCA:
- ```{r lme-example}
- m_MOCA <- lme(
- MOCA ~ Intervention_group * time + Sex + Age + baselineMOCA + Education,
- random = ~ 1 | Participant_ID,
- data = ldat,
- na.action = na.exclude
- )
- summary(m_MOCA)
- intervals(m_MOCA)
- ```
- ## 8. LME diagnostics
- ```{r lme-diagnostics}
- res_MOCA <- resid(m_MOCA, type = "normalized")
- fit_MOCA <- fitted(m_MOCA)
- plot(fit_MOCA, res_MOCA,
- xlab = "Fitted values",
- ylab = "Normalised residuals")
- abline(h = 0, lty = 2)
- qqnorm(res_MOCA)
- qqline(res_MOCA)
- hist(res_MOCA, main = "Residuals histogram", xlab = "Normalised residuals")
- ```
- ## 9. Ordinal mixed model for IPAQ
- IPAQ was analysed using a cumulative link mixed model because it was an ordered categorical variable.
- ```{r ipaq-model}
- ldat <- ldat %>%
- mutate(
- IPAQ = factor(IPAQ, levels = c(0, 1, 2), ordered = TRUE),
- time = factor(time, levels = c("A", "B"))
- )
- m_IPAQ <- clmm(
- IPAQ ~ Intervention_group * time + Sex + Age + Education +
- (1 | Participant_ID),
- data = ldat,
- link = "logit",
- Hess = TRUE
- )
- summary(m_IPAQ)
- ```
- ## 10. Estimated marginal means
- Estimated marginal means were calculated using `emmeans`. The following example uses the LDI beta GLMM.
- ```{r emmeans-example}
- LDI_emm <- emmeans(m_LDI, ~ Intervention_group * time)
- LDI_emm_summary <- summary(
- LDI_emm,
- infer = TRUE,
- type = "response"
- )
- LDI_emm_summary
- ```
- ## 11. Back-transform beta-regression estimates
- For beta-regression outcomes, estimated marginal means were back-transformed to the original outcome scale.
- ```{r back-transform-beta}
- min_LDI <- min(ldat$LDI, na.rm = TRUE)
- max_LDI <- max(ldat$LDI, na.rm = TRUE)
- back_transform_LDI <- function(z) {
- ((z - epsilon) / (1 - 2 * epsilon)) * (max_LDI - min_LDI) + min_LDI
- }
- LDI_emm_raw <- as.data.frame(LDI_emm_summary) %>%
- mutate(
- Mean = back_transform_LDI(response),
- Lower95 = back_transform_LDI(asymp.LCL),
- Upper95 = back_transform_LDI(asymp.UCL),
- Mean_CI = sprintf("%.2f [%.2f, %.2f]", Mean, Lower95, Upper95),
- Time = recode(time, A = "Baseline", B = "Endpoint")
- ) %>%
- select(
- Group = Intervention_group,
- Time,
- Mean,
- Lower95,
- Upper95,
- Mean_CI
- )
- LDI_emm_raw
- ```
- ## 12. Example estimated marginal means plot
- ```{r emm-plot}
- plot_df <- as.data.frame(LDI_emm_summary) %>%
- mutate(
- fit_orig = back_transform_LDI(response),
- ymin_orig = back_transform_LDI(asymp.LCL),
- ymax_orig = back_transform_LDI(asymp.UCL),
- time = factor(time, levels = c("A", "B")),
- Intervention_group = factor(
- Intervention_group,
- levels = c("Control", "Exercise")
- )
- )
- ggplot(plot_df, aes(x = time, y = fit_orig, group = Intervention_group)) +
- geom_point(aes(colour = Intervention_group), size = 2) +
- geom_line(aes(colour = Intervention_group), linewidth = 0.25) +
- geom_ribbon(
- aes(ymin = ymin_orig, ymax = ymax_orig, fill = Intervention_group),
- alpha = 0.2
- ) +
- scale_x_discrete(labels = c("A" = "Baseline", "B" = "Endpoint")) +
- labs(
- x = "Time point",
- y = "LDI",
- colour = "Intervention group",
- fill = "Intervention group"
- ) +
- theme_bw(base_size = 12) +
- theme(
- legend.title = element_blank(),
- panel.grid.major = element_blank(),
- panel.grid.minor = element_blank()
- )
- ```
NeuroFit_RCT_Clinical_and_Cognitive_Outcomes_Analysis_Examples.Rmd at commit 151f24a, under MIT · at the source
Overview
- Department of Basic and Clinical Neuroscience, Institute of Psychiatry, Psychology and Neuroscience, King’s College London,London, UK
- Department of Psychological Medicine, Institute of Psychiatry, Psychology and Neuroscience, King’s College London,London, UK
- Department of Anatomy and Neuroscience, University College Cork,Cork, Ireland
- APC Microbiome Ireland, University College Cork,Cork, Ireland
- Clinical Division of Social Psychiatry, Department of Psychiatry and Psychotherapy, Medical University of Vienna,Vienna, Austria
- Comprehensive Center for Clinical Neurosciences and Mental Health (C3NMH), Medical University of Vienna,Vienna, Austria
- Department of Psychiatry and Neurosciences, Charité Campus Mitte, Charité, Universitätsmedizin Berlin,Berlin, Germany
- Division of Psychology and Mental Health, Manchester Academic Health Science Centre, University of Manchester,Manchester, UK
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
151f24a71135bc98a54a7a7409ac6213c9caed6d, 3 July 2026Availability: 1 check, the latest on 26 September 2026: the link answers
- 26 September 2026: the link answers
5 files
- NeuroFit_RCT_Blood-Based
_Biomarker_Analysis_Exam , R, 149 linesples.Rmd - NeuroFit_RCT_Clinical_an
d_Cognitive_Outcomes_Ana , R, 279 lines, 1 matchlysis_Examples.Rmd - NeuroFit_RCT_Neurogenesi
s_Proliferation_Analysis , R, 246 lines_Examples.Rmd - LICENSE, License, 21 lines
- README.md, Text, 62 lines
Code availability
Representative R Markdown scripts illustrating the statistical analyses performed in this study are publicly available at: https://
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://
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://
BibTeX
@article{farmand2026effe
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/
url = {https://
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/
VL - 12
IS - 1
SP - 124
SN - 2731-6068
PB - Nature Publishing Group
DO - 10.1038/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1038/
"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":
"volume": "12",
"issue": "1",
"page": "124",
"DOI": "10.1038/
"PMID": "42754613",
"PMCID": "PMC13586222",
"ISSN": "2731-6068",
"publisher": "Nature Publishing Group",
"URL": "https://
"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 communicationsIn 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 & therapyIn 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 AmericaIn 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 reportsIn 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 communicationsIn 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 communicationsIn 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: eLifeIn 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: NatureIn 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.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 3 scripts, and 1 match between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:5ce235f4ae9c575f…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
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.
