OSCR

Dissociable contributions of cortical thickness and surface area to cognitive ageing: evidence from multiple longitudinal cohorts

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] § Materials and Methods › Cognitive measures ↔ HABS-HD/HABS_g_factor.Rmd, lines 13 to 34 · score 0.61 · Digit Symbol Substitution, HABS HD, Trail, Animals · 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 · 161 lines · 5.1 KB · no license · 1 match

  1. ---
  2. title: "HABS 'g' factor"
  3. output: html_document
  4. ---
  5. ```{r}
  6. library(dplyr)
  7. library(miceadds)
  8. library(lmerTest)
  9. library(gamm4)
  10. ```
  11. ```{r}
  12. mydata <- read.csv("data_raw/HABS_HD_7_Original.csv")
  13. mydata[mydata == "NULL"] <- NA
  14. mydata[mydata == "-9999"] <- NA
  15. mydata <- mydata %>%
  16. arrange(Med_ID, Age) %>%
  17. group_by(Med_ID) %>%
  18. mutate(
  19. A0 = first(Age),
  20. dA = Age - A0
  21. ) %>%
  22. ungroup()
  23. mydata <- mydata[mydata$dA != 12.00, ]
  24. names(mydata)[names(mydata) == "EducationYears"] <- "YoE"
  25. names(mydata)[names(mydata) == "Gender"] <- "Sex"
  26. mydata <- mydata[, c("Med_ID", "Visit_ID", "A0", "dA", "Sex", "YoE", "Trails_A_Time", "Trails_B_Time", "FAS_Total", "Animal_Total", "Digit_Symbol_Substitution", "DS_Total", "MMSE_Total", "Age")]
  27. write.csv(mydata, "COG_data/HABS_gCog_data.csv")
  28. ```
  29. ```{r}
  30. mydata <- read.csv("COG_data/HABS_gCog_data.csv")
  31. # plot(density(mydata$Trails_A_Time, na.rm = TRUE))
  32. # plot(density(mydata$Trails_B_Time, na.rm = TRUE))
  33. mydata$Trails_B_Time[mydata$Trails_B_Time >= 180] <- NA
  34. mydata$Trails_A_Time[mydata$Trails_A_Time >= 150] <- NA
  35. # plot(density(mydata$Trails_A_Time, na.rm = TRUE))
  36. # plot(density(mydata$Trails_B_Time, na.rm = TRUE))
  37. mydata$FAS_Total <- scale(as.numeric(mydata$FAS_Total))
  38. mydata$Animal_Total <- scale(as.numeric(mydata$Animal_Total))
  39. mydata$DSS <- scale(as.numeric(mydata$Digit_Symbol_Substitution))
  40. mydata$DS_Total <- scale(as.numeric(mydata$DS_Total))
  41. mydata$TMA <- (-1) * scale(log(as.numeric(mydata$Trails_A_Time)))
  42. mydata$TMB <- (-1) * scale(log(as.numeric(mydata$Trails_B_Time)))
  43. mydata <- mydata %>% arrange(Med_ID, dA)
  44. mydata$prac <- 1
  45. mydata$prac[!duplicated(mydata$Med_ID)] <- 0
  46. mydata$prac <- as.factor(mydata$prac)
  47. wave_counts <- mydata %>%
  48. group_by(Med_ID) %>%
  49. summarise(n_waves = n_distinct(Visit_ID)) %>%
  50. count(n_waves)%>%
  51. mutate(percent = 100 * n / sum(n))
  52. wave_counts
  53. ```
  54. ```{r}
  55. pca_vars <- c("TMA", "TMB", "FAS_Total", "Animal_Total", "DSS", "DS_Total")
  56. mydata[pca_vars] <- lapply(mydata[pca_vars], function(x) as.numeric(as.vector(x)))
  57. vars_for_mice <- c("Med_ID", "dA", "Sex", "YoE", "prac", pca_vars)
  58. data_mice <- mydata[, vars_for_mice]
  59. data_mice$Med_ID <- as.integer(as.factor(data_mice$Med_ID))
  60. ini <- mice(data_mice, maxit = 0)
  61. pred <- ini$predictorMatrix
  62. meth <- ini$method
  63. pca_rows <- match(pca_vars, colnames(pred))
  64. id_col <- match("Med_ID", colnames(pred))
  65. dA_col <- match("dA", colnames(pred))
  66. sex_col <- match("Sex", colnames(pred))
  67. yoe_col <- match("YoE", colnames(pred))
  68. prac_col <- match("prac", colnames(pred))
  69. pred[pca_rows, id_col] <- -2 # cluster variable
  70. pred[pca_rows, dA_col] <- 1 # include dA as predictor
  71. pred[pca_rows, sex_col] <- 1 # include sex as predictor
  72. pred[pca_rows, yoe_col] <- 1 # include YoE as predictor
  73. pred[pca_rows, prac_col] <- 1 # include YoE as predictor
  74. # Do not impute id, dx, sex, or YoE
  75. pred[id_col, ] <- 0
  76. pred[dA_col, ] <- 0
  77. pred[sex_col, ] <- 0
  78. pred[yoe_col, ] <- 0
  79. pred[prac_col, ] <- 0
  80. # Set method for PCA variables (multilevel predictive mean matching)
  81. meth[pca_rows] <- "2l.pmm"
  82. # Run MICE
  83. imp <- mice(data_mice, method = meth, predictorMatrix = pred,
  84. m = 30, maxit = 10, seed = 123)
  85. # Extract completed dataset
  86. cog_pca_imputed <- complete(imp, 1)
  87. cog_pca_imputed$Med_ID <- data_mice$Med_ID
  88. mydata[pca_vars] <- cog_pca_imputed[pca_vars]
  89. write.csv(mydata, "COG_data/HABS_gCog_data_imputed.csv")
  90. ```
  91. ```{r}
  92. mydata <- read.csv("COG_data/HABS_gCog_data_imputed.csv")
  93. pca_vars <- c("TMA", "TMB", "FAS_Total", "Animal_Total", "DSS", "DS_Total")
  94. cog_pca_data <- na.omit(mydata[mydata$Visit_ID == 1, pca_vars])
  95. pca_cog <- prcomp(cog_pca_data, center = TRUE, scale. = TRUE)
  96. pc1_loadings_cog <- -pca_cog$rotation[, 1]
  97. all_cog <- as.matrix(mydata[, pca_vars])
  98. mydata$gCog0 <- as.numeric(all_cog %*% pc1_loadings_cog)
  99. for (v in pca_vars) {
  100. ## A0
  101. f_A0 <- as.formula(paste0(v, " ~ prac + (1|Med_ID)"))
  102. idx <- complete.cases(mydata[, c(v, "A0", "prac", "Med_ID")])
  103. m_A0 <- lmer(f_A0, data = mydata[idx, ], REML = TRUE)
  104. mydata[[paste0(v, "_A0")]] <- NA
  105. mydata[[paste0(v, "_A0")]][idx] <- residuals(m_A0)
  106. ## A0:dA
  107. f_A0dA <- as.formula(paste0(v, " ~ A0:dA + prac + (1|Med_ID)"))
  108. idx <- complete.cases(mydata[, c(v, "A0", "dA", "prac", "Med_ID")])
  109. m_A0dA <- lmer(f_A0dA, data = mydata[idx, ], REML = TRUE)
  110. mydata[[paste0(v, "_A0dA")]] <- NA
  111. mydata[[paste0(v, "_A0dA")]][idx] <- residuals(m_A0dA)
  112. ## gamm
  113. f_gamm <- as.formula(paste0(v, " ~ s(Age) + prac"))
  114. idx <- complete.cases(mydata[, c(v, "Age", "prac", "Med_ID")])
  115. m_gamm <- gamm(f_gamm, data = mydata[idx, ], random = list(Med_ID = ~1), REML = TRUE)
  116. mydata[[paste0(v, "_gamm")]] <- NA
  117. mydata[[paste0(v, "_gamm")]][idx] <-
  118. residuals(m_gamm$gam, type = "response")
  119. }
  120. mydata$gCog_A0 <- as.numeric(as.matrix(mydata[, paste0(pca_vars, "_A0")]) %*% pc1_loadings_cog)
  121. mydata$gCog_A0dA <- as.numeric(as.matrix(mydata[, paste0(pca_vars, "_A0dA")]) %*% pc1_loadings_cog)
  122. mydata$gCog_gamm <- as.numeric(as.matrix(mydata[, paste0(pca_vars, "_gamm")]) %*% pc1_loadings_cog)
  123. write.csv(mydata,"COG_data/HABS_gCog_data_g_derived.csv",row.names = FALSE)
  124. ```

HABS_g_factor.Rmd at commit 4f02fa7, no license · at the source

Overview

  1. Medical Research Council Cognition and Brain Sciences Unit, University of Cambridge, Cambridge, UK
  2. Center for Lifespan Changes in Brain and Cognition, Department of Psychology, University of Oslo, Oslo, Norway
  3. Department of Psychiatry, University of Cambridge, Cambridge, UK
Institutions: MRC Cognition and Brain Sciences Unit (United Kingdom); University of Cambridge (United Kingdom); University of Oslo (Norway)
Dates: published online 22 March 2026
Type: Preprint · Language: English
License: CC BY
Identifiers: DOI 10.64898/2026.03.20.713139 · OpenAlex W7140041764
Open access: green, a free copy (OpenAlex)
Status: code verified (how the code is found and verified)
Categories: structural MRI / diffusion (modality), human (organism), cognitive (subfield)
Methods: Smoothing, state filtering, decompositions, Connectivity, Statistics, Preprocessing
Keywords: ageing, cognition, cortical thickness, longitudinal, surface area
Topic: Functional Brain Connectivity Studies (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Funding: Biotechnology and Biological Sciences Research Council Grant (BB/H008217/1); Biotechnology and Biological Sciences Research Council (BB/H008217/1); the European Union’s Horizon 2020 research and innovation programme (732592); the National Institute on Aging of the National Institutes of Health (R01AG054073, R01AG058533, R01AG070862, P41EB015922, U19AG078109); NIH (P30 AG066444, P50 AG00561, P30 NS09857781, P01 AG026276, P01 AG003991, R01 AG043434, UL1 TR000448, R01 EB009352); Medical Research Council (SUAG/046/G101400)
Citations: not cited yet (Europe PMC); 41 references in the paper

Abstract

Cortical volume, a widely-used marker of brain ageing, is the product of two genetically and developmentally dissociable morphometric features: thickness and area. However, it remains unclear whether these two features have dissociable consequences for cognitive ageing. To address this, we analyse cross-sectional and longitudinal neuroimaging and cognitive data from one discovery cohort (Cam-CAN) and two independent, pre-registered replication cohorts (OASIS-3 and HABS-HD), leveraging wide age ranges across adulthood, different follow-up intervals and diverse population backgrounds. We show that thickness declines more steeply with age than does area, and shows stronger associations with longitudinal change in fluid cognitive abilities, fairly uniformly across the cortex. Cognitive change is also dependent on baseline thickness, independent of thickness change and independent of baseline cognitive ability. In contrast, area is comparatively stable across adulthood, at least until old age, and shows weaker and more heterogeneous associations with cognitive change, despite being a stronger mediator of the effect of polygenic scores on baseline cognitive ability. Together, these findings help to reconcile inconsistencies in the literature, and indicate that thickness provides a more sensitive marker of dynamic neurobiological processes underlying cognitive ageing, whereas area seems to reflect primarily stable, trait-like variation in cognitive ability.

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.

InaDemetriou/GrayMatter_THK_SA_Dissociation

License: none: the authors keep all their rights
State: the link answers, verified on 30 September 2026
Evidence: files inventoried
Commit: 4f02fa7052cb688f07f65f7a1b30ec571c12695b, 9 June 2026
Languages: R (7)
Size: 40 files, 7 scripts
Software Heritage: not archived
Found in: “Data availability”
Holds: 7 notebooks
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: lmerTest (7 files), tidyverse (7 files), car (3 files), easystats (3 files), ggplot2 (3 files), lavaan (3 files), patchwork (2 files), broom (1 file), data.table (1 file), ggpubr (1 file), lme4 (1 file), psych (1 file)
Availability: 1 check, the latest on 30 September 2026: the link answers
  • 30 September 2026: the link answers
7 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;
  • 7 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

R code (for all analyses) and data (for Cam-CAN only) are available here: https://github.com/InaDemetriou/GrayMatter_THK_SA_Dissociation

Raw data for OASIS-3 and HABS-HD can be requested from: https://www.nitrc.org/projects/oasis3 and https://ida.loni.usc.edu/home/projectPage.jsp?project=HABS_HD respectively.

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, 30 September 2026: the first record

Recorded: type, language, journal, dates, 7 authors, 5 keywords, 6 funders, 39 references.

Cite

This paper

Demetriou, I., Correia, M., Vidal-Piñeiro, D., Apšvalka, D., Attaheri, A., Emery, T., & Henson, R. N. (2026). Dissociable contributions of cortical thickness and surface area to cognitive ageing: evidence from multiple longitudinal cohorts. bioRxiv (preprint). https://doi.org/10.64898/2026.03.20.713139

BibTeX

@article{demetriou2026dissociable,
author = {Demetriou, Ina and Correia, Marta and Vidal-Piñeiro, Didac and Apšvalka, Dace and Attaheri, Adam and Emery, Tina and Henson, Richard N.},
title = {{Dissociable contributions of cortical thickness and surface area to cognitive ageing: evidence from multiple longitudinal cohorts}},
journal = {bioRxiv (preprint)},
year = {2026},
month = mar,
publisher = {bioRxiv},
issn = {2692-8205},
doi = {10.64898/2026.03.20.713139},
url = {https://doi.org/10.64898/2026.03.20.713139}
}

RIS

TY - JOUR
AU - Demetriou, Ina
AU - Correia, Marta
AU - Vidal-Piñeiro, Didac
AU - Apšvalka, Dace
AU - Attaheri, Adam
AU - Emery, Tina
AU - Henson, Richard N.
TI - Dissociable contributions of cortical thickness and surface area to cognitive ageing: evidence from multiple longitudinal cohorts
T2 - bioRxiv (preprint)
J2 - bioRxiv
PY - 2026
DA - 2026/03/22
SN - 2692-8205
PB - bioRxiv
DO - 10.64898/2026.03.20.713139
UR - https://doi.org/10.64898/2026.03.20.713139
LA - en
ER -

CSL-JSON

{
"id": "10.64898/2026.03.20.713139",
"type": "article",
"title": "Dissociable contributions of cortical thickness and surface area to cognitive ageing: evidence from multiple longitudinal cohorts",
"container-title": "bioRxiv (preprint)",
"author": [
{
"family": "Demetriou",
"given": "Ina"
},
{
"family": "Correia",
"given": "Marta"
},
{
"family": "Vidal-Piñeiro",
"given": "Didac"
},
{
"family": "Apšvalka",
"given": "Dace"
},
{
"family": "Attaheri",
"given": "Adam"
},
{
"family": "Emery",
"given": "Tina"
},
{
"family": "Henson",
"given": "Richard N."
}
],
"container-title-short": "bioRxiv",
"DOI": "10.64898/2026.03.20.713139",
"ISSN": "2692-8205",
"publisher": "bioRxiv",
"URL": "https://doi.org/10.64898/2026.03.20.713139",
"language": "en",
"issued": {
"date-parts": [
[
2026,
3,
22
]
]
}
}

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-025-66354-y [code]
Vulnerability to memory decline in aging revealed by a mega-analysis of structural brain change.
Journal: Nature communications
In common: broom, easystats, lmerTest, 4 other tools, structural MRI / diffusion, cognitive, 10 references, 2 authors
[2] doi:10.1162/imag_a_00547 [code]
Reliability of structural brain change in cognitively healthy adult samples.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: broom, easystats, psych, 5 other tools, structural MRI / diffusion, 6 references, 2 authors
[3] doi:10.1038/s41593-026-02363-4 [code]
Cortical thickness changes precede high levels of amyloid by at least 7 years.
Journal: Nature neuroscience
In common: broom, easystats, lmerTest, 6 other tools, structural MRI / diffusion, 3 references, author Didac Vidal-Piñeiro
[4] doi:10.1038/s41467-026-68886-3 [code]
Precision estimates of longitudinal brain aging capture unexpected individual differences in one year.
Journal: Nature communications
In common: broom, easystats, psych, 4 other tools, 6 references
[5] doi:10.1162/nol_a_00127 [code]
Differences in Cortical Surface Area in Developmental Language Disorder.
Journal: Neurobiology of language (Cambridge, Mass.)
In common: lavaan, broom, psych, 7 other tools, structural MRI / diffusion, 2 references
[6] doi:10.1038/s42003-026-10282-0 [code]
Genetic risk of Alzheimer's disease is associated with loss of brain network segregation in midlife.
Journal: Communications biology
In common: broom, easystats, psych, 5 other tools, 1 reference, author Richard N Henson
[7] doi:10.1038/s41398-026-04010-9 [code]
Bullying victimization and brain development: a longitudinal structural magnetic resonance imaging study from adolescence to early adulthood.
Journal: Translational psychiatry
In common: lavaan, broom, easystats, 8 other tools, structural MRI / diffusion, 1 reference
[8] doi:10.1038/s41598-025-13610-2 [code]
Complementary MR measures of white matter and their relation to cardiovascular health and cognition.
Journal: Scientific reports
In common: lavaan, broom, easystats, 3 other tools, structural MRI / diffusion, cognitive, 5 references
[9] doi:10.1093/braincomms/fcaf511 [code]
Cortical mean diffusivity detects early age-related changes and associates with cognition and plasma biomarkers.
Journal: Brain communications
In common: broom, psych, car, 5 other tools, structural MRI / diffusion, 3 references
[10] doi:10.1016/j.dcn.2025.101593 [code]
Large-scale examination of hot and cool executive function in children born preterm.
Journal: Developmental cognitive neuroscience
In common: lavaan, psych, car, 5 other tools, structural MRI / diffusion, 3 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.64898/2026.03.20.713139.svg)](https://openscicode.org/badge/doi/10.64898/2026.03.20.713139)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.64898/2026.03.20.713139.svg
   :target: https://openscicode.org/badge/doi/10.64898/2026.03.20.713139
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.64898/2026.03.20.713139"><img src="https://openscicode.org/badge/doi/10.64898/2026.03.20.713139.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.