OSCR

Computational phenotyping of effort-based decision-making in type-2 diabetes on and off semaglutide.

Code ↔ Paper

6 matches 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.

5 blocks of code here have a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.

The 6 matches
  1. [1] § Results › Time since semaglutide injection did not affect effort-based decision-making ↔ code/analyses/5_primary_analyses.R, lines 247 to 306 · score 0.71 · Uncontrolled Eating, Emotional Eating, Cognitive Restrained, TFEQ · block oscr:b:WE7CH83WWEP0F-C · Report a mismatch
  2. [2] § Methods › Recruitment and data acquisition ↔ code/functions/screener_parsing_fun.R, lines 53 to 85 · score 0.62 · chronic disease, daily medication, neurological, GLP, treatment, diabetes · block oscr:b:RE3PET25GA0NX-V · Report a mismatch
  3. [3] § Methods › Procedure › Self-report questionnaires ↔ code/analyses/5_primary_analyses.R, lines 247 to 306 · score 0.57 · factor Eating Questionnaire, Monetary, MCQ, TFEQ · block oscr:b:WE7CH83WWEP0F-C · Report a mismatch
  4. [4] § Methods › Procedure › Compliance checks and exclusion criteria ↔ code/analyses/1_screening.R, lines 45 to 83 · score 0.56 · severe neurological disorder, B2, English · block oscr:b:CEHDDFCPAK6N7-8 · Report a mismatch
  5. [5] § Results › Type-2 diabetes subjects show a reduced bias to accept effort for reward ↔ code/analyses/6_non_diabetic_comparison.R, lines 209 to 252 · score 0.56 · 18.5–25, BMI matched, acceptance bias, semaglutide · block oscr:b:PZN18E1VYH79A-3 · Report a mismatch
  6. [6] § Results ↔ code/analyses/3_task_model_based.R, lines 370 to 421 · score 0.56 · Posterior predictive checks, winning model, model comparison, parabolic, fit · block oscr:b:PCPPQQZY8WNMH-C · 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 · 436 lines · 16 KB · no license · 2 matches

  1. #################################################################################################
  2. #######################---------------- Primary analyses ----------------########################
  3. #################################################################################################
  4. ### In this script:
  5. # (1) Prepare data
  6. # (2) Task data - model based
  7. # (3) Questionnaire data
  8. # Set working directory
  9. here::i_am("github/semaglutide-study/code/analyses/5_primary_analyses.R")
  10. setwd(here::here())
  11. # source functions
  12. source("github/semaglutide-study/code/functions/helper_funs.R")
  13. source("github/semaglutide-study/code/functions/plot_funs.R")
  14. # source dataset
  15. main_data <- readRDS("data/processed_data/main_data.RDS")
  16. # source parameter estimates
  17. m3_para_treat_s1_params <- readRDS(here::here("github/semaglutide-study/data/model_fits/treatment_s1/m3_para_treat_s1_params.RDS"))
  18. m3_para_control_params <- readRDS(here::here("github/semaglutide-study/data/model_fits/controls/m3_para_control_params.RDS"))
  19. # load required packages
  20. librarian::shelf(ggplot2, ggpubr, tidyverse, dplyr, stringr, purrr, here, janitor, MatchIt, PupillometryR,
  21. writexl, lubridate, magrittr, pushoverr, nlme, gridExtra, cmdstanr, rstanarm, bayestestR, hms)
  22. # Color pallet
  23. color_pal <- c("#E94D36", "#5B9BD5", "#71AB48", "#FDC219", "#8456B8", "#FF7236", "#1FD5B3", "#F781BE")
  24. ### (1) Prepare data -----------------------------------------------
  25. # Merge datasets for analyses
  26. data <- main_data$demographic_data %>%
  27. select(subj_id, group, age, gender, bmi, antidepressant) %>%
  28. mutate(antidepressant = ifelse(is.na(antidepressant), 0, antidepressant)) %>%
  29. left_join(main_data$glp_data %>%
  30. filter(session == 1) %>%
  31. select(subj_id, start_date_glp, side_effects_glp, glp_dose_mg, hours_since_injection, testing_day, local_testing_time) %>%
  32. mutate(time_on_glp = abs(difftime(as_date(start_date_glp), testing_day, units="days"))),
  33. by = "subj_id") %>%
  34. left_join(main_data$questionnaire_data %>%
  35. filter(session == 1) %>%
  36. select(subj_id, aes_sumScore, bdi_sumScore, findrisc_sumScore, mcq_discounting_rate, mctq_MSF_SC, meq_sumScore,
  37. ocir_sumScore, daq_sumScore, shaps_sumScore, tfeq_cr_sumScore, tfeq_ue_sumScore, tfeq_ee_sumScore,
  38. ipaq_sumScore, last_meal_time, last_meal_size, snack, snack_time, hunger_rating, cgl, cgl_measure,cgl_unit, hunger_rating),
  39. by = "subj_id") %>%
  40. left_join(main_data$task_meta_data %>%
  41. filter(session == 1) %>%
  42. select(subj_id, start_time)) %>%
  43. left_join(rbind(m3_para_treat_s1_params$individual_params %>%
  44. pivot_wider(id_cols = subj_id, names_from = parameter,
  45. values_from = c(estimate, hdi_lower, hdi_upper)),
  46. m3_para_control_params$individual_params %>%
  47. pivot_wider(id_cols = subj_id, names_from = parameter,
  48. values_from = c(estimate, hdi_lower, hdi_upper))),
  49. by = "subj_id") %>%
  50. # make MCTQ result numeric (minutes since 00:00)
  51. add_column(mctq_continuous = period_to_seconds(hm(.$mctq_MSF_SC))/60,
  52. .before = "mctq_MSF_SC")
  53. # Parameters
  54. # Scale parameters to be between 0 and 1
  55. data %<>%
  56. ungroup %>%
  57. mutate(across(c(estimate_kE, estimate_kR, estimate_a), rescale))
  58. # Visualize distributions
  59. ggplot(gather(data %>% select(c(estimate_kE:estimate_a))) %>% na.omit(),
  60. aes(value)) +
  61. geom_histogram(bins = 10) +
  62. facet_wrap(~key, scales = 'free_x')
  63. # Questionnaires
  64. # Scale parameters to be between 0 and 1
  65. data %<>%
  66. ungroup %>%
  67. mutate_at(colnames(data)[c(14:18, 21:27)], rescale)
  68. # Visualize distributions
  69. ggplot(gather(data %>% select(colnames(data)[c(5, 14:18, 21:27)])) %>% na.omit(),
  70. aes(value)) +
  71. geom_histogram(bins = 10) +
  72. facet_wrap(~key, scales = 'free_x')
  73. data %<>%
  74. # positively skewed
  75. mutate_at(c("bdi_sumScore", "daq_sumScore",
  76. "mcq_discounting_rate", "mctq_continuous",
  77. "ocir_sumScore", "shaps_sumScore"), sqrt) %>%
  78. # negatively skewed
  79. mutate_at(c("aes_sumScore"), norm_neg_skew)
  80. ### (2) Task data - model based -----------------------------------------------
  81. ### Effort sensitivity
  82. data %>%
  83. group_by(group) %>%
  84. summarise(mean_kE = mean(estimate_kE),
  85. sd_kE = sd(estimate_kE))
  86. # Check if variances are equal
  87. var.test(data$estimate_kE ~ data$group)
  88. # => variances are equal -> t test
  89. t.test(data$estimate_kE ~ data$group, var.equal = TRUE)
  90. kE_glm <- stan_glm(estimate_kE ~ group, data = data,
  91. iter = 10000, seed = 123)
  92. kE_glm$coefficients
  93. hdi(kE_glm)
  94. kE_plot <- raincloud_plot(dat = data, title = "",
  95. xlab = " ", ylab = "Effort sensitivity",
  96. predictor_var = "group", outcome_var = "estimate_kE",
  97. predictor_tick_lab = c("control", "treatment"), col = c(color_pal[1], color_pal[2]),
  98. include_grouping = FALSE, direction = "horizontal", scale_seq = c(-0, 1,0.25)) +
  99. theme(legend.position = "none") +
  100. ggtitle("Effort sensitivity")
  101. ### Reward sensitivity
  102. data %>%
  103. group_by(group) %>%
  104. summarise(mean_kR = mean(estimate_kR),
  105. sd_kR = sd(estimate_kR))
  106. # Check if variances are equal
  107. var.test(data$estimate_kR ~ data$group)
  108. # => variances are not equal -> welch test
  109. t.test(data$estimate_kR ~ data$group, var.equal = FALSE)
  110. kR_glm <- stan_glm(estimate_kR ~ group, data = data,
  111. iter = 10000, seed = 123)
  112. kR_glm$coefficients
  113. hdi(kR_glm)
  114. kR_plot <- raincloud_plot(dat = data, title = "",
  115. xlab = " ", ylab = "Reward sensitivity",
  116. predictor_var = "group", outcome_var = "estimate_kR",
  117. predictor_tick_lab = c("control", "treatment"), col = c(color_pal[1], color_pal[2]),
  118. include_grouping = FALSE, direction = "horizontal", scale_seq = c(-0, 1,0.25)) +
  119. theme(legend.position = "none") +
  120. ggtitle("Reward sensitivity")
  121. ### Choice bias
  122. data %>%
  123. group_by(group) %>%
  124. summarise(mean_a = mean(estimate_a),
  125. sd_a = sd(estimate_a))
  126. # Check if variances are equal
  127. var.test(data$estimate_a ~ data$group)
  128. # => variances are equal -> t test
  129. t.test(data$estimate_a ~ data$group, var.equal = FALSE)
  130. # Bayesian GLM
  131. a_glm <- stan_glm(estimate_a ~ group, data = data,
  132. iter = 100000, seed = 123)
  133. a_glm$coefficients
  134. hdi(a_glm)
  135. a_plot <- raincloud_plot(dat = data, title = "",
  136. xlab = " ", ylab = "Choice bias",
  137. predictor_var = "group", outcome_var = "estimate_a",
  138. predictor_tick_lab = c("control", "treatment"), col = c(color_pal[1], color_pal[2]),
  139. include_grouping = FALSE, direction = "horizontal", scale_seq = c(-0, 1, 0.25)) +
  140. theme(legend.position = "none") +
  141. ggtitle("Choice bias")
  142. ### (3) Questionnaire data -----------------------------------------------
  143. ### Psychiatric questionnaires ----
  144. # Correlation between questionnaires
  145. psych_cor <- data %>%
  146. select(bmi, aes_sumScore, bdi_sumScore, ocir_sumScore, daq_sumScore, shaps_sumScore) %>%
  147. rename(aes = aes_sumScore, bdi = bdi_sumScore, ocir = ocir_sumScore, daq = daq_sumScore, shaps = shaps_sumScore) %>%
  148. cor()
  149. corrplot::corrplot(psych_cor, method="circle")
  150. # Group comparison
  151. # AES
  152. # frequentist
  153. data %>%
  154. group_by(group) %>%
  155. summarise(mean_aes = mean(aes_sumScore),
  156. sd_aes = sd(aes_sumScore))
  157. t.test(aes_sumScore ~ group, data = data)
  158. aes_f_glm <- glm(aes_sumScore ~ group, data = data, family = "gaussian")
  159. summary(aes_f_glm)
  160. # bayesian
  161. aes_b_glm <- stan_glm(aes_sumScore ~ group, data = data,
  162. iter = 10000, seed = 123)
  163. aes_b_glm$coefficients
  164. hdi(aes_b_glm)
  165. # BDI
  166. data %>%
  167. group_by(group) %>%
  168. summarise(mean_bdi = mean(bdi_sumScore),
  169. sd_bdi = sd(bdi_sumScore))
  170. t.test(bdi_sumScore ~ group, data = data)
  171. bdi_f_glm <- glm(bdi_sumScore ~ group, data = data, family = "gaussian")
  172. summary(bdi_f_glm)
  173. # bayesian
  174. bdi_b_glm <- stan_glm(bdi_sumScore ~ group, data = data,
  175. iter = 10000, seed = 123)
  176. bdi_b_glm$coefficients
  177. hdi(bdi_b_glm)
  178. # OCIR
  179. # frequentist
  180. data %>%
  181. group_by(group) %>%
  182. summarise(mean_ocir = mean(ocir_sumScore),
  183. sd_ocir = sd(ocir_sumScore))
  184. t.test(ocir_sumScore ~ group, data = data)
  185. ocir_f_glm <- glm(ocir_sumScore ~ group, data = data, family = "gaussian")
  186. summary(ocir_f_glm)
  187. # bayesian
  188. ocir_b_glm <- stan_glm(ocir_sumScore ~ group, data = data,
  189. iter = 10000, seed = 123)
  190. ocir_b_glm$coefficients
  191. hdi(ocir_b_glm)
  192. # DAQ
  193. # frequentist
  194. data %>%
  195. group_by(group) %>%
  196. summarise(mean_daq = mean(daq_sumScore),
  197. sd_daq = sd(daq_sumScore))
  198. t.test(daq_sumScore ~ group, data = data)
  199. daq_f_glm <- glm(daq_sumScore ~ group, data = data, family = "gaussian")
  200. summary(daq_f_glm)
  201. # bayesian
  202. daq_b_glm <- stan_glm(daq_sumScore ~ group, data = data,
  203. iter = 10000, seed = 123)
  204. daq_b_glm$coefficients
  205. hdi(daq_b_glm)
  206. # SHAPS
  207. # frequentist
  208. data %>%
  209. group_by(group) %>%
  210. summarise(mean_shaps = mean(shaps_sumScore),
  211. sd_shaps = sd(shaps_sumScore))
  212. t.test(shaps_sumScore ~ group, data = data)
  213. shaps_f_glm <- glm(shaps_sumScore ~ group, data = data, family = "gaussian")
  214. summary(shaps_f_glm)
  215. # bayesian
  216. shaps_b_glm <- stan_glm(shaps_sumScore ~ group, data = data,
  217. iter = 10000, seed = 123)
  218. shaps_b_glm$coefficients
  219. hdi(shaps_b_glm)
  220. # Monetary discounting
  221. # frequentist
  222. data %>%
  223. group_by(group) %>%
  224. summarise(mean_mcq = mean(mcq_discounting_rate),
  225. sd_mcq = sd(mcq_discounting_rate))
  226. t.test(mcq_discounting_rate ~ group, data = data)
  227. mcq_glm <- glm(mcq_discounting_rate ~ group, data = data, family = "gaussian")
  228. summary(mcq_glm)
  229. # bayesian
  230. mcq_glm <- stan_glm(mcq_discounting_rate ~ group, data = data,
  231. iter = 10000, seed = 123)
  232. mcq_glm$coefficients
  233. hdi(mcq_glm)
  234. ### Three factor eating questionnaire ----
  235. # Correlation between questionnaires
  236. eat_cor <- data %>%
  237. select(tfeq_cr_sumScore, tfeq_ue_sumScore, tfeq_ee_sumScore) %>%
  238. rename(cognitive_restraint = tfeq_cr_sumScore, uncontrolled_eating = tfeq_ue_sumScore, emotional_eating = tfeq_ee_sumScore) %>%
  239. cor()
  240. corrplot::corrplot(eat_cor, method="circle")
  241. # Cognitive restrained
  242. # frequentist
  243. data %>%
  244. group_by(group) %>%
  245. summarise(mean_cr = mean(tfeq_cr_sumScore),
  246. sd_cr = sd(tfeq_cr_sumScore))
  247. t.test(tfeq_cr_sumScore ~ group, data = data)
  248. tfeq_cr_f_glm <- glm(tfeq_cr_sumScore ~ group, data = data, family = "gaussian")
  249. summary(tfeq_cr_f_glm)
  250. # bayesian
  251. tfeq_cr_glm <- stan_glm(tfeq_cr_sumScore ~ group, data = data,
  252. iter = 10000, seed = 123)
  253. tfeq_cr_glm$coefficients
  254. hdi(tfeq_cr_glm)
  255. # Uncontrolled eating
  256. # frequentist
  257. data %>%
  258. group_by(group) %>%
  259. summarise(mean_ue = mean(tfeq_ue_sumScore),
  260. sd_ue = sd(tfeq_ue_sumScore))
  261. t.test(tfeq_ue_sumScore ~ group, data = data)
  262. tfeq_ue_f_glm <- glm(tfeq_ue_sumScore ~ group, data = data, family = "gaussian")
  263. summary(tfeq_ue_f_glm)
  264. # bayesian
  265. tfeq_ue_glm <- stan_glm(tfeq_ue_sumScore ~ group, data = data,
  266. iter = 10000, seed = 123)
  267. tfeq_ue_glm$coefficients
  268. hdi(tfeq_ue_glm)
  269. tfeq_ue_plot <- raincloud_plot(dat = data, title = "",
  270. xlab = " ", ylab = "Uncontrolled Eating",
  271. predictor_var = "group", outcome_var = "tfeq_ue_sumScore",
  272. predictor_tick_lab = c("control", "treatment"), col = c(color_pal[1], color_pal[2]),
  273. include_grouping = FALSE, direction = "horizontal", scale_seq = c(-0, 1,0.25)) +
  274. theme(legend.position = "none") +
  275. ggtitle("Uncontrolled Eating")
  276. # Emotional eating
  277. # frequentist
  278. data %>%
  279. group_by(group) %>%
  280. summarise(mean_ee = mean(tfeq_ee_sumScore),
  281. sd_ee = sd(tfeq_ee_sumScore))
  282. t.test(tfeq_ee_sumScore ~ group, data = data)
  283. tfeq_ee_f_glm <- glm(tfeq_ee_sumScore ~ group, data = data, family = "gaussian")
  284. summary(tfeq_ee_f_glm)
  285. # bayesian
  286. tfeq_ee_glm <- stan_glm(tfeq_ee_sumScore ~ group, data = data,
  287. iter = 10000, seed = 123)
  288. tfeq_ee_glm$coefficients
  289. hdi(tfeq_ee_glm)
  290. # Controlling for antidepressants
  291. tfeq_cr_f_glm <- glm(tfeq_cr_sumScore ~ group + antidepressant, data = data, family = "gaussian")
  292. summary(tfeq_cr_f_glm)
  293. tfeq_ue_f_glm <- glm(tfeq_ue_sumScore ~ group + antidepressant, data = data, family = "gaussian")
  294. summary(tfeq_ue_f_glm)
  295. tfeq_ee_f_glm <- glm(tfeq_ee_sumScore ~ group + antidepressant, data = data, family = "gaussian")
  296. summary(tfeq_ee_f_glm)
  297. # Effect of time on medication in Ozempic group?
  298. time_on_glp_ue_f_glm <- glm(tfeq_ue_sumScore ~ time_on_glp,
  299. data = data %>% filter(group == "treatment"),
  300. family = "gaussian")
  301. summary(time_on_glp_ue_f_glm)
  302. time_on_glp_ue_glm <- stan_glm(tfeq_ue_sumScore ~ time_on_glp, data = data %>% filter(group == "treatment"),
  303. iter = 10000, seed = 123)
  304. time_on_glp_ue_glm$coefficients
  305. hdi(time_on_glp_ue_glm)
  306. ggplot(data %>% filter(group == "treatment"),
  307. aes(time_on_glp, tfeq_ue_sumScore)) +
  308. geom_point() +
  309. stat_smooth(method = "lm",
  310. formula = y ~ x,
  311. geom = "smooth")
  312. ### Circadian questionnaires ----
  313. # Correlation between questionnaires
  314. circ_cor <- data %>%
  315. select(mctq_continuous, meq_sumScore) %>%
  316. rename(MCTQ = mctq_continuous, MEQ = meq_sumScore) %>%
  317. cor()
  318. corrplot::corrplot(circ_cor, method="circle")
  319. # MCTQ
  320. # frequentist
  321. data %>%
  322. group_by(group) %>%
  323. summarise(mean_mctq = mean(mctq_continuous),
  324. sd_mctq = sd(mctq_continuous))
  325. t.test(mctq_continuous ~ group, data = data)
  326. mctq_f_glm <- glm(mctq_continuous ~ group, data = data, family = "gaussian")
  327. summary(mctq_f_glm)
  328. # bayesian
  329. mctq_glm <- stan_glm(mctq_continuous ~ group, data = data,
  330. iter = 10000, seed = 123)
  331. mctq_glm$coefficients
  332. hdi(mctq_glm)
  333. # MEQ
  334. # frequentist
  335. data %>%
  336. group_by(group) %>%
  337. summarise(mean_meq = mean(meq_sumScore),
  338. sd_meq = sd(meq_sumScore))
  339. t.test(meq_sumScore ~ group, data = data)
  340. meq_f_glm <- glm(meq_sumScore ~ group, data = data, family = "gaussian")
  341. summary(meq_f_glm)
  342. # bayesian
  343. meq_glm <- stan_glm(meq_sumScore ~ group, data = data,
  344. iter = 10000, seed = 123)
  345. meq_glm$coefficients
  346. hdi(meq_glm)
  347. # Make chronotype
  348. data %<>%
  349. mutate(chronotype = case_when(meq_sumScore > 58 & hm(mctq_MSF_SC) < hm("02:30") ~ "early",
  350. meq_sumScore < 42 & hm(mctq_MSF_SC) > hm("05:30") ~ "late",
  351. is.na(mctq_MSF_SC) ~ "NA",
  352. .default = "intermediate"))
  353. data %>%
  354. tabyl(group, chronotype) %>%
  355. chisq.test()
  356. # Test relationship between chronotype and time of testing
  357. data %<>%
  358. mutate(local_testing_time = as.POSIXct(paste("01jan2000 ", local_testing_time, ":00", sep = ""),
  359. format = "%d%b%Y %H:%M:%S")) %>%
  360. mutate(local_testing_time = case_when(as.POSIXlt(local_testing_time)$hour < 4 ~ .$local_testing_time + days(1),
  361. .default = .$local_testing_time ))
  362. chronotype_testing_time <- glm(data$local_testing_time %>% as.numeric() ~
  363. data$chronotype, family = "gaussian")
  364. summary(chronotype_testing_time)
  365. time_chrono_plot <- raincloud_plot(dat = data, title = "",
  366. xlab = " ", ylab = "Testing Time",
  367. predictor_var = "chronotype", outcome_var = "local_testing_time",
  368. predictor_tick_lab = c("early", "intermediate", "late"), col = c(color_pal[1], color_pal[2], color_pal[3]),
  369. include_grouping = FALSE, direction = "horizontal", scale_seq = NULL) +
  370. theme(legend.position = "none") +
  371. ggtitle("Time of testing by Chronotype")
  372. time_meq_plot <- ggplot(data = data,
  373. aes_string(y = "meq_sumScore", x = "local_testing_time")) +
  374. geom_point(aes(color = color_pal[3])) +
  375. stat_smooth(method = "lm",
  376. formula = y ~ x,
  377. geom = "smooth",
  378. aes(color = color_pal[3]))

5_primary_analyses.R at commit 24265e3, no license · at the source

Overview

  1. MRC Cognition and Brain Sciences Unit, University of Cambridge, Cambridge, UK
  2. Department of Psychiatry, University of Cambridge, Cambridge, UK
Institutions: MRC Cognition and Brain Sciences Unit (United Kingdom); University of Cambridge (United Kingdom)
Dates: received 23 December 2025; accepted 17 April 2026; published online 6 May 2026; in print October 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1038/s41386-026-02433-y · PMID 42086986 · PMCID PMC13597482 · OpenAlex W7160301471
Open access: hybrid, a free copy (OpenAlex)
Status: code verified (how the code is found and verified)
Categories: human (organism), other condition (population), depression (population), cognitive (subfield)
Methods: Statistics, Machine learning, Connectivity
Keywords: Motivation, Human behaviour, Decision, Depression
MeSH: Decision Making*, Diabetes Mellitus, Type 2*, Glucagon-Like Peptides*, Hypoglycemic Agents*, Motivation*, Aged, Female, Humans, Male, Middle Aged, Phenotype, Reward, Semaglutide (* major topic)
Topic: Diabetes Treatment and Management (Endocrinology, Diabetes and Metabolism, Medicine), according to OpenAlex
Funding: AXA Research Fund (Le Fonds AXA pour la Recherche) (G102329); Wellcome Trust (226490/Z/22/Z); National Institute for Health Research (NIHR) (BRC-1215-20014); Medical Research Council (MC_UU_00030/12)
Citations: not cited yet (Europe PMC); 41 references in the paper

Abstract

Motivation plays a fundamental role in human behaviour. Dopaminergic pathways have long been implicated in individual differences in motivation. Emerging evidence suggests such neural mechanisms interact with metabolic processes to coordinate energy expenditure with energy resources, thereby linking motivation with metabolic health. We ask whether a cognitive-computational index of motivation—reliably linked to neuropsychiatric symptoms—is altered in the context of type-2 diabetes and treatment with a GLP-1 agonist (semaglutide). In a pre-registered experiment, we quantified computational effort-based decision-making parameters in participants with diabetes on (N = 58) or off (N = 54) semaglutide treatment, compared to two groups of matched controls without diabetes (N = 58 each). Subjects with type-2 diabetes showed a blunted acceptance bias, a computational parameter describing the bias to accept effort for reward. This effect was not driven by neuropsychiatric comorbidity or antidepressant use. Across all participants, we found that increasing diabetes risk linearly predicted reduced acceptance bias. Participants with diabetes treated with semaglutide did not show restored motivation. Metabolic ill-health is associated with reduced acceptance bias during motivational decision-making. This blunting mirrors—but is largely independent of—neuropsychiatric motivational deficits. This suggests metabolic ill-health is accompanied by a cognitive shift towards energy conservation, potentially contributing to comorbidity between metabolic ill-health and mental illness.

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

Repositories

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

OSF 7kmf5

License: none: the authors keep all their rights
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Size: 0 files, 0 scripts
Software Heritage: not checked
Found in: the text, “Methods”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 28 September 2026: the link answers (HTTP 200)
  • 28 September 2026: the link answers (HTTP 200)
At the source: osf.io/7kmf5

smehrhof/semaglutide-study

License: none: the authors keep all their rights
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Commit: 24265e3830c49ab74ad2af6420ab1565961ab643, 23 June 2025
Languages: R (16), Stan (16)
Size: 83 files, 32 scripts
Software Heritage: not archived
Found in: “Code availability”
Holds: README
Not found: license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: Stan (19 files), ggplot2 (4 files), ggpubr (2 files), tidyverse (2 files), broom (1 file), cowplot (1 file)
Availability: 1 check, the latest on 28 September 2026: the link answers
  • 28 September 2026: the link answers
33 files

smehrhof/effort-study

License: MIT
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Commit: 80f3557d5fe4e159c46866d3259d05299d71660f, 16 June 2025
Languages: R (21), Stan (20), JavaScript (13)
Size: 136 files, 54 scripts
Software Heritage: not archived
Found in: “Code availability”
Holds: README, license file
Not found: CITATION.cff, environment file, tests, continuous integration, documentation
Tools: Stan (28 files), ggplot2 (4 files), ggpubr (4 files), cowplot (1 file), tidyverse (1 file)
Availability: 1 check, the latest on 28 September 2026: the link answers
  • 28 September 2026: the link answers
56 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:

  • 3 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 86 scripts, each with its path and the digest of its content;
  • 6 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 Statement

The analysis code and data are openly available at github.com/smehrhof/semaglutide-study. The effort-expenditure task code is available at github.com/smehrhof/effort-study. A previous version of this article has been published as a pre-print on PsyArXiv: https://doi.org/10.31234/osf.io/4bkm9. For the purpose of open access, the author has applied a Creative Commons Attribution (CC BY) licence to any Author Accepted Manuscript version arising from this submission.

The analysis code and data are openly available at github.com/smehrhof/semaglutide-study. The effort-expenditure task code is available at github.com/smehrhof/effort-study. A previous version of this article has been published as a pre-print on PsyArXiv: https://doi.org/10.31234/osf.io/4bkm9. For the purpose of open access, the author has applied a Creative Commons Attribution (CC BY) licence to any Author Accepted Manuscript version arising from this submission.

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

Recorded: type, language, journal, volume, issue, pages, dates, 3 authors, 4 keywords, 13 MeSH terms, 4 funders, 40 references.

Cite

This paper

Mehrhof, S. Z., Fleming, H., & Nord, C. L. (2026). Computational phenotyping of effort-based decision-making in type-2 diabetes on and off semaglutide. Neuropsychopharmacology : official publication of the American College of Neuropsychopharmacology, 51(11), 1924-1931. https://doi.org/10.1038/s41386-026-02433-y

BibTeX

@article{mehrhof2026computational,
author = {Mehrhof, Sara Z and Fleming, Hugo and Nord, Camilla L},
title = {{Computational phenotyping of effort-based decision-making in type-2 diabetes on and off semaglutide}},
journal = {Neuropsychopharmacology : official publication of the American College of Neuropsychopharmacology},
year = {2026},
month = may,
volume = {51},
number = {11},
pages = {1924--1931},
publisher = {Nature Publishing Group},
issn = {0893-133X},
doi = {10.1038/s41386-026-02433-y},
url = {https://doi.org/10.1038/s41386-026-02433-y},
pmid = {42086986},
pmcid = {PMC13597482}
}

RIS

TY - JOUR
AU - Mehrhof, Sara Z
AU - Fleming, Hugo
AU - Nord, Camilla L
TI - Computational phenotyping of effort-based decision-making in type-2 diabetes on and off semaglutide
T2 - Neuropsychopharmacology : official publication of the American College of Neuropsychopharmacology
J2 - Neuropsychopharmacology
PY - 2026
DA - 2026/05/06
VL - 51
IS - 11
SP - 1924
EP - 1931
SN - 0893-133X
PB - Nature Publishing Group
DO - 10.1038/s41386-026-02433-y
UR - https://doi.org/10.1038/s41386-026-02433-y
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41386-026-02433-y",
"type": "article-journal",
"title": "Computational phenotyping of effort-based decision-making in type-2 diabetes on and off semaglutide",
"container-title": "Neuropsychopharmacology : official publication of the American College of Neuropsychopharmacology",
"author": [
{
"family": "Mehrhof",
"given": "Sara Z"
},
{
"family": "Fleming",
"given": "Hugo"
},
{
"family": "Nord",
"given": "Camilla L"
}
],
"container-title-short": "Neuropsychopharmacology",
"volume": "51",
"issue": "11",
"page": "1924-1931",
"DOI": "10.1038/s41386-026-02433-y",
"PMID": "42086986",
"PMCID": "PMC13597482",
"ISSN": "0893-133X",
"publisher": "Nature Publishing Group",
"URL": "https://doi.org/10.1038/s41386-026-02433-y",
"language": "en",
"issued": {
"date-parts": [
[
2026,
5,
6
]
]
}
}

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.7554/elife.96803 [code]
A common alteration in effort-based decision-making in apathy, anhedonia, and late circadian rhythm.
Journal: eLife
In common: Stan, cowplot, ggpubr, 2 other tools, cognitive, 9 references, 2 authors
[2] doi:10.1371/journal.pbio.3002978 [code]
Basal ganglia components have distinct computational roles in decision-making dynamics under conflict and uncertainty.
Journal: PLoS biology
In common: Stan, broom, cowplot, 3 other tools, cognitive, other condition
[3] doi:10.1093/cercor/bhae350 [code]
Individual differences in spatial working memory strategies differentially reflected in the engagement of control and default brain networks.
Journal: Cerebral cortex (New York, N.Y. : 1991)
In common: Stan, broom, cowplot, 3 other tools, cognitive
[4] doi:10.1038/s44271-026-00431-w [code]
Alpha power increases spontaneously during a neurofeedback session.
Journal: Communications psychology
In common: Stan, broom, cowplot, 3 other tools, cognitive
[5] doi:10.1162/imag_a_00312 [code]
Alpha-band fluctuations represent behaviorally relevant excitability changes as a consequence of top-down guided spatial attention in a probabilistic spatial cueing design.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: Stan, broom, cowplot, 3 other tools, cognitive
[6] 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: Stan, broom, cowplot, 3 other tools
[7] doi:10.1186/s11689-025-09651-3 [code]
The association between infant EEG aperiodic exponent and the trajectory of restricted and repetitive behaviors for toddlers with and without autism.
Journal: Journal of neurodevelopmental disorders
In common: Stan, broom, cowplot, 3 other tools
[8] doi:10.1162/imag.a.1258 [code]
Non-specific increase in alpha power during a neurofeedback session targeting its downregulation.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: Stan, broom, cowplot, 3 other tools
[9] doi:10.1098/rspb.2022.1115 [code]
Ageing desexualizes the <i>Drosophila</i> brain transcriptome.
Journal: Proceedings. Biological sciences
In common: Stan, broom, cowplot, 3 other tools
[10] doi:10.1162/imag.a.1330 [code]
Human risk taking and metabolic state: No credible evidence for desacyl-ghrelin modulation of neural or behavioural effects.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: Stan, cowplot, ggplot2, 1 other tool, cognitive, 1 reference

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.1038/s41386-026-02433-y.svg)](https://openscicode.org/badge/doi/10.1038/s41386-026-02433-y)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.1038/s41386-026-02433-y.svg
   :target: https://openscicode.org/badge/doi/10.1038/s41386-026-02433-y
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1038/s41386-026-02433-y"><img src="https://openscicode.org/badge/doi/10.1038/s41386-026-02433-y.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.