OSCR

Obesity is associated with greater variability of reward signals in the nucleus accumbens.

Code ↔ Paper

1 match between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

One block of code here has 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 1 match
  1. [1] § Methods › Data analysis › Behavioral data ↔ TUE002_EAT_trial_based_plots_share.R, lines 25 to 81 · score 0.50 · reward magnitude, subBED, age, uncertain, food, BMI · block oscr:b:XRKGFMDSS6N56-F · 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 · 1,101 lines · 41 KB · no license · 1 match

  1. library(ggplot2)
  2. library(foreign)
  3. library(MASS)
  4. library(cowplot)
  5. library(viridis)
  6. library(readxl)
  7. library(tidyverse)
  8. library(ggdist)
  9. library(dplyr)
  10. library(ggridges)
  11. library(brms)
  12. theme_set(theme_cowplot(font_size=12))
  13. dT <- read.csv("/mnt/big_data/SynologyDrive/Paper/drafts/TUE002_EATVAR/analysis/data/TUE002_trial_cue_responses.csv")
  14. dT_fb <- read.csv("/mnt/big_data/SynologyDrive/Paper/drafts/TUE002_EATVAR/analysis/data/TUE002_trial_feedback_responses_more_mvmt.csv")
  15. dQ <- read_excel("../data/TUE002_Sample_allS1_inclFEV.xlsx")
  16. d <- read_excel("/mnt/big_data/SynologyDrive/Paper/drafts/TUE002_EATVAR/analysis/data/TUE002_S1_incl_diagnosis.xlsx")
  17. d$rBMI <- rank(d$BMI_S1)
  18. #Prep TFEQ for plotting
  19. dQ <-
  20. dQ %>%
  21. mutate(
  22. bTFEQ_Dis = ntile(FEV_disinh, n=4))
  23. dQ <-
  24. dQ %>%
  25. mutate(bTFEQ_Dis = if_else(bTFEQ_Dis>2, bTFEQ_Dis - 1, bTFEQ_Dis))
  26. dQ$fTFEQ_Dis <- factor(dQ$bTFEQ_Dis, labels = c("Low", "Medium", "High"))
  27. dT <- merge(x = dT, y = d, by = "ID", all.x=TRUE)
  28. dT$fBinge <- factor(dT$Group, labels = c('No BE', 'subBED', 'BED'))
  29. dT$fBMI <- cut(dT$BMI_S1, breaks = c(-100,25,30,'Inf'), labels = c("Normal", "Overweight", "Obese"))
  30. dT$fMoney <- factor(dT$Money, labels = c("Food","Money"))
  31. dT$RewMag <- factor(dT$RewardMagnitude, labels = c("Low","High"))
  32. dT$fUnc <- factor(dT$Uncertainty, labels = c("Certain","Uncertain"))
  33. dT$cBMI = dT$BMI_S1 - mean(dT$BMI_S1, na.rm = TRUE)
  34. dT$zBMI = scale(dT$BMI_S1)
  35. dT$cAge = dT$Age - mean(dT$Age, na.rm = TRUE)
  36. dT <- merge(x = dT, y = dQ[ , c("ID","FEV_disinh","bTFEQ_Dis","fTFEQ_Dis")], by = "ID", all.x=TRUE)
  37. dT$cRewM <- dT$RewardMagnitude
  38. dT$cTFEQ_Dis <- dT$FEV_disinh - mean(dT$FEV_disinh)
  39. dT <- left_join(dT,d_SD %>% select(ID, Uncertainty,std_Cue_aMTL,std_Cue_pMTL,std_Cue_toMTL))
  40. dT_fb <- merge(x = dT_fb, y = d, by = "ID", all.x=TRUE)
  41. dT_fb$fBinge <- factor(dT_fb$Group, labels = c('No BE', 'subBED', 'BED'))
  42. dT_fb$fBMI <- cut(dT_fb$BMI_S1, breaks = c(-100,25,30,'Inf'), labels = c("Normal", "Overweight", "Obese"))
  43. dT_fb$fMoney <- factor(dT_fb$Money, labels = c("Food","Money"))
  44. dT_fb$RewMag <- factor(dT_fb$Reward.Magnitude, labels = c("Low","High"))
  45. dT_fb$fUnc <- factor(dT_fb$Uncertainty, labels = c("Certain","Uncertain"))
  46. dT_fb$cBMI = dT_fb$BMI_S1 - mean(dT_fb$BMI_S1, na.rm = TRUE)
  47. dT_fb$zBMI = scale(dT_fb$BMI_S1)
  48. dT_fb$cAge = dT$Age - mean(dT_fb$Age, na.rm = TRUE)
  49. dT_fb <- merge(x = dT_fb, y = dQ[ , c("ID","FEV_disinh","bTFEQ_Dis","fTFEQ_Dis")], by = "ID", all.x=TRUE)
  50. dT_fb$cRewM <- (dT_fb$Reward.Magnitude-5.5)/4.5
  51. dT_fb$cTFEQ_Dis <- dT_fb$FEV_disinh - mean(dT_fb$FEV_disinh)
  52. dT_fb <- left_join(dT_fb,d_SD %>% select(ID, Uncertainty,std_Cue_aMTL,std_Cue_pMTL,std_Cue_toMTL))
  53. dT_S1_Unc <- read_csv("/mnt/big_data/SynologyDrive/Paper/drafts/TUE002_EATVAR/analysis/data/TUE002_grEAT_S1_resid_Unc.csv")
  54. dT_S1_Cer <- read_csv("/mnt/big_data/SynologyDrive/Paper/drafts/TUE002_EATVAR/analysis/data/TUE002_grEAT_S1_resid_Cer.csv")
  55. dT_S1_Cer$fBinge <- factor(dT_S1_Cer$fBinge)
  56. dT_S1_Cer$fBinge <- fct_relevel(dT_S1_Cer$fBinge, "No BE")
  57. dT_S1_Cer$fMoney <- factor(dT_S1_Cer$cRewT, labels = c("Food","Money"))
  58. dT_S1_Cer$zBMI = scale(dT_S1_Cer$BMI_S1)
  59. dT_S1_Cer <-
  60. dT_S1_Cer %>%
  61. mutate(bTFEQ_Dis = ntile(FEV_disinh, n=4)) %>%
  62. mutate(bTFEQ_Dis = if_else(bTFEQ_Dis>2, bTFEQ_Dis - 1, bTFEQ_Dis))
  63. dT_S1_Cer$fTFEQ_Dis <- factor(dT_S1_Cer$bTFEQ_Dis, labels = c("Low", "Medium", "High"))
  64. dT_S1_Unc$fBinge <- factor(dT_S1_Unc$fBinge)
  65. dT_S1_Unc$fBinge <- fct_relevel(dT_S1_Unc$fBinge, "No BE","subBED","BED")
  66. dT_S1_Unc$fMoney <- factor(dT_S1_Unc$cRewT, labels = c("Food","Money"))
  67. dT_S1_Unc$zBMI = scale(dT_S1_Unc$BMI_S1)
  68. dT_S1_Unc <-
  69. dT_S1_Unc %>%
  70. mutate(bTFEQ_Dis = ntile(FEV_disinh, n=4)) %>%
  71. mutate(bTFEQ_Dis = if_else(bTFEQ_Dis>2, bTFEQ_Dis - 1, bTFEQ_Dis))
  72. dT_S1_Unc$fTFEQ_Dis <- factor(dT_S1_Unc$bTFEQ_Dis, labels = c("Low", "Medium", "High"))
  73. dT_S1_Unc %>%
  74. dplyr::select(ID,fBinge,BMI_S1,FEV_disinh,Age) %>%
  75. unique()-> demo
  76. dT_S1_Cer$cTFEQ_Dis <- dT_S1_Cer$FEV_disinh - mean(dT_S1_Cer$FEV_disinh)
  77. dT_S1_Unc$cTFEQ_Dis <- dT_S1_Unc$FEV_disinh - mean(dT_S1_Unc$FEV_disinh)
  78. dT_S1_Cer$certain <- 1
  79. dT_S1_Unc$certain <- 0
  80. dT_S1 <- rbind(dT_S1_Cer,dT_S1_Unc)
  81. #Plots
  82. #Figure 3
  83. pF1a <-
  84. ggplot(aes(x = fBinge,y = Cue_NAcc, fill = fBinge), data=dT) +
  85. stat_halfeye(size = 5, alpha = 0.8) +
  86. scale_fill_manual(guide = guide_legend(title="Group"),values = c('#86c8f7','#4a87af','#004c6d')) +
  87. coord_cartesian(ylim = c(-0.52, 0.52)) +
  88. theme(text = element_text(face = 'bold',size = 12.0),axis.text = element_text(face = 'plain',size = 12.0),
  89. axis.text.x = element_text(size = 11.0), legend.position = 'none',
  90. strip.text.x = element_text(margin = margin(0.15,0,0.15,0, "cm")),
  91. plot.title = element_text(size = 13, hjust = 0.5),
  92. plot.subtitle = element_text(size = 12, hjust = 0.5))+
  93. facet_grid(fMoney ~ .) +
  94. geom_hline(yintercept = 0, color = 'grey60', linewidth = 0.5) +
  95. ggtitle("NAcc cue responses", "Split by reward type") +
  96. ylab(label = 'Trial residuals') +
  97. xlab(label = 'Group')
  98. pF1b <-
  99. ggplot(aes(x = fBMI,y = Cue_NAcc, fill = fBMI), data=dT) +
  100. stat_halfeye(size = 5, alpha = 0.8) +
  101. scale_fill_manual(guide = guide_legend(title="Group"),values = c('#E3D0D8','#aea3b0','#827081')) +
  102. scale_x_discrete(labels = c("Normal", "Over-\nweight","Obese")) +
  103. coord_cartesian(ylim = c(-0.52, 0.52)) +
  104. theme(text = element_text(face = 'bold',size = 12.0),axis.text = element_text(face = 'plain',size = 12.0),
  105. axis.text.x = element_text(size = 11.0), legend.position = 'none',
  106. strip.text.x = element_text(margin = margin(0.10,0,0.10,0, "cm")))+
  107. facet_grid(fMoney ~ .) +
  108. geom_hline(yintercept = 0, color = 'grey60', linewidth = 0.5) +
  109. ylab(label = 'Trial residuals') +
  110. xlab(label = 'BMI cat')
  111. pF1c <-
  112. ggplot(aes(x = fTFEQ_Dis,y = Cue_NAcc, fill = fTFEQ_Dis), data=dT) +
  113. stat_halfeye(size = 5, alpha = 0.8) +
  114. scale_fill_manual(guide = guide_legend(title="Group"),values = c('#2AFC98','#16C172','#214F4B')) +
  115. coord_cartesian(ylim = c(-0.52, 0.52)) +
  116. theme(text = element_text(face = 'bold',size = 12.0),axis.text = element_text(face = 'plain',size = 12.0),
  117. axis.text.x = element_text(size = 11.0), legend.position = 'none',
  118. strip.text.x = element_text(margin = margin(0.10,0,0.10,0, "cm")))+
  119. facet_grid(fMoney ~ .) +
  120. geom_hline(yintercept = 0, color = 'grey60', linewidth = 0.5) +
  121. ylab(label = 'Trial residuals') +
  122. xlab(label = 'TFEQ Disinhibition')
  123. pF1d <-
  124. ggplot(aes(y = as.factor(rBMI),x = Cue_NAcc, fill = fBinge), data=dT) +
  125. #stat_halfeye(size = 5, alpha = 0.8) +
  126. geom_density_ridges(rel_min_height = 0.005, scale = 7, alpha = 0.75, color = 'grey80') +
  127. scale_fill_manual(guide = guide_legend(title="Group"),values = c('#86c8f7','#4a87af','#004c6d')) +
  128. coord_cartesian(xlim = c(-0.52, 0.52)) +
  129. theme(text = element_text(face = 'bold',size = 12.0),axis.text = element_text(face = 'plain',size = 12.0),
  130. axis.text.x = element_text(size = 11.0), axis.text.y=element_blank(),
  131. axis.ticks.y=element_blank(), strip.text.x = element_text(margin = margin(0.10,0,0.10,0, "cm")),
  132. plot.title = element_text(size = 13, hjust = 0.5, margin=margin(0,0,40,0)),
  133. legend.position = 'none', legend.key.width = unit(1.5, 'cm'),) +
  134. facet_grid(. ~ fBinge) +
  135. geom_vline(xintercept = 0, color = 'grey60', linewidth = 0.5) +
  136. ggtitle('Variability of NAcc cue responses', '') +
  137. xlab(label = 'Trial residuals') +
  138. ylab(label = 'ID [ranked by BMI]')
  139. p1x <- plot_grid(pF1a, pF1b, pF1c, labels = c("b", "c", "d"), label_size = 12,
  140. ncol=1, rel_heights = c(1.2, 1, 1), align = "v", axis = 1)
  141. p1 <- plot_grid(pF1d, p1x, labels = c("a", ""), label_size = 12,
  142. ncol=2, rel_widths = c(1.25, 1), align = "v", axis = 1)
  143. ggsave("../../Plots/TUE002_EAT_NAccVAR.png",
  144. plot = p1, height = 8, width = 6.5, units = "in", dpi = 600, bg = "white")
  145. #Figure 4 dlpfc
  146. ci_data_Binge <- dT %>%
  147. group_by(fBinge, fMoney) %>%
  148. median_qi(Cue_DLPFC, .width = 0.95) %>%
  149. filter(fBinge=="No BE")
  150. ci_data_BMI <- dT %>%
  151. group_by(fBMI, fMoney) %>%
  152. median_qi(Cue_DLPFC, .width = 0.95) %>%
  153. filter(fBMI=="Normal")
  154. ci_data_TFEQ <- dT %>%
  155. group_by(fTFEQ_Dis, fMoney) %>%
  156. median_qi(Cue_DLPFC, .width = 0.95) %>%
  157. filter(fTFEQ_Dis=="Low")
  158. pF2a <-
  159. ggplot(aes(x = fBinge,y = Cue_DLPFC, fill = fBinge), data=dT) +
  160. stat_halfeye(size = 5, alpha = 0.8) +
  161. scale_fill_manual(guide = guide_legend(title="Group"),values = c('#86c8f7','#4a87af','#004c6d')) +
  162. geom_hline(data = ci_data_Binge, aes(yintercept = .lower), color = "black", linetype = "dashed", alpha = .5) +
  163. geom_hline(data = ci_data_Binge, aes(yintercept = .upper), color = "black", linetype = "dashed", alpha = .5) +
  164. coord_cartesian(ylim = c(-0.7, 0.7)) +
  165. theme(text = element_text(face = 'bold',size = 12.0),axis.text = element_text(face = 'plain',size = 12.0),
  166. axis.text.x = element_text(size = 12.0), strip.text.x = element_text(margin = margin(0.15,0,0.15,0, "cm")))+
  167. facet_grid(. ~ fMoney) +
  168. geom_hline(yintercept = 0, color = 'grey60', linewidth = 0.5) +
  169. ylab(label = 'Variability\ncue responses') +
  170. xlab(label = 'Group')
  171. pF2b <-
  172. ggplot(aes(x = fBMI,y = Cue_DLPFC, fill = fBMI), data=dT) +
  173. stat_halfeye(size = 5, alpha = 0.8) +
  174. scale_fill_manual(guide = guide_legend(title="Group"),values = c('#E3D0D8','#aea3b0','#827081')) +
  175. geom_hline(data = ci_data_BMI, aes(yintercept = .lower), color = "black", linetype = "dashed", alpha = .5) +
  176. geom_hline(data = ci_data_BMI, aes(yintercept = .upper), color = "black", linetype = "dashed", alpha = .5) +
  177. coord_cartesian(ylim = c(-0.7, 0.7)) +
  178. scale_x_discrete(labels = c("Normal", "Over-\nweight","Obese")) +
  179. theme(text = element_text(face = 'bold',size = 12.0),axis.text = element_text(face = 'plain',size = 12.0),
  180. axis.text.x = element_text(size = 12.0), strip.text.x = element_text(margin = margin(0.15,0,0.15,0, "cm")))+
  181. facet_grid(. ~ fMoney) +
  182. geom_hline(yintercept = 0, color = 'grey60', linewidth = 0.5) +
  183. ylab(label = 'Variability\ncue responses') +
  184. xlab(label = 'BMI category')
  185. pF2c <-
  186. ggplot(aes(x = fTFEQ_Dis,y = Cue_DLPFC, fill = fTFEQ_Dis), data=dT) +
  187. stat_halfeye(size = 5, alpha = 0.8) +
  188. scale_fill_manual(guide = guide_legend(title="Group"),values = c('#2AFC98','#16C172','#214F4B')) +
  189. geom_hline(data = ci_data_TFEQ, aes(yintercept = .lower), color = "black", linetype = "dashed", alpha = .5) +
  190. geom_hline(data = ci_data_TFEQ, aes(yintercept = .upper), color = "black", linetype = "dashed", alpha = .5) +
  191. coord_cartesian(ylim = c(-0.7, 0.7)) +
  192. theme(text = element_text(face = 'bold',size = 12.0),axis.text = element_text(face = 'plain',size = 12.0),
  193. axis.text.x = element_text(size = 12.0), strip.text.x = element_text(margin = margin(0.15,0,0.15,0, "cm")))+
  194. facet_grid(. ~ fMoney) +
  195. geom_hline(yintercept = 0, color = 'grey60', linewidth = 0.5) +
  196. ylab(label = 'Variability\ncue responses') +
  197. xlab(label = 'TFEQ Disinhibition')
  198. p2x <- plot_grid(pF2a, pF2b, pF2c, labels = c("a", "b", "c"), label_size = 12,
  199. ncol=1, rel_heights = c(1.2, 1, 1), align = "v", axis = 1)
  200. ggsave("../../Plots/TUE002_EAT_DLPFCVAR.png",
  201. plot = p2x, height = 8, width = 6.5, units = "in", dpi = 600, bg = "white")
  202. #brms
  203. b1.10a <-
  204. brm(data = dT,
  205. family = gaussian,
  206. bf(Cue_NAcc ~ 1 + (1 |i| ID),
  207. sigma ~ 1 + (fBinge + zBMI) * fMoney * cRewM + (1 + fMoney + cRewM |i| ID)),
  208. prior = c(prior(normal(0, 0.2), class = Intercept),
  209. prior(normal(0, 1), class = Intercept, dpar = sigma),
  210. prior(normal(0, 0.2), class = b, dpar = sigma),
  211. prior(exponential(1), class = sd, dpar = sigma),
  212. prior(lkj(2), class = cor)),
  213. iter = 5000, warmup = 2000, chains = 4, cores = 4,
  214. seed = 14,
  215. sample_prior = TRUE,
  216. file = "/mnt/big_data/SynologyDrive/Paper/drafts/TUE002_EATVAR/analysis/brms_AK/b1.Cue_NAcc")
  217. b1.10b <-
  218. brm(data = dT,
  219. family = gaussian,
  220. bf(Cue_NAcc ~ 1 + (1 |i| ID),
  221. sigma ~ 1 + (fBinge + zBMI) * fMoney * cRewM + std_Cue_aMTL + (1 + fMoney + cRewM |i| ID)),
  222. prior = c(prior(normal(0, 0.2), class = Intercept),
  223. prior(normal(0, 1), class = Intercept, dpar = sigma),
  224. prior(normal(0, 0.2), class = b, dpar = sigma),
  225. prior(exponential(1), class = sd, dpar = sigma),
  226. prior(lkj(2), class = cor)),
  227. iter = 5000, warmup = 2000, chains = 4, cores = 4,
  228. seed = 14,
  229. sample_prior = TRUE,
  230. file = "/mnt/big_data/SynologyDrive/Paper/drafts/TUE002_EATVAR/analysis/brms_AK/b1.Cue_NAcc_aMTL_DVARS")
  231. b1.10bb <-
  232. brm(data = dT,
  233. family = gaussian,
  234. bf(Cue_NAcc ~ 1 + (1 |i| ID),
  235. sigma ~ 1 + (fBinge + zBMI) * fMoney * cRewM + std_Cue_aMTL + log_FD + (1 + fMoney + cRewM |i| ID)),
  236. prior = c(prior(normal(0, 0.2), class = Intercept),
  237. prior(normal(0, 1), class = Intercept, dpar = sigma),
  238. prior(normal(0, 0.2), class = b, dpar = sigma),
  239. prior(exponential(1), class = sd, dpar = sigma),
  240. prior(lkj(2), class = cor)),
  241. iter = 5000, warmup = 2000, chains = 4, cores = 4,
  242. seed = 14,
  243. sample_prior = TRUE,
  244. file = "/mnt/big_data/SynologyDrive/Paper/drafts/TUE002_EATVAR/analysis/brms_AK/b1.Cue_NAcc_moremvmt_aMTL_logFD")
  245. b1.10da<-
  246. brm(data = dT_fb,
  247. family = gaussian,
  248. bf(Feedback_NAcc ~ 1 + (1 |i| ID),
  249. sigma ~ 1 + (fBinge + zBMI) * fMoney * cRewM + std_Cue_aMTL + (1 + fMoney + cRewM |i| ID)),
  250. prior = c(prior(normal(0, 0.2), class = Intercept),
  251. prior(normal(0, 1), class = Intercept, dpar = sigma),
  252. prior(normal(0, 0.2), class = b, dpar = sigma),
  253. prior(exponential(1), class = sd, dpar = sigma),
  254. prior(lkj(2), class = cor)),
  255. iter = 5000, warmup = 2000, chains = 4, cores = 4,
  256. seed = 14,
  257. sample_prior = TRUE,
  258. file = "/mnt/big_data/SynologyDrive/Paper/drafts/TUE002_EATVAR/analysis/brms_AK/b1.Feedback_NAcc_moremvmt_aMTL")
  259. b1.10d<-
  260. brm(data = dT_fb,
  261. family = gaussian,
  262. bf(Feedback_NAcc ~ 1 + (1 |i| ID),
  263. sigma ~ 1 + (fBinge + zBMI) * fMoney * cRewM + std_Cue_aMTL + log_FD + (1 + fMoney + cRewM |i| ID)),
  264. prior = c(prior(normal(0, 0.2), class = Intercept),
  265. prior(normal(0, 1), class = Intercept, dpar = sigma),
  266. prior(normal(0, 0.2), class = b, dpar = sigma),
  267. prior(exponential(1), class = sd, dpar = sigma),
  268. prior(lkj(2), class = cor)),
  269. iter = 5000, warmup = 2000, chains = 4, cores = 4,
  270. seed = 14,
  271. sample_prior = TRUE,
  272. file = "/mnt/big_data/SynologyDrive/Paper/drafts/TUE002_EATVAR/analysis/brms_AK/b1.Feedback_NAcc_moremvmt_aMTL_logFD")
  273. dT_Unc <- filter(dT, Uncertainty ==1)
  274. dT_Cer <- filter(dT, Uncertainty ==0)
  275. b1.2a <-
  276. brm(data = dT_Unc,
  277. family = gaussian,
  278. bf(Cue_NAcc ~ 1 + (1 |i| ID),
  279. sigma ~ 1 + (fBinge + zBMI) * fMoney * cRewM + (1 + fMoney + cRewM |i| ID)),
  280. prior = c(prior(normal(0, 0.2), class = Intercept),
  281. prior(normal(0, 1), class = Intercept, dpar = sigma),
  282. prior(normal(0, 0.2), class = b, dpar = sigma),
  283. prior(exponential(1), class = sd, dpar = sigma),
  284. prior(lkj(2), class = cor)),
  285. iter = 4000, warmup = 800, chains = 4, cores = 4,
  286. seed = 14,
  287. sample_prior = TRUE,
  288. file = "/mnt/big_data/SynologyDrive/Paper/drafts/TUE002_EATVAR/analysis/brms_AK/b1.Cue_NAcc_Unc")
  289. b1.2a <-
  290. brm(data = dT_Unc,
  291. family = gaussian,
  292. bf(Cue_NAcc ~ 1 + (1 |i| ID),
  293. sigma ~ 1 + (fBinge + zBMI) * fMoney * cRewM + std_Cue_aMTL + (1 + fMoney + cRewM |i| ID)),
  294. prior = c(prior(normal(0, 0.2), class = Intercept),
  295. prior(normal(0, 1), class = Intercept, dpar = sigma),
  296. prior(normal(0, 0.2), class = b, dpar = sigma),
  297. prior(exponential(1), class = sd, dpar = sigma),
  298. prior(lkj(2), class = cor)),
  299. iter = 4000, warmup = 800, chains = 4, cores = 4,
  300. seed = 14,
  301. sample_prior = TRUE,
  302. file = "/mnt/big_data/SynologyDrive/Paper/drafts/TUE002_EATVAR/analysis/brms_AK/b1.Cue_NAcc_Unc_aMTL")
  303. b1.3 <-
  304. brm(data = dT_Cer,
  305. family = gaussian,
  306. bf(Cue_NAcc ~ 1 + (1 |i| ID),
  307. sigma ~ 1 + (fBinge + zBMI) * fMoney * cRewM + scale(SD_resRelEff) + scale(SD_resR_Want) + (1 + fMoney + cRewM |i| ID)),
  308. prior = c(prior(normal(0, 0.2), class = Intercept),
  309. prior(normal(0, 1), class = Intercept, dpar = sigma),
  310. prior(normal(0, 0.2), class = b, dpar = sigma),
  311. prior(exponential(1), class = sd, dpar = sigma),
  312. prior(lkj(2), class = cor)),
  313. iter = 4000, warmup = 800, chains = 4, cores = 4,
  314. seed = 14,
  315. sample_prior = TRUE,
  316. file = "/mnt/big_data/SynologyDrive/Paper/drafts/TUE002_EATVAR/analysis/brms_AK/b1.Cue_NAcc_Cer_SDz")
  317. b1.7 <-
  318. brm(data = dT_fb,
  319. family = gaussian,
  320. bf(Feedback_NAcc ~ 1 + (1 |i| ID),
  321. sigma ~ 1 + (fTFEQ_Dis + zBMI) * fMoney * cRewM + (1 + fMoney + cRewM |i| ID)),
  322. prior = c(prior(normal(0, 0.2), class = Intercept),
  323. prior(normal(0, 1), class = Intercept, dpar = sigma),
  324. prior(normal(0, 0.2), class = b, dpar = sigma),
  325. prior(exponential(1), class = sd, dpar = sigma),
  326. prior(lkj(2), class = cor)),
  327. iter = 4000, warmup = 800, chains = 4, cores = 4,
  328. seed = 14,
  329. sample_prior = TRUE,
  330. file = "/mnt/big_data/SynologyDrive/Paper/drafts/TUE002_EATVAR/analysis/brms_AK/b1.Feedback_NAcc_fDis")
  331. b1.7a <-
  332. brm(data = dT_fb,
  333. family = gaussian,
  334. bf(Feedback_NAcc ~ 1 + (1 |i| ID),
  335. sigma ~ 1 + (fTFEQ_Dis + zBMI) * fMoney * cRewM + std_Cue_aMTL + (1 + fMoney + cRewM |i| ID)),
  336. prior = c(prior(normal(0, 0.2), class = Intercept),
  337. prior(normal(0, 1), class = Intercept, dpar = sigma),
  338. prior(normal(0, 0.2), class = b, dpar = sigma),
  339. prior(exponential(1), class = sd, dpar = sigma),
  340. prior(lkj(2), class = cor)),
  341. iter = 4000, warmup = 800, chains = 4, cores = 4,
  342. seed = 14,
  343. sample_prior = TRUE,
  344. file = "/mnt/big_data/SynologyDrive/Paper/drafts/TUE002_EATVAR/analysis/brms_AK/b1.Feedback_NAcc_fDis_aMTL")
  345. b1.7b <-
  346. brm(data = dT_fb,
  347. family = gaussian,
  348. bf(Feedback_NAcc ~ 1 + (1 |i| ID),
  349. sigma ~ 1 + (fTFEQ_Dis + zBMI) * fMoney * cRewM + std_Cue_aMTL + logFD + (1 + fMoney + cRewM |i| ID)),
  350. prior = c(prior(normal(0, 0.2), class = Intercept),
  351. prior(normal(0, 1), class = Intercept, dpar = sigma),
  352. prior(normal(0, 0.2), class = b, dpar = sigma),
  353. prior(exponential(1), class = sd, dpar = sigma),
  354. prior(lkj(2), class = cor)),
  355. iter = 4000, warmup = 800, chains = 4, cores = 4,
  356. seed = 14,
  357. sample_prior = TRUE,
  358. file = "/mnt/big_data/SynologyDrive/Paper/drafts/TUE002_EATVAR/analysis/brms_AK/b1.Feedback_NAcc_fDis_aMTL_logFD")
  359. b1.8 <-
  360. brm(data = dT_Unc,
  361. family = gaussian,
  362. bf(Cue_NAcc ~ 1 + (1 |i| ID),
  363. sigma ~ 1 + (fTFEQ_Dis + zBMI) * fMoney * cRewM +std_Cue_aMTL + (1 + fMoney + cRewM |i| ID)),
  364. prior = c(prior(normal(0, 0.2), class = Intercept),
  365. prior(normal(0, 1), class = Intercept, dpar = sigma),
  366. prior(normal(0, 0.2), class = b, dpar = sigma),
  367. prior(exponential(1), class = sd, dpar = sigma),
  368. prior(lkj(2), class = cor)),
  369. iter = 4000, warmup = 800, chains = 4, cores = 4,
  370. seed = 14,
  371. sample_prior = TRUE,
  372. file = "/mnt/big_data/SynologyDrive/Paper/drafts/TUE002_EATVAR/analysis/brms_AK/b1.Cue_NAcc_fDis_Unc_aMTL")
  373. print(summary(b1.8), digits = 3)
  374. b1.9 <-
  375. brm(data = dT_Cer,
  376. family = gaussian,
  377. bf(Cue_NAcc ~ 1 + (1 |i| ID),
  378. sigma ~ 1 + (fTFEQ_Dis + zBMI) * fMoney * cRewM +std_Cue_aMTL + (1 + fMoney + cRewM |i| ID)),
  379. prior = c(prior(normal(0, 0.2), class = Intercept),
  380. prior(normal(0, 1), class = Intercept, dpar = sigma),
  381. prior(normal(0, 0.2), class = b, dpar = sigma),
  382. prior(exponential(1), class = sd, dpar = sigma),
  383. prior(lkj(2), class = cor)),
  384. iter = 4000, warmup = 800, chains = 4, cores = 4,
  385. seed = 14,
  386. sample_prior = TRUE,
  387. file = "/mnt/big_data/SynologyDrive/Paper/drafts/TUE002_EATVAR/analysis/brms_AK/b1.Cue_NAcc_fDis_Cer_aMTL")
  388. print(summary(b1.9), digits = 3)
  389. b2.0 <-
  390. brm(data = dT,
  391. family = gaussian,
  392. bf(Cue_DLPFC ~ 1 + (1 |i| ID),
  393. sigma ~ 1 + (fBinge + zBMI) * fMoney * cRewM + log_FD + (1 + fMoney + cRewM |i| ID)),
  394. prior = c(prior(normal(0, 0.2), class = Intercept),
  395. prior(normal(0, 1), class = Intercept, dpar = sigma),
  396. prior(normal(0, 0.2), class = b, dpar = sigma),
  397. prior(exponential(1), class = sd, dpar = sigma),
  398. prior(lkj(2), class = cor)),
  399. iter = 4000, warmup = 800, chains = 4, cores = 4,
  400. seed = 14,
  401. sample_prior = TRUE,
  402. file = "/mnt/big_data/SynologyDrive/Paper/drafts/TUE002_EATVAR/analysis/brms_AK/b1.Cue_DLPFC_aMTL")
  403. b2.0a <-
  404. brm(data = dT,
  405. family = gaussian,
  406. bf(Cue_DLPFC ~ 1 + (1 |i| ID),
  407. sigma ~ 1 + (fBinge + zBMI) * fMoney * cRewM + lstd_Cue_aMTL + (1 + fMoney + cRewM |i| ID)),
  408. prior = c(prior(normal(0, 0.2), class = Intercept),
  409. prior(normal(0, 1), class = Intercept, dpar = sigma),
  410. prior(normal(0, 0.2), class = b, dpar = sigma),
  411. prior(exponential(1), class = sd, dpar = sigma),
  412. prior(lkj(2), class = cor)),
  413. iter = 4000, warmup = 800, chains = 4, cores = 4,
  414. seed = 14,
  415. sample_prior = TRUE,
  416. file = "/mnt/big_data/SynologyDrive/Paper/drafts/TUE002_EATVAR/analysis/brms_AK/b1.Cue_DLPFC_aMTL")
  417. b2.0b <-
  418. brm(data = dT,
  419. family = gaussian,
  420. bf(Cue_DLPFC ~ 1 + (1 |i| ID),
  421. sigma ~ 1 + (fBinge + zBMI) * fMoney * cRewM + log_FD +std_Cue_aMTL + (1 + fMoney + cRewM |i| ID)),
  422. prior = c(prior(normal(0, 0.2), class = Intercept),
  423. prior(normal(0, 1), class = Intercept, dpar = sigma),
  424. prior(normal(0, 0.2), class = b, dpar = sigma),
  425. prior(exponential(1), class = sd, dpar = sigma),
  426. prior(lkj(2), class = cor)),
  427. iter = 4000, warmup = 800, chains = 4, cores = 4,
  428. seed = 14,
  429. sample_prior = TRUE,
  430. file = "/mnt/big_data/SynologyDrive/Paper/drafts/TUE002_EATVAR/analysis/brms_AK/b1.Cue_DLPFC_aMTL_logFD")
  431. print(summary(b2.0), digits = 3)
  432. b2.1 <-
  433. brm(data = dT,
  434. family = gaussian,
  435. bf(Cue_DLPFC ~ 1 + (1 |i| ID),
  436. sigma ~ 1 + (fBinge + zBMI) * fMoney * cRewM + scale(SD_resRelEff) + scale(SD_resR_Want) + (1 + fMoney + cRewM |i| ID)),
  437. prior = c(prior(normal(0, 0.2), class = Intercept),
  438. prior(normal(0, 1), class = Intercept, dpar = sigma),
  439. prior(normal(0, 0.2), class = b, dpar = sigma),
  440. prior(exponential(1), class = sd, dpar = sigma),
  441. prior(lkj(2), class = cor)),
  442. iter = 4000, warmup = 800, chains = 4, cores = 4,
  443. seed = 14,
  444. sample_prior = TRUE,
  445. file = "/mnt/big_data/SynologyDrive/Paper/drafts/TUE002_EATVAR/analysis/brms_AK/b1.Cue_DLPFC_SDz")
  446. print(summary(b2.1), digits = 3)
  447. b2.2 <-
  448. brm(data = dT_Unc,
  449. family = gaussian,
  450. bf(Cue_DLPFC ~ 1 + (1 |i| ID),
  451. sigma ~ 1 + (fBinge + zBMI) * fMoney * cRewM + (1 + fMoney + cRewM |i| ID)),
  452. prior = c(prior(normal(0, 0.2), class = Intercept),
  453. prior(normal(0, 1), class = Intercept, dpar = sigma),
  454. prior(normal(0, 0.2), class = b, dpar = sigma),
  455. prior(exponential(1), class = sd, dpar = sigma),
  456. prior(lkj(2), class = cor)),
  457. iter = 4000, warmup = 800, chains = 4, cores = 4,
  458. seed = 14,
  459. sample_prior = TRUE,
  460. file = "/mnt/big_data/SynologyDrive/Paper/drafts/TUE002_EATVAR/analysis/brms_AK/b1.Cue_DLPFC_Unc")
  461. print(summary(b2.2), digits = 3)
  462. b2.3 <-
  463. brm(data = dT_Cer,
  464. family = gaussian,
  465. bf(Cue_DLPFC ~ 1 + (1 |i| ID),
  466. sigma ~ 1 + (fBinge + zBMI) * fMoney * cRewM + (1 + fMoney + cRewM |i| ID)),
  467. prior = c(prior(normal(0, 0.2), class = Intercept),
  468. prior(normal(0, 1), class = Intercept, dpar = sigma),
  469. prior(normal(0, 0.2), class = b, dpar = sigma),
  470. prior(exponential(1), class = sd, dpar = sigma),
  471. prior(lkj(2), class = cor)),
  472. iter = 4000, warmup = 800, chains = 4, cores = 4,
  473. seed = 14,
  474. sample_prior = TRUE,
  475. file = "/mnt/big_data/SynologyDrive/Paper/drafts/TUE002_EATVAR/analysis/brms_AK/b1.Cue_DLPFC_Cer")
  476. print(summary(b2.3), digits = 3)
  477. b2.7 <-
  478. brm(data = dT,
  479. family = gaussian,
  480. bf(Cue_DLPFC ~ 1 + (1 |i| ID),
  481. sigma ~ 1 + (fTFEQ_Dis + zBMI) * fMoney * cRewM + (1 + fMoney + cRewM |i| ID)),
  482. prior = c(prior(normal(0, 0.2), class = Intercept),
  483. prior(normal(0, 1), class = Intercept, dpar = sigma),
  484. prior(normal(0, 0.2), class = b, dpar = sigma),
  485. prior(exponential(1), class = sd, dpar = sigma),
  486. prior(lkj(2), class = cor)),
  487. iter = 4000, warmup = 800, chains = 4, cores = 4,
  488. seed = 14,
  489. sample_prior = TRUE,
  490. file = "/mnt/big_data/SynologyDrive/Paper/drafts/TUE002_EATVAR/analysis/brms_AK/b1.Cue_DLPFC_fDisL")
  491. b2.7a <-
  492. brm(data = dT,
  493. family = gaussian,
  494. bf(Cue_DLPFC ~ 1 + (1 |i| ID),
  495. sigma ~ 1 + (fTFEQ_Dis + zBMI) * fMoney * cRewM +std_Cue_aMTL + (1 + fMoney + cRewM |i| ID)),
  496. prior = c(prior(normal(0, 0.2), class = Intercept),
  497. prior(normal(0, 1), class = Intercept, dpar = sigma),
  498. prior(normal(0, 0.2), class = b, dpar = sigma),
  499. prior(exponential(1), class = sd, dpar = sigma),
  500. prior(lkj(2), class = cor)),
  501. iter = 4000, warmup = 800, chains = 4, cores = 4,
  502. seed = 14,
  503. sample_prior = TRUE,
  504. file = "/mnt/big_data/SynologyDrive/Paper/drafts/TUE002_EATVAR/analysis/brms_AK/b1.Cue_DLPFC_fDis_aMTL")
  505. print(summary(b2.7), digits = 3)
  506. b3.1 <-
  507. brm(data = dT,
  508. family = gaussian,
  509. bf(Cue_toMTL ~ 1 + (1 |i| ID),
  510. sigma ~ 1 + (fBinge + zBMI) * fMoney * cRewM + (1 + fMoney + cRewM |i| ID)),
  511. prior = c(prior(normal(0, 0.2), class = Intercept),
  512. prior(normal(0, 1), class = Intercept, dpar = sigma),
  513. prior(normal(0, 0.2), class = b, dpar = sigma),
  514. prior(exponential(1), class = sd, dpar = sigma),
  515. prior(lkj(2), class = cor)),
  516. iter = 4000, warmup = 800, chains = 4, cores = 4,
  517. seed = 14,
  518. sample_prior = TRUE,
  519. file = "/mnt/big_data/SynologyDrive/Paper/drafts/TUE002_EATVAR/analysis/brms_AK/b1.Cue_toMTL")
  520. print(summary(b3.1), digits = 3)
  521. b4.1 <-
  522. brm(data = dT,
  523. family = gaussian,
  524. bf(Cue_aMTL ~ 1 + (1 |i| ID),
  525. sigma ~ 1 + (fBinge + zBMI) * fMoney * cRewM + (1 + fMoney + cRewM |i| ID)),
  526. prior = c(prior(normal(0, 0.2), class = Intercept),
  527. prior(normal(0, 1), class = Intercept, dpar = sigma),
  528. prior(normal(0, 0.2), class = b, dpar = sigma),
  529. prior(exponential(1), class = sd, dpar = sigma),
  530. prior(lkj(2), class = cor)),
  531. iter = 4000, warmup = 800, chains = 4, cores = 4,
  532. seed = 14,
  533. sample_prior = TRUE,
  534. file = "/mnt/big_data/SynologyDrive/Paper/drafts/TUE002_EATVAR/analysis/brms_AK/b1.Cue_aMTL")
  535. print(summary(b4.1), digits = 3)
  536. b5.1 <-
  537. brm(data = dT,
  538. family = gaussian,
  539. bf(Cue_pMTL ~ 1 + (1 |i| ID),
  540. sigma ~ 1 + (fBinge + zBMI) * fMoney * cRewM + (1 + fMoney + cRewM |i| ID)),
  541. prior = c(prior(normal(0, 0.2), class = Intercept),
  542. prior(normal(0, 1), class = Intercept, dpar = sigma),
  543. prior(normal(0, 0.2), class = b, dpar = sigma),
  544. prior(exponential(1), class = sd, dpar = sigma),
  545. prior(lkj(2), class = cor)),
  546. iter = 4000, warmup = 800, chains = 4, cores = 4,
  547. seed = 14,
  548. sample_prior = TRUE,
  549. file = "/mnt/big_data/SynologyDrive/Paper/drafts/TUE002_EATVAR/analysis/brms_AK/b1.Cue_pMTL")
  550. print(summary(b5.1), digits = 3)
  551. b3.2 <-
  552. brm(data = dT_Cer,
  553. family = gaussian,
  554. bf(Cue_toMTL ~ 1 + (1 |i| ID),
  555. sigma ~ 1 + (fBinge + zBMI) * fMoney * cRewM + (1 + fMoney + cRewM |i| ID)),
  556. prior = c(prior(normal(0, 0.2), class = Intercept),
  557. prior(normal(0, 1), class = Intercept, dpar = sigma),
  558. prior(normal(0, 0.2), class = b, dpar = sigma),
  559. prior(exponential(1), class = sd, dpar = sigma),
  560. prior(lkj(2), class = cor)),
  561. iter = 4000, warmup = 800, chains = 4, cores = 4,
  562. seed = 14,
  563. sample_prior = TRUE,
  564. file = "/mnt/big_data/SynologyDrive/Paper/drafts/TUE002_EATVAR/analysis/brms_AK/b1.Cue_toMTL_Cer")
  565. print(summary(b3.2), digits = 3)
  566. b4.2 <-
  567. brm(data = dT_Cer,
  568. family = gaussian,
  569. bf(Cue_aMTL ~ 1 + (1 |i| ID),
  570. sigma ~ 1 + (fBinge + zBMI) * fMoney * cRewM + (1 + fMoney + cRewM |i| ID)),
  571. prior = c(prior(normal(0, 0.2), class = Intercept),
  572. prior(normal(0, 1), class = Intercept, dpar = sigma),
  573. prior(normal(0, 0.2), class = b, dpar = sigma),
  574. prior(exponential(1), class = sd, dpar = sigma),
  575. prior(lkj(2), class = cor)),
  576. iter = 4000, warmup = 800, chains = 4, cores = 4,
  577. seed = 14,
  578. sample_prior = TRUE,
  579. file = "/mnt/big_data/SynologyDrive/Paper/drafts/TUE002_EATVAR/analysis/brms_AK/b1.Cue_aMTL_Cer")
  580. print(summary(b4.2), digits = 3)
  581. b5.2 <-
  582. brm(data = dT_Cer,
  583. family = gaussian,
  584. bf(Cue_pMTL ~ 1 + (1 |i| ID),
  585. sigma ~ 1 + (fBinge + zBMI) * fMoney * cRewM + (1 + fMoney + cRewM |i| ID)),
  586. prior = c(prior(normal(0, 0.2), class = Intercept),
  587. prior(normal(0, 1), class = Intercept, dpar = sigma),
  588. prior(normal(0, 0.2), class = b, dpar = sigma),
  589. prior(exponential(1), class = sd, dpar = sigma),
  590. prior(lkj(2), class = cor)),
  591. iter = 4000, warmup = 800, chains = 4, cores = 4,
  592. seed = 14,
  593. sample_prior = TRUE,
  594. file = "/mnt/big_data/SynologyDrive/Paper/drafts/TUE002_EATVAR/analysis/brms_AK/b1.Cue_pMTL_Cer")
  595. print(summary(b5.2), digits = 3)
  596. b3.3 <-
  597. brm(data = dT_Unc,
  598. family = gaussian,
  599. bf(Cue_toMTL ~ 1 + (1 |i| ID),
  600. sigma ~ 1 + (fBinge + zBMI) * fMoney * cRewM + (1 + fMoney + cRewM |i| ID)),
  601. prior = c(prior(normal(0, 0.2), class = Intercept),
  602. prior(normal(0, 1), class = Intercept, dpar = sigma),
  603. prior(normal(0, 0.2), class = b, dpar = sigma),
  604. prior(exponential(1), class = sd, dpar = sigma),
  605. prior(lkj(2), class = cor)),
  606. iter = 4000, warmup = 800, chains = 4, cores = 4,
  607. seed = 14,
  608. sample_prior = TRUE,
  609. file = "/mnt/big_data/SynologyDrive/Paper/drafts/TUE002_EATVAR/analysis/brms_AK/b1.Cue_toMTL_Unc")
  610. print(summary(b3.3), digits = 3)
  611. b4.3 <-
  612. brm(data = dT_Unc,
  613. family = gaussian,
  614. bf(Cue_aMTL ~ 1 + (1 |i| ID),
  615. sigma ~ 1 + (fBinge + zBMI) * fMoney * cRewM + (1 + fMoney + cRewM |i| ID)),
  616. prior = c(prior(normal(0, 0.2), class = Intercept),
  617. prior(normal(0, 1), class = Intercept, dpar = sigma),
  618. prior(normal(0, 0.2), class = b, dpar = sigma),
  619. prior(exponential(1), class = sd, dpar = sigma),
  620. prior(lkj(2), class = cor)),
  621. iter = 4000, warmup = 800, chains = 4, cores = 4,
  622. seed = 14,
  623. sample_prior = TRUE,
  624. file = "/mnt/big_data/SynologyDrive/Paper/drafts/TUE002_EATVAR/analysis/brms_AK/b1.Cue_aMTL_Unc")
  625. print(summary(b4.3), digits = 3)
  626. b5.3 <-
  627. brm(data = dT_Unc,
  628. family = gaussian,
  629. bf(Cue_pMTL ~ 1 + (1 |i| ID),
  630. sigma ~ 1 + (fBinge + zBMI) * fMoney * cRewM + (1 + fMoney + cRewM |i| ID)),
  631. prior = c(prior(normal(0, 0.2), class = Intercept),
  632. prior(normal(0, 1), class = Intercept, dpar = sigma),
  633. prior(normal(0, 0.2), class = b, dpar = sigma),
  634. prior(exponential(1), class = sd, dpar = sigma),
  635. prior(lkj(2), class = cor)),
  636. iter = 4000, warmup = 800, chains = 4, cores = 4,
  637. seed = 14,
  638. sample_prior = TRUE,
  639. file = "/mnt/big_data/SynologyDrive/Paper/drafts/TUE002_EATVAR/analysis/brms_AK/b1.Cue_pMTL_Unc")
  640. print(summary(b5.3), digits = 3)
  641. #Behavioral data analysis variance ratio tests
  642. dEAT_S1U <- dT_S1_Unc
  643. n_boot <- 1000
  644. unique_ids <- unique(dEAT_S1U$ID)
  645. conditions <- unique(dEAT_S1U$Money)
  646. group_id_list <- dEAT_S1U %>%
  647. distinct(ID, fBinge) %>%
  648. group_split(fBinge)
  649. #Wanting
  650. # Step 1: Compute observed variance ratios (Group C vs A)
  651. observed_variances <- dEAT_S1U %>%
  652. group_by(fBinge, Money) %>%
  653. summarise(Variance = var(resR_Want), .groups = "drop")
  654. observed_ratios <- observed_variances %>%
  655. filter(fBinge %in% c("No BE", "subBED")) %>%
  656. pivot_wider(names_from = fBinge, values_from = Variance) %>%
  657. mutate(VarRatio_CvsA = subBED/`No BE`)
  658. observed_combined_variances <- dEAT_S1U %>%
  659. filter(fBinge %in% c("No BE", "subBED")) %>%
  660. group_by(fBinge) %>%
  661. summarise(Variance = var(resR_Want), .groups = "drop")
  662. observed_combined_ratio <- observed_combined_variances %>%
  663. pivot_wider(names_from = fBinge, values_from = Variance) %>%
  664. mutate(VarRatio_CvsA = subBED / `No BE`) %>%
  665. pull(VarRatio_CvsA)
  666. # Step 2: Bootstrapping
  667. #bootstrap_var_results <- vector("list", n_boot)
  668. variance_ratios <- data.frame()
  669. set.seed(123)
  670. for (i in 1:n_boot) {
  671. sampled_ids <- group_id_list %>%
  672. lapply(function(group_df) {
  673. sample(group_df$ID, size = nrow(group_df), replace = TRUE)
  674. }) %>%
  675. unlist()
  676. boot_data <- dEAT_S1U %>%
  677. semi_join(data.frame(ID = sampled_ids), by = "ID")
  678. var_summary <- boot_data %>%
  679. group_by(fBinge, Money) %>%
  680. summarise(Variance = var(resR_Want), .groups = "drop")
  681. # Calculate ratios for each Money
  682. for (cond in conditions) {
  683. var_C <- var_summary %>% filter(fBinge == "subBED", Money == cond) %>% pull(Variance)
  684. var_A <- var_summary %>% filter(fBinge == "No BE", Money == cond) %>% pull(Variance)
  685. var_ratio <- if (length(var_C) == 1 && length(var_A) == 1 && var_A != 0) var_C / var_A else NA
  686. variance_ratios <- rbind(variance_ratios, data.frame(
  687. Bootstrap = i,
  688. Money = cond,
  689. VarRatio_CvsA = var_ratio
  690. ))
  691. }
  692. boot_combined_var <- boot_data %>%
  693. filter(fBinge %in% c("No BE", "subBED")) %>%
  694. group_by(fBinge) %>%
  695. summarise(Variance = var(resR_Want), .groups = "drop")
  696. if (all(c("No BE", "subBED") %in% boot_combined_var$fBinge)) {
  697. var_C <- boot_combined_var %>% filter(fBinge == "subBED") %>% pull(Variance)
  698. var_A <- boot_combined_var %>% filter(fBinge == "No BE") %>% pull(Variance)
  699. var_ratio_combined <- ifelse(var_A != 0, var_C / var_A, NA)
  700. } else {
  701. var_ratio_combined <- NA
  702. }
  703. # Store combined ratio
  704. variance_ratios <- rbind(variance_ratios, data.frame(
  705. Bootstrap = i,
  706. Money = "Combined",
  707. VarRatio_CvsA = var_ratio_combined
  708. ))
  709. }
  710. # Step 3: Significance testing (2-sided p-values)
  711. # Function to compute 2-sided p-value
  712. two_sided_p <- function(boot_dist, obs_val) {
  713. mean(boot_dist <= 1, na.rm = TRUE)
  714. }
  715. # Individual condition p-values
  716. # Final p-value computation
  717. p_values <- variance_ratios %>%
  718. group_by(Money) %>%
  719. mutate(
  720. Observed = case_when(
  721. Money == "Combined" ~ observed_combined_ratio,
  722. TRUE ~ observed_ratios$VarRatio_CvsA[match(Money, observed_ratios$Money)]
  723. ),
  724. P_value = two_sided_p(VarRatio_CvsA, Observed)
  725. ) %>%
  726. select(Money,P_value) %>%
  727. unique()
  728. print(p_values)
  729. #effort
  730. n_boot <- 1000
  731. unique_ids <- unique(dEAT_S1U$ID)
  732. conditions <- unique(dEAT_S1U$Money)
  733. group_id_list <- dEAT_S1U %>%
  734. distinct(ID, fBinge) %>%
  735. group_split(fBinge)
  736. # Step 1: Compute observed variance ratios (Group C vs A)
  737. observed_variances <- dEAT_S1U %>%
  738. group_by(fBinge, Money) %>%
  739. summarise(Variance = var(resRelEff), .groups = "drop")
  740. observed_ratios <- observed_variances %>%
  741. filter(fBinge %in% c("No BE", "subBED")) %>%
  742. pivot_wider(names_from = fBinge, values_from = Variance) %>%
  743. mutate(VarRatio_CvsA = subBED/`No BE`)
  744. observed_combined_variances <- dEAT_S1U %>%
  745. filter(fBinge %in% c("No BE", "subBED")) %>%
  746. group_by(fBinge) %>%
  747. summarise(Variance = var(resRelEff), .groups = "drop")
  748. observed_combined_ratio <- observed_combined_variances %>%
  749. pivot_wider(names_from = fBinge, values_from = Variance) %>%
  750. mutate(VarRatio_CvsA = subBED / `No BE`) %>%
  751. pull(VarRatio_CvsA)
  752. # Step 2: Bootstrapping
  753. #bootstrap_var_results <- vector("list", n_boot)
  754. variance_ratios <- data.frame()
  755. set.seed(108)
  756. for (i in 1:n_boot) {
  757. sampled_ids <- group_id_list %>%
  758. lapply(function(group_df) {
  759. sample(group_df$ID, size = nrow(group_df), replace = TRUE)
  760. }) %>%
  761. unlist()
  762. boot_data <- dEAT_S1U %>%
  763. semi_join(data.frame(ID = sampled_ids), by = "ID")
  764. var_summary <- boot_data %>%
  765. group_by(fBinge, Money) %>%
  766. summarise(Variance = var(resRelEff), .groups = "drop")
  767. # Calculate ratios for each Money
  768. for (cond in conditions) {
  769. var_C <- var_summary %>% filter(fBinge == "subBED", Money == cond) %>% pull(Variance)
  770. var_A <- var_summary %>% filter(fBinge == "No BE", Money == cond) %>% pull(Variance)
  771. var_ratio <- if (length(var_C) == 1 && length(var_A) == 1 && var_A != 0) var_C / var_A else NA
  772. variance_ratios <- rbind(variance_ratios, data.frame(
  773. Bootstrap = i,
  774. Money = cond,
  775. VarRatio_CvsA = var_ratio
  776. ))
  777. }
  778. boot_combined_var <- boot_data %>%
  779. filter(fBinge %in% c("No BE", "subBED")) %>%
  780. group_by(fBinge) %>%
  781. summarise(Variance = var(resRelEff), .groups = "drop")
  782. if (all(c("No BE", "subBED") %in% boot_combined_var$fBinge)) {
  783. var_C <- boot_combined_var %>% filter(fBinge == "subBED") %>% pull(Variance)
  784. var_A <- boot_combined_var %>% filter(fBinge == "No BE") %>% pull(Variance)
  785. var_ratio_combined <- ifelse(var_A != 0, var_C / var_A, NA)
  786. } else {
  787. var_ratio_combined <- NA
  788. }
  789. # Store combined ratio
  790. variance_ratios <- rbind(variance_ratios, data.frame(
  791. Bootstrap = i,
  792. Money = "Combined",
  793. VarRatio_CvsA = var_ratio_combined
  794. ))
  795. }
  796. # Step 3: Significance testing (2-sided p-values)
  797. # Function to compute 2-sided p-value
  798. two_sided_p <- function(boot_dist, obs_val) {
  799. mean(boot_dist <= 1, na.rm = TRUE)
  800. }
  801. two_sided_p <- function(boot_dist, obs_val) {
  802. mean(abs(boot_dist - obs) >= abs(obs_val - 1), na.rm = TRUE)
  803. }
  804. # Individual condition p-values
  805. # Final p-value computation
  806. p_values <- variance_ratios %>%
  807. group_by(Money) %>%
  808. mutate(
  809. Observed = case_when(
  810. Money == "Combined" ~ observed_combined_ratio,
  811. TRUE ~ observed_ratios$VarRatio_CvsA[match(Money, observed_ratios$Money)]
  812. ),
  813. P_value = two_sided_p(VarRatio_CvsA, Observed)
  814. ) %>%
  815. select(Money,P_value) %>%
  816. unique()
  817. print(p_values)
  818. #bootstrap correlation with BMI
  819. correlation_fn <- function(data, indices) {
  820. d <- data[indices, ]
  821. return(cor(d$cBMI, d$SD_resRelEff, method = "pearson"))
  822. }
  823. # Run bootstrap with 1000 resamples
  824. results_resRelEff <- boot(data = dAgg_S1U, statistic = correlation_fn, R = 1000)
  825. # View results
  826. print(results_resRelEff)
  827. # 95% Confidence interval
  828. boot.ci(results_resRelEff, type = "perc")
  829. correlation_fn <- function(data, indices) {
  830. d <- data[indices, ]
  831. return(cor(d$cBMI, d$SD_resR_Want, method = "pearson"))
  832. }
  833. # Run bootstrap with 1000 resamples
  834. results_resRWant <- boot(data = dAgg_S1U, statistic = correlation_fn, R = 1000)
  835. # View results
  836. print(results_resRWant)
  837. # 95% Confidence interval
  838. boot.ci(results_resRWant, type = "perc")

TUE002_EAT_trial_based_plots_share.R, no license · at the source

Overview

Authors: Mechteld M. van den Hoek Ostende1,2, Anne Kühnel3,4, Monja P. Neuser1, Thomas Dresler1,4,5, Jennifer Svaldi2,4, Nils B. Kroemer1,3,4,6
  1. Department of Psychiatry and Psychotherapy, Tübingen Center for Mental Health, University of Tübingen,Tübingen, Germany
  2. Department of Psychology, Tübingen Center for Mental Health, University of Tübingen,Tübingen, Germany
  3. Section of Medical Psychology, Department of Psychiatry and Psychotherapy, University Hospital Bonn, University of Bonn,Bonn, Germany
  4. German Center for Mental Health (DZPG), partner site Tübingen,Tübingen, Germany
  5. LEAD Graduate School & Research Network, University of Tübingen,Tübingen, Germany
  6. German Center for Diabetes Research (DZD),Neuherberg, Germany
Journal: Translational psychiatry, volume 16, issue 1, article 370
Dates: received 4 November 2025; accepted 8 June 2026; published online 20 July 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1038/s41398-026-04172-6 · PMID 42477311 · PMCID PMC13385738 · OpenAlex W4414077146
Open access: gold, a free copy (OpenAlex)
Status: code verified (how the code is found and verified)
Categories: human (organism), other condition (population), clinical / translational (subfield)
Methods: Connectivity, Statistics, fMRI & imaging
Keywords: Human behaviour, Neuroscience, Psychiatric disorders, Diagnostic markers
MeSH: Binge-Eating Disorder*, Nucleus Accumbens*, Obesity*, Reward*, Adult, Cues, Female, Humans, Magnetic Resonance Imaging, Male (* major topic)
Topic: Adipose Tissue and Metabolism (Physiology (medical), Medicine), according to OpenAlex
Funding: Deutsche Forschungsgemeinschaft (KR 4555/7-1, KR 4555/9-1, KR4555/10_1)
Citations: cited by 1 paper (Europe PMC); 84 references in the paper

Abstract

Binge eating disorder (BED) is characterized by repeated episodes of binge eating accompanied by a loss of control. Although the neurobiological underpinnings of binge eating (BE) episodes are not fully understood, there are indications that variability in nucleus accumbens (NAcc) responses could lead to increased variability in food intake. Here, we assessed whether BED is associated with higher intra-individual variability in behavioral and neuroimaging indices of reward responses. To this end, patients with BED (n = 35, MBMI = 33.2 kg/m2 ± 6.8), participants with subsyndromal BED (n = 21, MBMI = 29.0 kg/m2 ± 7.2), and individuals without symptoms of binge eating (n = 23, MBMI = 32.3 kg/m2 ± 6.5) completed an effort allocation task with concurrent functional magnetic resonance imaging. In line with our hypothesis, we found that patients with BED had higher variability in subjective wanting ratings of food (F34,21 = 1.48, pboot = 0.024), but not effort exertion (F34,21 = 1.13, pboot = 0.30). Crucially, trial-by-trial variability in NAcc responses during the presentation of cues was associated with a higher BMI (b = 0.11, 95%CI [0.03, 0.19], BF10 = 11.1) and disinhibited eating (b = 0.19, 95%CI [0.01, 0.36], BF10 = 4.0) across groups, whereas NAcc variability was only marginally elevated in patients with BED (b = 0.12, 95%CI [−0.04, 0.29], BF10 = 1.2, P > 0|data = 88%). Our results support the idea that BMI and disinhibited eating are associated with more variable NAcc responses, which may contribute to the symptoms of BED. However, this association is only weakly indicative of clinical severity of BED.

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

Repository

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

OSF tewpn

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Languages: R (1)
Size: 5 files, 1 script
Software Heritage: not checked
Found in: “Code availability”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: brms (1 file), cowplot (1 file), ggplot2 (1 file), tidyverse (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
  • 27 September 2026: the link answers (HTTP 200)
1 file

Code availability

Trial-wise data (estimated cue responses and behavior) and analysis code are available at https://osf.io/tewpn/?view_only=e35bb7a5f9574cc4b8faa54ed2979d01.

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;
  • 1 match between paragraphs of the paper and lines of the code (method lexical-v1);
  • neither the text of the paper nor the code itself.

Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.

Data

No dataset and no data link were found in the paper.

Data availability

Trial-wise data (estimated cue responses and behavior) is available at https://osf.io/tewpn/?view_only=e35bb7a5f9574cc4b8faa54ed2979d01.

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

Versions

The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.

Version 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 6 authors, 4 keywords, 10 MeSH terms, 1 funder, 80 references.

Cite

This paper

van den Hoek Ostende, M. M., Kühnel, A., Neuser, M. P., Dresler, T., Svaldi, J., & Kroemer, N. B. (2026). Obesity is associated with greater variability of reward signals in the nucleus accumbens. Translational psychiatry, 16(1), 370. https://doi.org/10.1038/s41398-026-04172-6

BibTeX

@article{vandenhoekostende2026obesity,
author = {van den Hoek Ostende, Mechteld M. and Kühnel, Anne and Neuser, Monja P. and Dresler, Thomas and Svaldi, Jennifer and Kroemer, Nils B.},
title = {{Obesity is associated with greater variability of reward signals in the nucleus accumbens}},
journal = {Translational psychiatry},
year = {2026},
month = jul,
volume = {16},
number = {1},
pages = {370},
publisher = {Nature Publishing Group},
issn = {2158-3188},
doi = {10.1038/s41398-026-04172-6},
url = {https://doi.org/10.1038/s41398-026-04172-6},
pmid = {42477311},
pmcid = {PMC13385738}
}

RIS

TY - JOUR
AU - van den Hoek Ostende, Mechteld M.
AU - Kühnel, Anne
AU - Neuser, Monja P.
AU - Dresler, Thomas
AU - Svaldi, Jennifer
AU - Kroemer, Nils B.
TI - Obesity is associated with greater variability of reward signals in the nucleus accumbens
T2 - Translational psychiatry
J2 - Transl Psychiatry
PY - 2026
DA - 2026/07/20
VL - 16
IS - 1
SP - 370
SN - 2158-3188
PB - Nature Publishing Group
DO - 10.1038/s41398-026-04172-6
UR - https://doi.org/10.1038/s41398-026-04172-6
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41398-026-04172-6",
"type": "article-journal",
"title": "Obesity is associated with greater variability of reward signals in the nucleus accumbens",
"container-title": "Translational psychiatry",
"author": [
{
"family": "van den Hoek Ostende",
"given": "Mechteld M."
},
{
"family": "Kühnel",
"given": "Anne"
},
{
"family": "Neuser",
"given": "Monja P."
},
{
"family": "Dresler",
"given": "Thomas"
},
{
"family": "Svaldi",
"given": "Jennifer"
},
{
"family": "Kroemer",
"given": "Nils B."
}
],
"container-title-short": "Transl Psychiatry",
"volume": "16",
"issue": "1",
"page": "370",
"DOI": "10.1038/s41398-026-04172-6",
"PMID": "42477311",
"PMCID": "PMC13385738",
"ISSN": "2158-3188",
"publisher": "Nature Publishing Group",
"URL": "https://doi.org/10.1038/s41398-026-04172-6",
"language": "en",
"issued": {
"date-parts": [
[
2026,
7,
20
]
]
}
}

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/s42255-025-01226-9
A short-term, high-caloric diet has prolonged effects on brain insulin action in men.
Journal: Nature metabolism
In common: clinical / translational, 2 references, 2 authors
[2] doi:10.1038/s42003-023-05396-8
Stress-induced brain responses are associated with BMI in women.
Journal: Communications biology
In common: 1 reference, 2 authors
[3] doi:10.3389/fnut.2024.1387514 [code]
Genetic associations with neural reward responsivity to food cues in children.
Journal: Frontiers in nutrition
In common: cowplot, ggplot2, tidyverse, 4 references
[4] doi:10.1038/s41380-025-03376-4 [code]
Structural brain differences associated with panic disorder: an ENIGMA-Anxiety Working Group mega-analysis of 4924 individuals worldwide.
Journal: Molecular psychiatry
In common: ggplot2, tidyverse, other condition, 1 reference, author Thomas Dresler
[5] doi:10.1038/s41467-023-43747-5 [code]
Neural substrates of parallel devaluation-sensitive and devaluation-insensitive Pavlovian learning in humans.
Journal: Nature communications
In common: brms, cowplot, ggplot2, 1 other tool, 3 references
[6] doi:10.1162/nol_a_00078 [code]
Can You Hear What's Coming? Failure to Replicate ERP Evidence for Phonological Prediction.
Journal: Neurobiology of language (Cambridge, Mass.)
In common: brms, cowplot, ggplot2, 1 other tool, 3 references
[7] doi:10.1038/s41366-023-01370-w [code]
A randomized controlled trial investigating the effect of liraglutide on self-reported liking and neural responses to food stimuli in participants with obesity.
Journal: International journal of obesity (2005)
In common: brms, cowplot, ggplot2, 1 other tool, clinical / translational, other condition, 1 reference
[8] doi:10.1111/infa.70114 [code]
Statistics in Motion: Does the Infant Motor System Predict Actions Based on Their Transitional Probability?
Journal: Infancy : the official journal of the International Society on Infant Studies
In common: brms, cowplot, tidyverse, 3 references
[9] doi:10.1162/imag_a_00131 [code]
Can prediction error explain predictability effects on the N1 during picture-word verification?
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: brms, cowplot, ggplot2, 1 other tool, 2 references
[10] doi:10.1038/s41380-024-02712-4
Exaggerated frontoparietal control over cognitive effort-based decision-making in young women with anorexia nervosa.
Journal: Molecular psychiatry
In common: other condition, 4 references

Contribute

The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.

Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.

Add the badge to the code's README

OSCR: the badge of this paper

If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.

Markdown
<!-- oscr-badge:start -->
[![OSCR](https://openscicode.org/badge/doi/10.1038/s41398-026-04172-6.svg)](https://openscicode.org/badge/doi/10.1038/s41398-026-04172-6)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.1038/s41398-026-04172-6.svg
   :target: https://openscicode.org/badge/doi/10.1038/s41398-026-04172-6
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1038/s41398-026-04172-6"><img src="https://openscicode.org/badge/doi/10.1038/s41398-026-04172-6.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->

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)

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