Cerebellar aging is spatially heterogeneous and supports cognitive resilience in later life.
A correction to this paper has been published: the notice, 42337099, from Europe PMC.
The 4 matches
- [1] § Results › Heterogeneous aging of cerebellar tissue and associations with cognition ↔ Figures.R, lines 83–172 · score 0.74 · young adult, tissue loss, neocortical volume, eTIV, ROIs, sensory
- [2] § Methods › Task-level validation (HCP) ↔ Figures.R, lines 180–265 · score 0.61 · Johnson Neyman, score age, FDR, MoCA, slope, aging
- [3] § Methods › Microstructure analyses: T1W/T2W (HCP) ↔ Figures.R, lines 83–172 · score 0.55 · young adult, ROIs, T1W, T2W, tissue, predicted
- [4] § Regional cerebellar age-related volume changes and associations with cognition ↔ Figures.R, lines 180–265 · score 0.51 · visuospatial scores, signature, FDR, MoCA, maps, mm3
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 · 347 lines · 51 KB · no license · 4 matches
- ##############
- #### Figure 1
- library(sjPlot)
- library(MASS)
- library(stargazer)
- library(effectsize)
- library(ggplot2)
- library(ggeffects)
- predicted_values <- ggpredict(modela, terms = "interview_age_years")
- plot(predicted_values) + geom_point(data = mydata, aes(x = interview_age_years, y = CortexVol), color = "grey33", alpha = 0.2, size = 6, position=position_jitter(width=0), stroke=1) + geom_smooth(method = "lm", formula = y ~ x, color = "black", fullrange=T) + labs(title = "", x = "Age [years]", y = "Neocortical\nVolume [mm³]") + theme_classic() + theme(axis.ticks.x = element_line(color = "black", size = 0.5), axis.ticks.y = element_line(color = "black", size = 0.5), axis.line.x = element_line(color = "black", size = 0.5), axis.line.y = element_line(color = "black", size = 0.5), axis.text.x = element_text(color = "black", face = "plain", size = 25), axis.text.y = element_text(color = "black", face = "plain", size = 25), axis.title.y = element_text(color = "black", face = "plain", size = 30, hjust = 0.5, vjust = -7), axis.title.x = element_text(color = "black", face = "plain", size = 30, vjust = 2), plot.margin = margin(0.5, 0.5, 0.5, 0.5, "cm"), panel.border = element_blank()) + scale_y_continuous(breaks = c(310000, 610000)) + scale_x_continuous(breaks = c(36, 100), labels=c("36", "100"), limits = c(36, 100))
- ####
- predicted_values <- ggpredict(modela, terms = "interview_age_years")
- plot(predicted_values) + geom_point(data = mydata, aes(x = interview_age_years, y = eTIV), color = "goldenrod", alpha = 0.2, size = 6, position=position_jitter(width=0), stroke=1) + geom_smooth(method = "lm", formula = y ~ x, color = "black", fullrange=T, se=TRUE) + labs(title = "", x = "Age [years]", y = "eTIV [mm³]") + theme_classic() + theme(axis.ticks.x = element_line(color = "black", size = 0.5), axis.ticks.y = element_line(color = "black", size = 0.5),axis.line.x = element_line(color = "black", size = 0.5), axis.line.y = element_line(color = "black", size = 0.5),axis.text.x = element_text(color = "black", face = "plain", size = 25), axis.text.y = element_text(color = "black", face = "plain", size = 25), axis.title.y = element_text(color = "black", face = "plain", size = 30, hjust = 0.5, vjust = -3), axis.title.x = element_text(color = "black", face = "plain", size = 30, vjust = 2), plot.margin = margin(0.5, 0.5, 0.5, 0.5, "cm"), panel.border = element_blank() ) + scale_y_continuous(breaks = c(1000, 1800)) + scale_x_continuous(breaks = c(36, 100), labels=c("36", "100"), limits = c(36, 100))
- ####
- predicted_values <- ggpredict(modela, terms = "interview_age_years")
- plot(predicted_values) + geom_point(data = mydata, aes(x = interview_age_years, y = Total_Cerebel_Vol), color = "#428CD4", alpha = 0.2, size = 6, position=position_jitter(width=0), stroke=1) + geom_smooth(method = "lm", formula = y ~ x, color = "black", fullrange=T, se=TRUE) + labs(title = "", x = "Age [years]", y = "Cerebellar\nVolume [mm³]") + theme_classic() + theme(axis.ticks.x = element_line(color = "black", size = 0.5), axis.ticks.y = element_line(color = "black", size = 0.5),axis.line.x = element_line(color = "black", size = 0.5), axis.line.y = element_line(color = "black", size = 0.5),axis.text.x = element_text(color = "black", face = "plain", size = 25), axis.text.y = element_text(color = "black", face = "plain", size = 25),axis.title.y = element_text(color = "black", face = "plain", size = 30, hjust = 0.5, vjust = -6), axis.title.x = element_text(color = "black", face = "plain", size = 30, vjust = 2), plot.margin = margin(0.5, 0.5, 0.5, 0.5, "cm"), panel.border = element_blank() ) + scale_y_continuous(breaks = c(90000, 172000)) + scale_x_continuous(breaks = c(36, 100), labels=c("36", "100"), limits = c(36, 100))
- ####
- predictor_labels <- c("Cerebral [mm³]", "eTIV [mm³]","Cerebellar [mm³]")
- effect_sizes_df <- data.frame(
- Predictor = c("CortexVol", "eTIV", "Total_Cerebel_Vol"),
- Cohen_f = cohen_f_values,
- Label = predictor_labels
- )
- bar_chart_effect_size <- ggplot(data = effect_sizes_df, aes(x = Predictor, y = Cohen_f, fill = Predictor)) + geom_bar(stat = "identity") + scale_x_discrete(labels = c("CortexVol" = "Neocortical\n[mm³]", "eTIV"="eTIV\n[mm³]", "Total_Cerebel_Vol" = "Cerebellar\n[mm³]")) + scale_fill_manual(values = c("CortexVol" = "grey33", "eTIV"="goldenrod", "Total_Cerebel_Vol" = "#428CD4")) + labs(title = "", x = "Predictor", y = "Coefficient") + theme_classic() + theme(legend.position =("NA"), axis.ticks.x = element_blank(), axis.ticks.y = element_blank(), axis.ticks.length = unit(0.25,"cm"), axis.line.x = element_blank(), axis.line.y = element_line(color = "black", size = 5), axis.text.y = element_text(color="black",face="plain",size = 52, vjust=0.3, margin=margin(4,4,4,4)), axis.text.x = element_text(color="black",face="plain",size = 63), axis.title.y = element_text(color="black",face="bold",size = 69, hjust = 0.5), axis.title.x = element_blank(), plot.margin=margin(1,3,1,1,"cm")) + labs(title = "", x = "", y = "\nSize of Age Effect") + theme(text = element_text(size = 69)) + theme(plot.title=element_text(hjust=0.5, face="bold"), axis.text.y.right=element_text(hjust=0.5, margin=margin(4,4,4,4)), axis.title.y.right=element_text(vjust=4.5)) + scale_y_continuous(position="right") + theme(plot.margin = margin(1,3,1,3, "cm"), panel.border = element_blank())
- ####
- library(ggplot2)
- library(gridExtra)
- library(patchwork)
- library(cowplot)
- models <- list()
- custom_palette <- c("#80D0C7", "#8CC7B3", "#99BF9F", "#A6B78B", "#B2AF77", "#BFA763", "#CC9F4F", "#D8973B", "#E58F27", "#F28713", "#FF7F00")
- lobules <- c("I.III", "IV", "V", "VI", "Crus.I", "Crus.II", "VIIB", "VIIIA", "VIIIB", "IX", "X")
- plot_bilateral_average <- function(data, lobule_name, color) {
- data$bilateral_average <- rowMeans(data[, c(paste0("Left.", lobule_name), paste0("Right.", lobule_name))], na.rm = TRUE)
- plot <- ggplot(data = data, aes(x = interview_age_years, y = bilateral_average)) + geom_point(color = color, alpha=0.2, size=4) + geom_smooth(method = "lm", se = TRUE, color = color, fill=alpha(color,0.3)) + labs(title = paste("", lobule_name), x = "", y = "Bilateral Average Volume") + theme_classic() + theme(axis.ticks.x = element_blank(), axis.ticks.y = element_blank(), axis.line.x = element_line(color = "black", size = 2), axis.line.y = element_blank(), axis.text.x = element_text(color = "black", face = "plain", size = 35, hjust=0.8, vjust=-0.2), axis.text.y = element_blank(), axis.title.y = element_text(color = "black", face = "plain", size = 35, margin = margin(t = 12, b = 12)), axis.title.x = element_text()) + labs(title = "", x = "\n\n\n\n", y = "") + theme(text = element_text(size = 30)) +
- scale_x_continuous(breaks = c(36, 100), labels=c("36", "100"), limits = c(36, 100)) + scale_y_continuous(breaks = c(0, 20000), limits = c(0, 22000))
- return(plot)
- }
- scatterplots <- lapply(1:length(lobules), function(i) {
- plot_bilateral_average(mydata, lobules[i], custom_palette[i])
- })
- master_plot <- grid.arrange(grobs = scatterplots, nrow = 1)
- master_plot <- ggdraw(master_plot) + draw_label("\n I-III IV V VI Crus I Crus II VIIb VIIIa VIIIb IX X ", fontface = 'bold', size = 36, x = 0.5, y = 0.210)
- master_plot <- ggdraw(master_plot) + draw_label("Age [years]", fontface = 'plain', size = 36, x = 0.5, y = 0.120)
- master_plot <- master_plot + geom_segment(aes(x = 0.0055, xend = 0.0055, y = 0.248, yend = 0.87), linetype = "solid", color = "black", size = 2) + annotate("text", x = 0.0087, y = 0.282, label = "0", vjust = 1, hjust = 0.001, size = 13) + annotate("text", x = 0.0087, y = 0.83, label = "20000", vjust = 0, hjust = 0.001, size = 13) + annotate("text", x = -0.008, y = 0.57, label = "Volume [mm³]", angle = 90, vjust = 0.6, hjust = 0.5, size = 15, fontface = 'bold') + theme(plot.margin = margin(0, 2, 0, 2, "cm"), panel.border = element_blank())
- print(master_plot)
- ####
- lobules <- c("I.III_t1t2","IV_t1t2","V_t1t2","VI_t1t2","Crus.I_t1t2","Crus.II_t1t2","VIIB_t1t2","VIIIA_t1t2","VIIIB_t1t2","IX_t1t2", "X_t1t2")
- models <- list()
- custom_palette <- c("#80D0C7", "#8CC7B3", "#99BF9F", "#A6B78B", "#B2AF77", "#BFA763", "#CC9F4F", "#D8973B", "#E58F27", "#F28713", "#FF7F00")
- plot_bilateral_average <- function(data, lobule_name, color) {
- data$bilateral_average <- rowMeans(data[, c(paste0("Left_", lobule_name), paste0("Right_", lobule_name))], na.rm = TRUE)
- plot <- ggplot(data = data, aes(x = interview_age_years, y = bilateral_average)) + geom_point(color = color, alpha=0.2, size=4) + geom_smooth(method = "lm", se = TRUE, color = color, fill=alpha(color,0.3)) + labs(title = paste("", lobule_name), x = "", y = "Bilateral Average T1/T2 Ratio") + theme_classic() + theme(axis.ticks.x = element_blank(), axis.ticks.y = element_blank(), axis.line.x = element_line(color = "black", size = 2), axis.line.y = element_blank(), axis.text.x = element_text(color = "black", face = "plain", size = 34.5, hjust=0.9, vjust=-0.1), axis.text.y = element_blank(), axis.title.y = element_text(color = "black", face = "plain", size = 35, margin = margin(t = 12, b = 12)), axis.title.x = element_text()) + labs(title = "", x = "\n\n\n\n", y = "") + theme(text = element_text(size = 30)) + scale_x_continuous(breaks = c(36, 100), labels=c("36", "100"), limits = c(36, 100))
- return(plot)
- }
- scatterplots <- lapply(1:length(lobules), function(i) {
- plot_bilateral_average(mydata, lobules[i], custom_palette[i])
- })
- master_plot <- grid.arrange(grobs = scatterplots, nrow = 1)
- master_plot <- ggdraw(master_plot) +
- draw_label("\n I-III IV V VI Crus I Crus II VIIb VIIIa VIIIb IX X ", fontface = 'bold', size = 36, x = 0.5, y = 0.190)
- master_plot <- ggdraw(master_plot) + draw_label("Age [years]", fontface = 'plain', size = 36, x = 0.5, y = 0.120)
- master_plot <- master_plot + geom_segment(aes(x = 0.0055, xend = 0.0055, y = 0.25, yend = 0.89), linetype = "solid", color = "black", size = 2) + annotate("text", x = 0.0087, y = 0.291, label = "1.5", vjust = 1, hjust = 0.001, size = 13) + annotate("text", x = 0.0087, y = 0.87, label = "3", vjust = 0, hjust = 0.001, size = 13) + annotate("text", x = -0.008, y = 0.56, label = "T1w/T2w ratio", angle = 90, vjust = 0.6, hjust = 0.5, size = 15, fontface = 'bold') + theme(plot.margin = margin(0, 2, 0, 2, "cm"), panel.border = element_blank())
- print(master_plot)
- ####
- young_data <- read.xlsx(file_path)
- young_data_filtered <- young_data %>%
- filter(dataset == "young adult")
- young_data_filtered <- young_data %>%
- dplyr::select(-starts_with("age"), -contains("dataset"), -contains("subject_id"))
- roi_data <- young_data_filtered[,-1]
- roi_data_cleaned <- data.frame(lapply(roi_data, function(x) as.numeric(as.character(x))))
- mean_t1t2 <- colMeans(roi_data_cleaned, na.rm = TRUE)
- mean_t1t2_df <- data.frame(ROI = names(mean_t1t2), Mean_T1T2 = mean_t1t2)
- roi_columns <- grep("_t1t2$", names(mydata), value = TRUE)
- slopes <- numeric(length(roi_columns))
- for (i in seq_along(roi_columns)) {
- roi <- roi_columns[i]
- model <- rlm(as.formula(paste(roi, "~ interview_age_years")), data = mydata)
- slopes[i] <- coef(model)["interview_age_years"]
- }
- mean_t1t2_df$ROI_clean <- sub("_t1t2$", "", mean_t1t2_df$ROI)
- results <- data.frame(ROI = roi_columns, Slope = slopes)
- results$ROI_clean <- sub("_t1t2$", "", results$ROI)
- results$Mean_T1T2 <- mean_t1t2_df$Mean_T1T2[match(results$ROI_clean, mean_t1t2_df$ROI_clean)]
- results_clean <- results %>%
- filter(!ROI_clean %in% exclude_rois)
- results_clean <- results_clean %>%
- filter(!is.na(Mean_T1T2) & !is.infinite(Mean_T1T2) & !is.na(Slope) & !is.infinite(Slope))
- results_clean$Z_Slope <- scale(results_clean$Slope)
- library(ggplot2)
- library(grid)
- ggplot(results_clean, aes(x = Mean_T1T2, y = Z_Slope, color = Slope)) + geom_point(size = 3) + scale_color_gradient2(low = "blue", mid = "turquoise", high = "red", midpoint = 0 ) + theme_classic() + geom_smooth(aes(x = Mean_T1T2, y = Z_Slope), method = "lm", color = "darkgray", se = TRUE) + labs(x = "T1w/T2w (young adult ratios)", y = "Aging Effect [z-score slopes]", color = "Aging Slope") + theme(plot.margin = margin(t = 10, r = 5, b = 10, l = 5)) + annotate("segment", x = 1.45, xend = 1.45, y = -1.3, yend = -2.5, arrow = arrow(length = unit(0.25, "cm"), type = "closed"), color = "black") + annotate("text", x = 1.45, y = 0.25, label = "Tissue Loss", angle = 90, vjust = 0.5, hjust = 1, color = "black" ) + annotate("text",x = 1.74, y =-4.5, label = "Association", angle = 0, vjust = 0.5, hjust = 1, color = "black") + annotate("text", x = 2.3, y =-4.5, label = "Sensory", angle = 0, vjust = 0.5, hjust = 1, color = "black") + annotate("segment", x = 1.75, xend = 2.1, y = -4.5, yend = -4.5, arrow = arrow( length = unit(0.25, "cm"),type = "closed", ends="both"), color = "black") + theme(axis.text.x=element_text(color="black", face="plain", size=10), axis.text.y=element_text(color="black", face="plain", size=10)) + theme(axis.title.y=element_text(color="black", face="bold")) + theme(legend.key.size=unit(0.4,"cm"), legend.text=element_text(size=7), legend.title=element_text(size=9), legend.position = c(0.02, 1.02), legend.justification=c(0,1))
- ####
- predicted_values <- ggpredict(modela, terms = "CortexVol")
- plot(predicted_values) + geom_point(data = mydata, aes(x = CortexVol, y = moca01_moca_total), color = "grey33", alpha = 0.2, size = 6, stroke=1) + labs(title = "", x = "Neocortical Volume [mm³]", y = "Total MoCA Score") + geom_smooth(method = "lm", formula = y ~ x, color = "black", fullrange=F) + theme_classic() + theme(axis.ticks.x = element_line(color = "black", size = 0.5), axis.ticks.y = element_line(color = "black", size = 0.5), axis.line.x = element_line(color = "black", size = 0.5), axis.line.y = element_line(color = "black", size = 0.5), axis.text.x = element_text(color = "black", face = "plain", size = 25), axis.text.y = element_text(color = "black", face = "plain", size = 25), axis.title.y = element_text(color = "black", face = "plain", size = 30, hjust = 0.5, vjust = 2), axis.title.x = element_text(color = "black", face = "plain", size = 30, vjust = -0.1), plot.margin = margin(0.5, 0.5, 0.5, 0.5, "cm"), panel.border = element_blank()) + scale_y_continuous(breaks = c(21, 30)) + scale_x_continuous(breaks = c(310000, 610000))
- ####
- predicted_values <- ggpredict(modela, terms = "eTIV")
- plot(predicted_values) + geom_point(data = mydata, aes(x = eTIV, y = moca01_moca_total), color = "goldenrod", alpha = 0.2, size = 6, stroke=1) + geom_smooth(method = "lm", formula = y ~ x, color = "black", fullrange=F) + labs(title = "", x = "eTIV [mm³]", y = "Total MoCA Score") + theme_classic() + theme(axis.ticks.x = element_line(color = "black", size = 0.5), axis.ticks.y = element_line(color = "black", size = 0.5), axis.line.x = element_line(color = "black", size = 0.5), axis.line.y = element_line(color = "black", size = 0.5),axis.text.x = element_text(color = "black", face = "plain", size = 25), axis.text.y = element_text(color = "black", face = "plain", size = 25),axis.title.y = element_text(color = "black", face = "plain", size = 30, hjust = 0.5, vjust = 2), axis.title.x = element_text(color = "black", face = "plain", size = 30, vjust = -0.1), plot.margin = margin(0.5, 0.5, 0.5, 0.5, "cm"), panel.border = element_blank()) + scale_y_continuous(breaks = c(21, 30)) + scale_x_continuous(breaks = c(1000, 1800))
- ####
- predicted_values <- ggpredict(modela, terms = "Total_Cerebel_Vol")
- plot(predicted_values) + geom_point(data = mydata, aes(x = Total_Cerebel_Vol, y = moca01_moca_total), color = "#428CD4", alpha = 0.2, size = 6, stroke=1) + geom_smooth(method = "lm", formula = y ~ x, color = "black", fullrange=F) + labs(title = "", x = "Total Cerebellar Volume [mm³]", y = "Total MoCA Score") + theme_classic() + theme(axis.ticks.x = element_line(color = "black", size = 0.5), axis.ticks.y = element_line(color = "black", size = 0.5), axis.line.x = element_line(color = "black", size = 0.5), axis.line.y = element_line(color = "black", size = 0.5),axis.text.x = element_text(color = "black", face = "plain", size = 25), axis.text.y = element_text(color = "black", face = "plain", size = 25),axis.title.y = element_text(color = "black", face = "plain", size = 30, hjust = 0.5, vjust = 2), axis.title.x = element_text(color = "black", face = "plain", size = 30, vjust = -0.1), plot.margin = margin(0.5, 0.5, 0.5, 0.5, "cm"), panel.border = element_blank() ) + scale_y_continuous(breaks = c(21, 30)) + scale_x_continuous(breaks = c(90000, 167000), labels=c("90000","172000"))
- ##############
- #### Figure 2
- library(ggplot2)
- library(gridExtra)
- library(patchwork)
- models <- list()
- custom_palette <- c("#80D0C7", "#8CC7B3", "#99BF9F", "#A6B78B", "#B2AF77", "#BFA763", "#CC9F4F", "#D8973B", "#E58F27", "#F28713", "#FF7F00")
- library(cowplot)
- plot_bilateral_average <- function(data, lobule_name, color) {
- data$bilateral_average <- rowMeans(data[, c(paste0("Left.", lobule_name), paste0("Right.", lobule_name))], na.rm = TRUE)
- plot <- ggplot(data = data, aes(x = moca01_moca_total, y = bilateral_average)) + geom_point(color = color, alpha=0.2, size=4) + geom_smooth(method = "lm", se = TRUE, color = color, fill=alpha(color,0.3)) + labs(title = paste("", lobule_name), x = "", y = "Bilateral Average Volume") + theme_classic() + theme(axis.ticks.x = element_blank(), axis.ticks.y = element_blank(), axis.line.x = element_line(color = "black", size = 2), axis.line.y = element_blank(), axis.text.x = element_text(color = "black", face = "plain", size = 35, hjust=0.7, vjust=-0.2), axis.text.y = element_blank(), axis.title.y = element_text(color = "black", face = "plain", size = 35, margin = margin(t = 12, b = 12)), axis.title.x = element_text()) + labs(title = "", x = "\n\n\n\n", y = "") + theme(text = element_text(size = 30)) + scale_x_continuous(breaks = c(18, 33), labels=c("18", "33"), limits = c(18, 33)) + scale_y_continuous(breaks = c(0, 20000), limits = c(0, 22000))
- return(plot)
- }
- scatterplots <- lapply(1:length(lobules), function(i) {
- plot_bilateral_average(mydata, lobules[i], custom_palette[i])
- })
- master_plot <- grid.arrange(grobs = scatterplots, nrow = 1)
- master_plot <- ggdraw(master_plot) + draw_label("\n I-III IV V VI Crus I Crus II VIIb VIIIa VIIIb IX X ", fontface = 'bold', size = 36, x = 0.5, y = 0.200)
- master_plot <- ggdraw(master_plot) + draw_label("MoCA Total Score", fontface = 'plain', size = 36, x = 0.5, y = 0.120)
- master_plot <- master_plot + geom_segment(aes(x = 0.0055, xend = 0.0055, y = 0.248, yend = 0.87), linetype = "solid", color = "black", size = 2) + annotate("text", x = 0.0087, y = 0.282, label = "0", vjust = 1, hjust = 0.001, size = 13) + annotate("text", x = 0.0087, y = 0.83, label = "20000", vjust = 0, hjust = 0.001, size = 13) + annotate("text", x = -0.008, y = 0.57, label = "Volume [mm³]", angle = 90, vjust = 0.2, hjust = 0.5, size = 15, fontface = 'bold') + theme(plot.margin = margin(0, 2, 0, 2, "cm"), panel.border = element_blank())
- print(master_plot)
- ####
- predicted_values <- ggpredict(modela, terms = "interview_age_years")
- plot(predicted_values) + geom_point(data = mydata, aes(x = interview_age_years, y = moca01_moca_total), color = "gray33", alpha = 0.2, size = 6, stroke=1) + labs(title = "", x = "Age [years]\n", y = "\nTotal MoCA Score") + geom_smooth(method = "lm", formula = y ~ x, color = "black", fullrange=T) + theme_classic() + theme(axis.ticks.x = element_line(color = "black", size = 0.5), axis.ticks.y = element_line(color = "black", size = 0.5), axis.line.x = element_line(color = "black", size = 0.5), axis.line.y = element_line(color = "black", size = 0.5), axis.text.x = element_text(color = "black", face = "plain", size = 25), axis.text.y = element_text(color = "black", face = "plain", size = 25), axis.title.y = element_text(color = "black", face = "plain", size = 30, hjust = 0.5, vjust = 2), axis.title.x = element_text(color = "black", face = "plain", size = 30, vjust = -0.1)) + scale_x_continuous(breaks = c(36, 100), labels=c("36", "100"), limits = c(36, 100)) + scale_y_continuous(breaks = c(21, 30), labels=c("21", "30")) + theme(plot.margin = margin(0.5,0.5,0.5,0.5, "cm"), panel.border = element_blank())
- ####
- plot_model(modela, type="pred", terms=c("interview_age_years", "MOCA_FX"), partial.residuals=TRUE, colors=c("red2", "green4", "purple"), show.legend=T, show.data=F, jitter=0.5, dot.size=7, sort.est=TRUE, show.values=T, int.width=0.95, legend.title="Aging\nMoCA\nCerebellar\nVolume") + theme_classic() + theme(axis.ticks.x=element_line(color="black", size=0.5),axis.ticks.y=element_line(color="black", size=0.5), axis.line.x=element_line(color="black", size=0.5), axis.line.y=element_line(color="black", size=0.5), axis.text.x=element_text(color="black", face="plain", size=25), axis.text.y=element_text(color="black", face="plain", size=25), axis.title.y=element_text(color="black", face="plain", size=30, vjust=1.75), axis.title.x=element_text(color="black", face="plain", size=30, vjust=0.99), legend.title=element_text(color="black", face="plain", size=25), legend.position="right", legend.text=element_text(size=25), legend.key=element_rect(colour="white"), legend.key.size=unit(0.5, "cm"), legend.spacing.y=unit(0.2,'cm')) + labs(title="", x="Age [years]\n",y="\nTotal MoCA Score") + theme(text=element_text(size=22)) + scale_x_continuous(breaks = c(36, 100), labels=c("36", "100"), limits = c(36, 100)) + theme(plot.margin = margin(0.5,0.5,0.5,0.5, "cm"), panel.border = element_blank()) + scale_color_discrete(labels=c("-1 SD","mean","+1 SD")) + scale_y_continuous(breaks = c(23, 29), labels=c("23", "29"), limits = c(23, 29))
- ####
- jn <- johnson_neyman(modela, pred= MOCA_FX, modx= interview_age_years, mod.range=c(36,100), control.fdr=TRUE, title="Johnson-Neyman Plot", line.thickness=1)
- png(filename="JohnsonNeyman - MOCA Total Scores ~ Age x CerebMOCA.png", width=22, height=15, units="cm", bg="white", res=280)
- jn$plot + theme_classic() + theme(axis.line.x=element_line(color="black", size=.5), axis.line.y=element_line(color="black", size=.5), legend.title=element_blank(), legend.position=c(0.10, 0.90), legend.key.size=unit(0.5, "cm"), legend.text=element_text(size=20.5), axis.ticks=element_blank(), axis.text.x=element_text(color="black", face="plain", size=25), axis.text.y=element_text(color="black", face="plain", size=25), axis.title.y=element_text(color="black", face="plain", size=30,vjust=-0.9), axis.title.x=element_text(color="black", face="plain", size=30)) + labs(title="", x="Age [years]\n", y="MoCA Total Scores\nSlope") + geom_text(aes(x=51, y=0.25, label="48", fontface="italic"), color="black", size=8, vjust=-0.5, hjust=0.5) + scale_y_continuous(breaks = c(-5, 30), labels=c("0", "30"), limits=c(-5,30)) + scale_x_continuous(breaks = c(36, 100), labels=c("36", "100"), limits=c(36, 100)) + theme(plot.margin = margin(1,0.5,0.5,0.5, "cm"), panel.border = element_blank())
- ####
- predicted_values <- ggpredict(modela, terms = "Visuospatial_FX")
- plot(predicted_values) + geom_point(data = mydata, aes(x = Visuospatial_FX, y = moca01_visuospatial_executive), color = "gray33", alpha = 0.2, size = 6, stroke=1) + labs(title = "", x = "Aging x Visuospatial MoCa Score\nCerebellar Tissue Volume [mm³]", y = "Visuospatial\nMoCA Score") + geom_smooth(method = "lm", formula = y ~ x, color = "black", fullrange=T) + theme_classic() + theme(axis.ticks.x = element_line(color = "black", size = 0.5), axis.ticks.y = element_line(color = "black", size = 0.5), axis.line.x = element_line(color = "black", size = 0.5), axis.line.y = element_line(color = "black", size = 0.5), axis.text.x = element_text(color = "black", face = "plain", size = 25), axis.text.y = element_text(color = "black", face = "plain", size = 25), axis.title.y = element_text(color = "black", face = "plain", size = 30, hjust = 0.5, vjust = 2), axis.title.x = element_text(color = "black", face = "plain", size = 30, vjust = -0.1)) + scale_x_continuous(breaks = c(0.3, 0.7), labels=c("0.3", "0.7")) + scale_y_continuous(breaks = c(0, 5), labels=c("0", "5")) + theme(plot.margin = margin(0.5,0.5,0.5,0.5, "cm"), panel.border = element_blank())
- ####
- predicted_values <- ggpredict(modela, terms = "interview_age_years")
- plot(predicted_values) + geom_point(data = mydata, aes(x = interview_age_years, y = moca01_visuospatial_executive), color = "gray33", alpha = 0.2, size = 6, stroke=1) + labs(title = "", x = "Age [years]\n", y = "Visuospatial\nMoCA Score") + geom_smooth(method = "lm", formula = y ~ x, color = "black", fullrange=T) + theme_classic() + theme(axis.ticks.x = element_line(color = "black", size = 0.5), axis.ticks.y = element_line(color = "black", size = 0.5), axis.line.x = element_line(color = "black", size = 0.5), axis.line.y = element_line(color = "black", size = 0.5), axis.text.x = element_text(color = "black", face = "plain", size = 25), axis.text.y = element_text(color = "black", face = "plain", size = 25), axis.title.y = element_text(color = "black", face = "plain", size = 30, hjust = 0.5, vjust = 2), axis.title.x = element_text(color = "black", face = "plain", size = 30, vjust = -0.1)) + scale_x_continuous(breaks = c(36, 100), labels=c("36", "100"), limits = c(36, 100)) + scale_y_continuous(breaks = c(0, 5), labels=c("0", "5"), limits = c(0, 6)) + theme(plot.margin = margin(0.5,0.5,0.5,0.5, "cm"), panel.border = element_blank())
- ####
- plot_model(modela, type="pred", terms=c("interview_age_years", "Visuospatial_FX"), partial.residuals=TRUE, show.legend=T, show.data=F, jitter=0.5, dot.size=7, sort.est=TRUE, show.values=T, int.width=0.95, legend.title="Aging\nVisuospatial\nCerebellar\nSignature") + theme_classic() + theme(axis.ticks.x=element_line(color="black", size=0.5),axis.ticks.y=element_line(color="black", size=0.5), axis.line.x=element_line(color="black", size=0.5), axis.line.y=element_line(color="black", size=0.5), axis.text.x=element_text(color="black", face="plain", size=25), axis.text.y=element_text(color="black", face="plain", size=25), axis.title.y=element_text(color="black", face="plain", size=30, vjust=1.75), axis.title.x=element_text(color="black", face="plain", size=30, vjust=0.5), legend.title=element_text(color="black", face="plain", size=25), legend.position="right", legend.text=element_text(size=25), legend.key=element_rect(colour="white"), legend.key.size=unit(0.5, "cm"), legend.spacing.y=unit(0.2,'cm')) + labs(title="", x="Age [years]\n",y="\nVisuospatial Score") + theme(text=element_text(size=22)) + scale_x_continuous(breaks = c(36, 100), labels=c("36", "100"), limits = c(36, 100)) + scale_y_continuous(breaks = c(2.75, 5), labels=c("3", "5"), limits = c(2.75, 5)) + theme(plot.margin = margin(0.5,0.5,0.5,0.5, "cm"), panel.border = element_blank()) + scale_color_discrete(labels=c("-1 SD","mean","+1 SD"))
- ####
- jn <- johnson_neyman(modela, pred= Visuospatial_FX, modx= interview_age_years, mod.range=c(36, 100), control.fdr=TRUE, title="Johnson-Neyman Plot", line.thickness=1)
- jn$plot + theme_classic() + theme(axis.line.x=element_line(color="black", size=.5), axis.line.y=element_line(color="black", size=.5), legend.title=element_blank(), legend.position=c(0.10, 0.90), legend.key.size=unit(0.5, "cm"), legend.text=element_text(size=20.5), axis.ticks=element_blank(), axis.text.x=element_text(color="black", face="plain", size=25), axis.text.y=element_text(color="black", face="plain", size=25), axis.title.y=element_text(color="black", face="plain", size=30,vjust=0.5), axis.title.x=element_text(color="black", face="plain", size=30)) + labs(title="", x="Age [years]\n", y="Visuospatial Scores\nSlope") + geom_text(aes(x=47, y=0.25, label="44", fontface="italic"), color="black", size=8, vjust=-0.5, hjust=0.5) + scale_y_continuous(breaks = c(-2, 16), labels=c("0", "5"), limits=c(-2,16 )) + scale_x_continuous(breaks = c(36, 100), labels=c("36", "100"), limits=c(36, 100)) + theme(plot.margin = margin(1,0.5,0.5,0.5, "cm"), panel.border = element_blank())
- ####
- library(ggseg)
- library(ggseg3d)
- Data = data.frame(
- region = c("precuneus","postcingulate"),
- p = sample(seq(0,.5,.05,.0001), 3),
- stringsAsFactors = FALSE)
- ggseg(.data= Data, atlas=dk, colour="gray33", mapping=aes(fill=p))
- ####
- predicted_values <- ggpredict(modela, terms = "MOCA_FX")
- plot(predicted_values) + geom_point(data = mydata, aes(x = MOCA_FX, y = bh_precuneus_PCC_volume), color = "gray33", alpha = 0.2, size = 6, stroke=1) + labs(title = "", x = "Aging-MoCA\nCerebellar Tissue Volume [mm³]", y = "Precuneus-Postcingulate\nTissue Volume [mm³]") + geom_smooth(method = "lm", formula = y ~ x, color = "black", fullrange=T) + theme_classic() + theme(axis.ticks.x = element_line(color = "black", size = 0.5), axis.ticks.y = element_line(color = "black", size = 0.5), axis.line.x = element_line(color = "black", size = 0.5), axis.line.y = element_line(color = "black", size = 0.5), axis.text.x = element_text(color = "black", face = "plain", size = 25), axis.text.y = element_text(color = "black", face = "plain", size = 25), axis.title.y = element_text(color = "black", face = "plain", size = 30, hjust = 0.5, vjust = 2), axis.title.x = element_text(color = "black", face = "plain", size = 30, vjust = -0.1)) + scale_x_continuous(breaks = c(0.2, 0.8), labels=c("0.2", "0.8"), limits = c(0.2, 0.8)) + scale_y_continuous(breaks = c(3500, 10000), labels=c("3500", "10000"), limits = c(3500, 10000)) + theme(plot.margin = margin(0.5,0.5,0.5,0.5, "cm"), panel.border = element_blank())
- ####
- predicted_values <- ggpredict(modela, terms = "interview_age_years")
- plot(predicted_values) + geom_point(data = mydata, aes(x = interview_age_years, y = bh_precuneus_PCC_volume), color = "dodgerblue3", alpha = 0.2, size = 6, stroke=1) + labs(title = "", x = "Age [years]\n", y = "Precuneus-Postcingulate\nTissue Volume [mm³]") + geom_smooth(method = "lm", formula = y ~ x, color = "black", fullrange=T) + theme_classic() + theme(axis.ticks.x = element_line(color = "black", size = 0.5), axis.ticks.y = element_line(color = "black", size = 0.5), axis.line.x = element_line(color = "black", size = 0.5), axis.line.y = element_line(color = "black", size = 0.5), axis.text.x = element_text(color = "black", face = "plain", size = 25), axis.text.y = element_text(color = "black", face = "plain", size = 25), axis.title.y = element_text(color = "black", face = "plain", size = 30, hjust = 0.5, vjust = 2), axis.title.x = element_text(color = "black", face = "plain", size = 30, vjust = -0.1)) + scale_x_continuous(breaks = c(36, 100), labels=c("36", "100"), limits = c(36, 100)) + theme(plot.margin = margin(0.5,0.5,0.5,0.5, "cm"), panel.border = element_blank()) + scale_y_continuous(breaks = c(16000, 40000), labels=c("16000", "40000"), limits = c(16000, 40000))
- ####
- predicted_values <- ggpredict(modela, terms = "bh_precuneus_PCC_volume")
- plot(predicted_values) + geom_point(data = mydata, aes(x = bh_precuneus_PCC_volume, y = moca01_moca_total), color = "dodgerblue3", alpha = 0.2, size = 6, stroke=1) + labs(title = "", x = "Precuneus-Postcingulate\nTissue Volume [mm³]", y = "Total MoCA Score") + geom_smooth(method = "lm", formula = y ~ x, color = "black", fullrange=F) + theme_classic() + theme(axis.ticks.x = element_line(color = "black", size = 0.5), axis.ticks.y = element_line(color = "black", size = 0.5), axis.line.x = element_line(color = "black", size = 0.5), axis.line.y = element_line(color = "black", size = 0.5), axis.text.x = element_text(color = "black", face = "plain", size = 25), axis.text.y = element_text(color = "black", face = "plain", size = 25), axis.title.y = element_text(color = "black", face = "plain", size = 30, hjust = 0.5, vjust = 2), axis.title.x = element_text(color = "black", face = "plain", size = 30, vjust = -0.1)) + scale_y_continuous(breaks = c(19, 30), labels=c("19", "30"), limits = c(19, 31)) + theme(plot.margin = margin(0.5,0.5,0.5,0.5, "cm"), panel.border = element_blank()) + scale_x_continuous(breaks = c(3500, 10000), labels=c("3500", "10000"), limits = c(3500, 10000))
- ####
- plot_model(modela, type="pred", terms=c("interview_age_years", "bh_precuneus_PCC_volume"), partial.residuals=TRUE, colors=c("red2", "green4", "purple"), show.legend=T, show.data=F, jitter=0.5, dot.size=7, sort.est=TRUE, show.values=T, int.width=0.95, legend.title="Precuneus\nPostcingulate\nVolume") + theme_classic() + theme(axis.ticks.x=element_line(color="black", size=0.5),axis.ticks.y=element_line(color="black", size=0.5), axis.line.x=element_line(color="black", size=0.5), axis.line.y=element_line(color="black", size=0.5), axis.text.x=element_text(color="black", face="plain", size=25), axis.text.y=element_text(color="black", face="plain", size=25), axis.title.y=element_text(color="black", face="plain", size=30, vjust=1.75), axis.title.x=element_text(color="black", face="plain", size=30, vjust=0.99), legend.title=element_text(color="black", face="plain", size=25), legend.position="right", legend.text=element_text(size=25), legend.key=element_rect(colour="white"), legend.key.size=unit(0.5, "cm"), legend.spacing.y=unit(0.2,'cm')) + labs(title="", x="Age [years]\n",y="\nTotal MoCA Score") + theme(text=element_text(size=22)) + scale_x_continuous(breaks = c(36, 100), labels=c("36", "100"), limits = c(36, 100)) + scale_y_continuous(breaks = c(23, 30), labels=c("23", "30"), limits = c(23, 30)) + theme(plot.margin = margin(0.5,0.5,0.5,0.5, "cm"), panel.border = element_blank()) + scale_color_discrete(labels=c("-1 SD","mean","+1 SD"))
- ####
- plot_model(modela, type="pred", terms=c("interview_age_years", "MOCA_FX"), partial.residuals=TRUE, colors=c("red2", "green4", "purple"), show.legend=T, show.data=F, jitter=0.5, dot.size=7, sort.est=TRUE, show.values=T, int.width=0.95, legend.title="Aging\nMoCA\nCerebellar\nVolume") + theme_classic() + theme(axis.ticks.x=element_line(color="black", size=0.5),axis.ticks.y=element_line(color="black", size=0.5), axis.line.x=element_line(color="black", size=0.5), axis.line.y=element_line(color="black", size=0.5), axis.text.x=element_text(color="black", face="plain", size=25), axis.text.y=element_text(color="black", face="plain", size=25), axis.title.y=element_text(color="black", face="plain", size=30, vjust=1.75), axis.title.x=element_text(color="black", face="plain", size=30, vjust=0.99), legend.title=element_text(color="black", face="plain", size=25), legend.position="right", legend.text=element_text(size=25), legend.key=element_rect(colour="white"), legend.key.size=unit(0.5, "cm"), legend.spacing.y=unit(0.2,'cm')) + labs(title="", x="Age [years]\n",y="\nTotal MoCA Score") + theme(text=element_text(size=22)) + scale_x_continuous(breaks = c(36, 100), labels=c("36", "100"), limits = c(36, 100)) + scale_y_continuous(breaks = c(23, 30), labels=c("23", "30"), limits = c(23, 30)) + theme(plot.margin = margin(0.5,0.5,0.5,0.5, "cm"), panel.border = element_blank()) + scale_color_discrete(labels=c("-1 SD","mean","+1 SD"))
- ##############
- #### Figure 3
- models <- list()
- fit_model_and_extract_age_coef <- function(data, lobule_name) {
- bilateral_avg <- rowMeans(data[, c(paste0("lh_", lobule_name), paste0("rh_", lobule_name))], na.rm = TRUE)
- model <- lm(bilateral_avg ~ data$Sex + data$SES_eduLvl_releveled + data$Vol + data$Age.at.scan)
- age_coef <- coef(model)["data$Age.at.scan"]
- return(age_coef)
- }
- custom_palette <- c("#B2AF77", "#BFA763","#F28713")
- library(cowplot)
- library(gridExtra)
- plot_bilateral_average <- function(data, lobule_name, color) {
- data$bilateral_average <- rowMeans(data[, c(paste0("lh_", lobule_name), paste0("rh_", lobule_name))], na.rm = TRUE)
- plot <- ggplot(data = data, aes(x = Age.at.scan, y = bilateral_average)) + geom_point(color = color, alpha=0.3, size=6) + geom_smooth(method = "lm", se = TRUE, color = color, fill=alpha(color,0.3), size=4) + labs(title = paste("", lobule_name), x = "\n\n\n", y = "Bilateral Average Volume") + theme_classic() + theme(axis.ticks.x = element_blank(), axis.ticks.y = element_blank(), axis.line.x = element_line(color = "black", size = 3), axis.line.y = element_blank(), axis.text.x = element_text(color = "black", face = "plain", size = 44, hjust=0.7, vjust=-0.2), axis.text.y = element_blank(), axis.title.y = element_text(), axis.title.x = element_text()) + labs(title = "", x = "\n\n\n", y = "") + theme(text = element_text(size = 30)) + scale_x_continuous(breaks = c(44, 81), labels=c("44", "81"), limits = c(44, 81)) + scale_y_continuous(breaks = c(0, 25000), limits = c(0, 25000))
- return(plot)
- }
- scatterplots <- lapply(1:length(lobules), function(i) {
- plot_bilateral_average(myUKdata, lobules[i], custom_palette[i])
- })
- master_plot <- grid.arrange(grobs = scatterplots, nrow = 1)
- master_plot <- ggdraw(master_plot) + draw_label("\n Crus I Crus II IX ", fontface = 'bold', size = 55, x = 0.5, y = 0.185)
- master_plot <- ggdraw(master_plot) + draw_label("Age [years]", fontface = 'plain', size = 55, x = 0.5, y = 0.059)
- master_plot <- master_plot + geom_segment(aes(x = 0.0055, xend = 0.0055, y = 0.225, yend = 0.90), linetype = "solid", color = "black", size = 2) + annotate("text", x = 0.0088, y = 0.270, label = "0", vjust = 1, hjust = -0.4, size = 15) + annotate("text", x = 0.0088, y = 0.86, label = "25000", vjust = 0, hjust = -0.1, size = 15) + annotate("text", x = -0.008, y = 0.56, label = "Volume [mm³]", angle = 90, vjust = -0.2, hjust = 0.5, size = 20, fontface = 'bold') + theme(plot.margin = margin(0,2.1,0,3, "cm"), panel.border = element_blank())
- print(master_plot)
- ####
- library(ggpointdensity)
- library(dplyr)
- library(viridis)
- library(ggplot2)
- ggplot(myUKdata, aes(x = Age.at.scan, y = correct_numberofDSSTmatches)) + geom_jitter(size=1, width = 0, height = 0, color = "black", alpha = 0.01) + geom_pointdensity(size=4, alpha=0.2) + geom_smooth(method = "lm", se = T, color = "darkgray", fill = "lightgray", size=2) + theme_classic() + scale_color_viridis() + theme(axis.ticks.x=element_line(color="black", size=0.5), axis.ticks.y=element_line(color="black", size=0.5), axis.line.x=element_line(color="black", size=0.5), axis.line.y=element_line(color="black", size=0.5), axis.text.x=element_text(color="black", face="plain", size=17), axis.text.y=element_text(color="black", face="plain", size=17), axis.title.y=element_text(color="black", face="plain", size=23, hjust=0.5,vjust=3), axis.title.x=element_text(color="black", face="plain", size=23, vjust=-0.1), legend.title=element_text(color="black", face="plain", size=17), legend.position="right", legend.text=element_text(size=14, hjust=1), legend.key=element_rect(colour="white"), legend.key.size=unit(0.6, "cm"), legend.spacing.y=unit(0.3,'cm')) + labs(title="", x="Age [years]",y="DSST [score]", color="") + theme(text=element_text(size=22)) + ylim(0,40) + theme(plot.margin = margin(0,0.5,0.5,0.5, "cm"), panel.border = element_blank())
- ####
- ggplot(myUKdata, aes(x = Age.at.scan, y = durationtocomplete_Trails2)) + geom_jitter(size=1, width = 0, height = 0, color = "black", alpha = 0.01) + geom_pointdensity(size=4, alpha=0.2) + geom_smooth(method = "lm", se = T, color = "darkgray", fill = "lightgray", size=2) + theme_classic() + scale_color_viridis() + theme(axis.ticks.x=element_line(color="black", size=0.5), axis.ticks.y=element_line(color="black", size=0.5), axis.line.x=element_line(color="black", size=0.5), axis.line.y=element_line(color="black", size=0.5), axis.text.x=element_text(color="black", face="plain", size=17), axis.text.y=element_text(color="black", face="plain", size=17), axis.title.y=element_text(color="black", face="plain", size=23, hjust=0.5,vjust=3), axis.title.x=element_text(color="black", face="plain", size=23, vjust=-0.1), legend.title=element_text(color="black", face="plain", size=17), legend.position="right", legend.text=element_text(size=14, hjust=1), legend.key=element_rect(colour="white"), legend.key.size=unit(0.6, "cm"), legend.spacing.y=unit(0.3,'cm')) + labs(title="", x="Age [years]",y="TMB [seconds]", color="") + theme(text=element_text(size=22)) + theme(plot.margin = margin(0,0.5,0.5,0.5, "cm"), panel.border = element_blank())
- ####
- plot_model(modela, type="int", terms=c("Age.at.scan", "bh_Cerebellum2Lobules_FAST_vol_category"), partial.residuals=TRUE, colors=c("purple","darkorange2"), show.legend=F, show.data=F, jitter=0.5, dot.size=7, sort.est=TRUE, show.values=T, int.width=0.95, legend.title="Cerebellar\nVolume\nGroup") + theme_classic() + theme(axis.ticks.x=element_line(color="black", size=0.5),axis.ticks.y=element_line(color="black", size=0.5), axis.line.x=element_line(color="black", size=0.5), axis.line.y=element_line(color="black", size=0.5), axis.text.x=element_text(color="black", face="plain", size=17), axis.text.y=element_text(color="black", face="plain", size=17), axis.title.y=element_text(color="black", face="plain", size=23, hjust=0.5,vjust=2), axis.title.x=element_text(color="black", face="plain", size=23, vjust=-0.1), legend.title=element_text(color="black", face="plain", size=17), legend.position=c(0.9,0.8), legend.text=element_text(size=14, hjust=1), legend.key=element_rect(colour="white"), legend.key.size=unit(0.6, "cm"), legend.spacing.y=unit(0.3,'cm')) + labs(title="", x="Age [years]",y="DSST [score]") + theme(text=element_text(size=22)) + theme(plot.margin = margin(0.5,0.5,0.5,0.5, "cm"), panel.border = element_blank())
- ####
- p <- plot_model(modela, type="int", terms=c("Age.at.scan", "bh_Cerebellum2Lobules_FAST_vol_category"), partial.residuals=TRUE, colors=c("purple", "darkorange2"), show.legend=FALSE, show.data=F, jitter=0.5, dot.size=1, sort.est=TRUE, show.values=TRUE, legend.title="") + theme_classic() + theme(axis.ticks.x=element_line(color="black", size=0.5),axis.ticks.y=element_line(color="black", size=0.5), axis.line.x=element_line(color="black", size=0.5), axis.line.y=element_line(color="black", size=0.5), axis.text.x=element_text(color="black", face="plain", size=17), axis.text.y=element_text(color="black", face="plain", size=17), axis.title.y=element_text(color="black", face="plain", size=23, hjust=0.5,vjust=2), axis.title.x=element_text(color="black", face="plain", size=23, vjust=-0.3), legend.title=element_text(color="black", face="plain", size=17), legend.position=c(0.13, 0.80), legend.text=element_text(size=17, hjust=0), legend.spacing.y=unit(0.2,'cm'), legend.spacing.x=unit(0.3,'cm'),legend.key.width=unit(0.65,'cm'),legend.key.height=unit(0.65,'cm'), legend.box.margin=margin(0.5, 0.5, 0.5, 0.5, "cm")) + labs(title="", x="Age [years]", y="TMB [seconds]") + theme(text=element_text(size=22, face="plain")) + theme(plot.margin=margin(0.5, 0.5, 0.5, 0.5, "cm"), panel.border=element_blank())+ guides(fill=guide_legend(byrow=TRUE, override.aes=list(alpha=0.6)))
- draw_plot <- ggdraw(p) + draw_text("Cerebellar Volume", x = 0.17, y = 0.83, size = 20, color = "black", hjust = 0)
- print(draw_plot)
- ##############
- #### Figure 4
- plot_model(modela, type="pred", terms=c("Age", "Total_Cerebel_Vol"), partial.residuals=TRUE, colors=c("red2", "green4", "purple"), show.legend=T, show.data=F, jitter=0.5, dot.size=7, sort.est=TRUE, show.values=T, int.width=0.95, legend.title="Aβ-\nTotal\nCerebellar\nVolume") + theme_classic() + theme(axis.ticks.x=element_line(color="black", size=0.5),axis.ticks.y=element_line(color="black", size=0.5), axis.line.x=element_line(color="black", size=0.5), axis.line.y=element_line(color="black", size=0.5), axis.text.x=element_text(color="black", face="plain", size=25), axis.text.y=element_text(color="black", face="plain", size=25), axis.title.y=element_text(color="black", face="plain", size=30, vjust=1.75), axis.title.x=element_text(color="black", face="plain", size=30, vjust=0.99), legend.title=element_text(color="black", face="plain", size=25), legend.position="right", legend.text=element_text(size=25), legend.key=element_rect(colour="white"), legend.key.size=unit(0.5, "cm"), legend.spacing.y=unit(0.2,'cm')) + labs(title="", x="Age [years]\n",y="\nMoCA Score") + theme(text=element_text(size=22)) + scale_x_continuous(breaks = c(55, 100), labels=c("56", "100"), limits = c(55, 100)) + scale_y_continuous(breaks = c(18, 26), labels=c("20", "30"), limits = c(18, 26)) + theme(plot.margin = margin(0.5,0.5,0.5,0.5, "cm"), panel.border = element_blank()) + scale_color_discrete(labels=c("-1 SD","mean","+1 SD"))
- ####
- plot_model(modela, type="pred", terms=c("Age", "Total_Cerebel_Vol"), partial.residuals=TRUE, colors=c("red2", "green4", "purple"), show.legend=T, show.data=F, jitter=0.5, dot.size=7, sort.est=TRUE, show.values=T, int.width=0.95, legend.title="Aβ+\nTotal\nCerebellar\nVolume") + theme_classic() + theme(axis.ticks.x=element_line(color="black", size=0.5),axis.ticks.y=element_line(color="black", size=0.5), axis.line.x=element_line(color="black", size=0.5), axis.line.y=element_line(color="black", size=0.5), axis.text.x=element_text(color="black", face="plain", size=25), axis.text.y=element_text(color="black", face="plain", size=25), axis.title.y=element_text(color="black", face="plain", size=30, vjust=1.75), axis.title.x=element_text(color="black", face="plain", size=30, vjust=0.99), legend.title=element_text(color="black", face="plain", size=25), legend.position="right", legend.text=element_text(size=25), legend.key=element_rect(colour="white"), legend.key.size=unit(0.5, "cm"), legend.spacing.y=unit(0.2,'cm')) + labs(title="", x="Age [years]\n",y="\nMoCA Score") + theme(text=element_text(size=22)) + scale_x_continuous(breaks = c(55, 100), labels=c("56", "100"), limits = c(55, 100)) + scale_y_continuous(breaks = c(18, 26), labels=c("20", "30"), limits = c(18, 26)) + theme(plot.margin = margin(0.5,0.5,0.5,0.5, "cm"), panel.border = element_blank()) + scale_color_discrete(labels=c("-1 SD","mean","+1 SD"))
- ####
- plot_model(modela, type="pred", terms=c("Total_Cerebel_Vol", "DxABstatus_new"), partial.residuals=TRUE, colors=c("firebrick2","deepskyblue4","forestgreen","darkorchid","darkorange","blue2"), show.legend=F, show.data=F, jitter=0.5, dot.size=7, sort.est=TRUE, show.values=T, int.width=0.95, legend.title="") + theme_classic() + theme(axis.ticks.x=element_line(color="black", size=0.5),axis.ticks.y=element_line(color="black", size=0.5), axis.line.x=element_line(color="black", size=0.5), axis.line.y=element_line(color="black", size=0.5), axis.text.x=element_text(color="black", face="plain", size=28), axis.text.y=element_text(color="black", face="plain", size=28), axis.title.y=element_text(color="black", face="plain", size=33, vjust=-1.5), axis.title.x=element_text(color="black", face="plain", size=33, vjust=-0.1), legend.title=element_text(color="black", face="plain", size=28), legend.position="right", legend.text=element_text(size=23, margin=margin(t=7), vjust=1.2, hjust=0), legend.spacing.y = unit(0.1, 'cm'), legend.key=element_rect(colour="white"), legend.key.size=unit(0.8, "cm"), legend.key.width=unit(1,'cm')) + labs(title="", x="Cerebellar Volume [mm³]\n",y="\nMoCA Score") + theme(text=element_text(size=22)) + scale_x_continuous(breaks = c(100000, 176000), labels=c("100000", "176000"), limits = c(100000, 180000)) + scale_y_continuous(breaks = c(10, 30), labels=c("10", "30"), limits = c(10, 30)) + theme(plot.margin = margin(0.5,0.5,0.5,0.5, "cm"), panel.border = element_blank()) + scale_color_manual(values = c("firebrick2","deepskyblue4","forestgreen","darkorchid","darkorange","blue2"), labels = c(" CN Aβ-"," CN Aβ+"," MCI Aβ-"," MCI Aβ+"," AD Aβ-"," AD Aβ+")) + scale_fill_manual(values = c("firebrick2","deepskyblue4","forestgreen","darkorchid","darkorange","blue2"), labels = c(" CN Aβ-"," CN Aβ+"," MCI Aβ-"," MCI Aβ+"," AD Aβ-"," AD Aβ+")) + guides(fill=guide_legend(byrow=TRUE, override.aes=list(alpha=0.4)))
- ####
- p <- plot_model(modela, type="pred", terms=c("Total_Cerebel_Vol", "APOE4"), partial.residuals=TRUE, show.legend=F, show.data=F, dot.size=7, sort.est=TRUE, show.values=T, int.width=0.95, legend.title="Aβ-\nAPOE") + theme_classic() + theme(axis.ticks.x=element_line(color="black", size=0.5),axis.ticks.y=element_line(color="black", size=0.5), axis.line.x=element_line(color="black", size=0.5), axis.line.y=element_line(color="black", size=0.5), axis.text.x=element_text(color="black", face="plain", size=20), axis.text.y=element_text(color="black", face="plain", size=20), axis.title.y=element_text(color="black", face="plain", size=25, hjust=0.45,vjust=.25), axis.title.x=element_text(color="black", face="plain", size=25, vjust=-0.1), legend.title=element_text(color="black", face="plain", size=20), legend.position=c("right"), legend.text=element_text(size=20, hjust=1, margin=margin(t=7), vjust=1.3), legend.key=element_rect(colour="white"), legend.key.size=unit(0.6, "cm"), legend.key.width=unit(0.8,'cm'), legend.spacing.y=unit(0.1,'cm')) + labs(title="", x="Cerebellar Volume [mm³]",y="MoCA Score") + theme(text=element_text(size=22)) + theme(plot.margin = margin(0.5,0.5,0.5,0.5, "cm"), panel.border = element_blank()) + scale_y_continuous(breaks = c(10,30), labels=c("10","30"), limits = c(10, 30.5)) + scale_y_continuous(breaks = c(10,30), labels=c("10","30"), limits = c(10, 30.5)) + scale_color_manual(values = c("firebrick2", "goldenrod", "darkblue"), labels = c(" 33"," 34"," 44")) + scale_fill_manual(values = c("firebrick2", "goldenrod", "darkblue"), labels = c(" 33"," 34"," 44")) + scale_x_continuous(breaks = c(100000,176000), labels=c("100000","176000"), limits = c(95000, 180000)) + guides(fill=guide_legend(byrow=TRUE, override.aes=list(alpha=0.4)))
- draw_plot <- ggdraw(p) + draw_text("Aβ-\nAPOE", x = 0.87, y = 0.68, size = 20, color = "black", hjust = 0, lineheight=0.95)
- print(draw_plot)
- ####
- p <- plot_model(modela, type="pred", terms=c("Total_Cerebel_Vol", "APOE4"), partial.residuals=TRUE, show.legend=F, show.data=F, dot.size=7, sort.est=TRUE, show.values=T, int.width=0.95, legend.title="Aβ+\nAPOE") + theme_classic() + theme(axis.ticks.x=element_line(color="black", size=0.5),axis.ticks.y=element_line(color="black", size=0.5), axis.line.x=element_line(color="black", size=0.5), axis.line.y=element_line(color="black", size=0.5), axis.text.x=element_text(color="black", face="plain", size=20), axis.text.y=element_text(color="black", face="plain", size=20), axis.title.y=element_text(color="black", face="plain", size=25, hjust=0.45,vjust=.25), axis.title.x=element_text(color="black", face="plain", size=25, vjust=-0.1), legend.title=element_text(color="black", face="plain", size=20), legend.position=c("right"), legend.text=element_text(size=20, hjust=1, margin=margin(t=7), vjust=1.3), legend.key=element_rect(colour="white"), legend.key.size=unit(0.6, "cm"), legend.key.width=unit(0.8,'cm'), legend.spacing.y=unit(0.1,'cm')) + labs(title="", x="Cerebellar Volume [mm³]",y="MoCA Score") + theme(text=element_text(size=22)) + theme(plot.margin = margin(0.5,0.5,0.5,0.5, "cm"), panel.border = element_blank()) + scale_y_continuous(breaks = c(10,30), labels=c("10","30"), limits = c(10, 30.5)) + scale_color_manual(values = c("firebrick2", "goldenrod", "darkblue"), labels = c(" 33"," 34"," 44")) + scale_fill_manual(values = c("firebrick2", "goldenrod", "darkblue"), labels = c(" 33"," 34"," 44")) + scale_x_continuous(breaks = c(100000,176000), labels=c("100000","176000"), limits = c(95000, 180000)) + guides(fill=guide_legend(byrow=TRUE, override.aes=list(alpha=0.4)))
- draw_plot <- ggdraw(p) + draw_text("Aβ+\nAPOE", x = 0.87, y = 0.68, size = 20, color = "black", hjust = 0, lineheight=0.95)
- print(draw_plot)
Figures.R at commit 346d622, no license · at the source
Overview
- Princeton Neuroscience Institute, Princeton University,Princeton, NJ USA
- Lifespan Brain Institute, Children’s Hospital of Philadelphia, University of Pennsylvania,Philadelphia, PA USA
- Department of Psychiatry, University of Pennsylvania,Philadelphia, PA USA
- Department of Child and Adolescent Psychiatry and Behavioral Science, The Children’s Hospital of Philadelphia,Philadelphia, PA USA
- Department of Medical Physiology and Biophysics, Institute of Biomedicine of Seville (IBiS) HUVR/CSIC/University of Seville/CIBERSAM, ISCIII,Seville, Spain
- Department of Psychology, University of Cambridge,Cambridge, UK
- Department of Psychiatry, University of Cambridge,Cambridge, UK
- Gordon Center for Medical Imaging, Massachusetts General Hospital, Harvard Medical School,Boston, MA USA
- Martinos Center for Biomedical Imaging, Massachusetts General Hospital, Harvard Medical School,Boston, MA USA
- Department of Radiology and Biomedical Imaging, Yale School of Medicine, Yale University,New Haven, CT USA
- Brigham and Women’s Hospital, Harvard Medical School,Boston, MA USA
Abstract
The cerebellum contains most of the brain’s neurons and supports many functions, yet how it changes with age remains unclear. Here we used three brain imaging studies spanning 47,000 adults and examined how different parts of the cerebellum age and their relation to cognition. We characterized cerebellar aging using volumetry and the T1-weighted/
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 4 matches between paragraphs and lines of code.
fdoleireuquillas/AgingCerebellum
346d62259d8980e433528d1d841e70a0f70440c5, 15 December 2025Availability: 1 check, the latest on 27 September 2026: the link answers
- 27 September 2026: the link answers
1 file
- Figures.R, R, 347 lines, 4 matches
Code availability
Source code related to the statistical analysis and visualization can be found 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;
- 1 script, each with its path and the digest of its content;
- 4 matches between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Data availability
Data analyzed are available at public repositories, which may require appropriate data sharing agreements from each individual publicly accessible database, including LONI for ADNI and HCP data (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 2, 28 September 2026
- Publisher: n/a → Nature Portfolio
Version 1, 27 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 13 authors, 2 keywords, 13 MeSH terms, 3 funders, 62 references, 1 integrity notice.
Cite
This paper
d’Oleire Uquillas, F., Sefik, E., Seidlitz, J., Daniel Hertz, E., Romero-Garcia, R., Warrier, V., Bethlehem, R. A. I., Alexander-Bloch, A. F., Cohen, J. D., Wang, S. S.-H., Sepulcre, J., Vannini, P., & Gomez, J. (2026). Cerebellar aging is spatially heterogeneous and supports cognitive resilience in later life. Nature neuroscience, 29(7), 1699-1710. https://
BibTeX
@article{doleireuquillas
author = {d’Oleire Uquillas, Federico and Sefik, Esra and Seidlitz, Jakob and Daniel Hertz, Edan and Romero-Garcia, Rafael and Warrier, Varun and Bethlehem, Richard A. I. and Alexander-Bloch, Aaron F. and Cohen, Jonathan D. and Wang, Samuel S.-H. and Sepulcre, Jorge and Vannini, Patrizia and Gomez, Jesse},
title = {{Cerebellar aging is spatially heterogeneous and supports cognitive resilience in later life}},
journal = {Nature neuroscience},
year = {2026},
month = jun,
volume = {29},
number = {7},
pages = {1699--1710},
publisher = {Nature Portfolio},
issn = {1097-6256},
doi = {10.1038/
url = {https://
pmid = {42271047},
pmcid = {PMC13337503}
}
RIS
TY - JOUR
AU - d’Oleire Uquillas, Federico
AU - Sefik, Esra
AU - Seidlitz, Jakob
AU - Daniel Hertz, Edan
AU - Romero-Garcia, Rafael
AU - Warrier, Varun
AU - Bethlehem, Richard A. I.
AU - Alexander-Bloch, Aaron F.
AU - Cohen, Jonathan D.
AU - Wang, Samuel S.-H.
AU - Sepulcre, Jorge
AU - Vannini, Patrizia
AU - Gomez, Jesse
TI - Cerebellar aging is spatially heterogeneous and supports cognitive resilience in later life
T2 - Nature neuroscience
J2 - Nat Neurosci
PY - 2026
DA - 2026/
VL - 29
IS - 7
SP - 1699
EP - 1710
SN - 1097-6256
PB - Nature Portfolio
DO - 10.1038/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1038/
"type": "article-journal",
"title": "Cerebellar aging is spatially heterogeneous and supports cognitive resilience in later life",
"container-title": "Nature neuroscience",
"author": [
{
"family": "d’Oleire Uquillas",
"given": "Federico"
},
{
"family": "Sefik",
"given": "Esra"
},
{
"family": "Seidlitz",
"given": "Jakob"
},
{
"family": "Daniel Hertz",
"given": "Edan"
},
{
"family": "Romero-Garcia",
"given": "Rafael"
},
{
"family": "Warrier",
"given": "Varun"
},
{
"family": "Bethlehem",
"given": "Richard A. I."
},
{
"family": "Alexander-Bloch",
"given": "Aaron F."
},
{
"family": "Cohen",
"given": "Jonathan D."
},
{
"family": "Wang",
"given": "Samuel S.-H."
},
{
"family": "Sepulcre",
"given": "Jorge"
},
{
"family": "Vannini",
"given": "Patrizia"
},
{
"family": "Gomez",
"given": "Jesse"
}
],
"container-title-short":
"volume": "29",
"issue": "7",
"page": "1699-1710",
"DOI": "10.1038/
"PMID": "42271047",
"PMCID": "PMC13337503",
"ISSN": "1097-6256",
"publisher": "Nature Portfolio",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
6,
10
]
]
}
}
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-73714-9 [code]
- The genetic architecture of cortical similarity networks.Journal: Nature communicationsIn common: patchwork, ggplot2, tidyverse, structural MRI / diffusion, 1 reference, 3 authors
- [2] doi:10.1162/imag.a.1290 [code]
- Calibration of MRI-based reference intervals to new samples.Journal: Imaging neuroscience (Cambridge, Mass.)In common: Alzheimer's / dementia, structural MRI / diffusion, 1 reference, 3 authors
- [3] doi:10.1038/s42003-026-10276-y [code]
- The cellular correlates and adolescent reorganisation of cortical myelination networks in the common marmoset.Journal: Communications biologyIn common: patchwork, tidyverse, structural MRI / diffusion, 3 references, author Richard Bethlehem
- [4] doi:10.7554/elife.103097 [code]
- Canonical neurodevelopmental trajectories of structural and functional manifolds.Journal: eLifeIn common: ggseg, cowplot, ggplot2, 1 other tool, structural MRI / diffusion, author Richard Bethlehem
- [5] doi:10.1038/s41593-026-02363-4 [code]
- Cortical thickness changes precede high levels of amyloid by at least 7 years.Journal: Nature neuroscienceIn common: ggseg, easystats, cowplot, 3 other tools, Alzheimer's / dementia, structural MRI / diffusion
- [6] doi:10.1111/jcpp.70178 [code]
- What makes a lonely child: environmental, health, and multimodal neuroimaging correlates of prospective loneliness in the ABCD study.Journal: Journal of child psychology and psychiatry, and allied disciplinesIn common: ggseg, easystats, patchwork, 2 other tools, structural MRI / diffusion, 1 reference
- [7] doi:10.1093/nc/niag029 [code]
- A data-driven approach to identifying and evaluating connectivity-based neural correlates of conscious visual perception.Journal: Neuroscience of consciousnessIn common: ggseg, easystats, cowplot, 3 other tools, cognitive
- [8] doi:10.1126/sciadv.aec2348 [code]
- Congenital blindness reduces myelination in human visual cortex.Journal: Science advancesIn common: ggseg, cowplot, ggplot2, 1 other tool, structural MRI / diffusion, 2 references
- [9] doi:10.1038/s41467-026-72940-5 [code]
- Cerebellar growth is associated with domain-specific cerebral maturation and socio-linguistic behavior.Journal: Nature communicationsIn common: 6 references
- [10] doi:10.1002/hbm.70605 [code]
- BrainEnrich: Revealing Biological Insights for Imaging-Derived Phenotypes Through Transcriptomic Enrichment.Journal: Human brain mappingIn common: ggseg, easystats, cowplot, 3 other tools
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
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, 1 script, and 4 matches 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:24e0844318d24dc1…
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.
