OSCR

Aberrant insula activity to negative and reduced learning from positive feedback underlie maladaptive self-beliefs in depression.

Code ↔ Paper

13 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.

The 13 matches
  1. [1] § Methods › Learning Of Own Performance (LOOP) task ↔ Data_Analysis_Script/QuartoReport.qmd, lines 745–830 · score 0.88 · Automatic Thought Questionnaire, Social Interaction Anxiety, SDQ III, Description Questionnaire III, depression inventory, subscale scores
  2. [2] § Methods › Statistical analysis › Behavioral data analysis and modeling › Statistical analyses of learning parameters ↔ Data_Analysis_Script/QuartoReport.qmd, lines 1217–1229 · score 0.81 · linear mixed model, major violations, random slopes, Random intercepts, Model assumptions, residuals
  3. [3] § Results › Imbalanced prediction error signaling in depression during feedback processing ↔ Data_Analysis_Script/QuartoReport.qmd, lines 2141–2171 · score 0.78 · participants receive recurrent, positive PE trials, negative PE trials, insula activation, learning behavior, negative prediction error
  4. [4] § Methods › Statistical analysis › Behavioral data analysis and modeling › Model-agnostic analysis ↔ Data_Analysis_Script/QuartoReport.qmd, lines 1217–1229 · score 0.76 · linear mixed model, random slopes, Random intercepts, model agnostic, continuous predictor, Agent
  5. [5] § Results › Disregard of positive feedback with higher symptom burden ↔ Data_Analysis_Script/QuartoReport.qmd, lines 1334–1346 · score 0.75 · higher symptom burden, negative feedback remains, symptom scores, detailed correlations, integrate positive feedback, positive prediction errors
  6. [6] § Results ↔ Data_Analysis_Script/QuartoReport.qmd, lines 1038–1077 · score 0.71 · participants formed beliefs, Agent interaction, post hoc, PE Valence, winning model, negativity bias
  7. [7] § Results › No learning differences between individuals with depression and healthy controls ↔ Data_Analysis_Script/QuartoReport.qmd, lines 1148–1175 · score 0.63 · people diagnosed, forming novel beliefs, model agnostic, healthy controls, expectation ratings, negativity bias
  8. [8] § Methods › Statistical analysis › Behavioral data analysis and modeling › FMRI data analysis ↔ Data_Analysis_Script/QuartoReport.qmd, lines 2021–2048 · score 0.60 · Psychopathology score, brain activity, Spearman correlation, PE trials, categorical PE, ROIs
  9. [9] § Methods › Statistical analysis › Behavioral data analysis and modeling › Computational modeling ↔ Data_Analysis_Script/QuartoReport.qmd, lines 1095–1146 · score 0.57 · PSIS LOO, Valence Model
  10. [10] § Results › Imbalanced prediction error signaling in depression during feedback processing ↔ Data_Analysis_Script/QuartoReport.qmd, lines 1659–1686 · score 0.57 · right insula, MDD compared, major depressive disorder, depicts, uncorrected, prediction errors
  11. [11] § Results › Imbalanced prediction error signaling in depression during feedback processing ↔ Data_Analysis_Script/QuartoReport.qmd, lines 1602–1631 · score 0.53 · right anterior, prediction error signaling, negative prediction errors, peak, imbalance, insula
  12. [12] § Methods › Statistical analysis › Behavioral data analysis and modeling › Capturing symptom burden ↔ Data_Analysis_Script/QuartoReport.qmd, lines 1425–1466 · score 0.51 · SDQ III, rotation, ATQ, SIAS, BDI, symptoms
  13. [13] § Methods › Learning Of Own Performance (LOOP) task ↔ Data_Analysis_Script/QuartoReport.qmd, lines 1713–1795 · score 0.50 · arousal, tiredness, related feedback, embarrassment, happiness, pride

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

Quarto · 2,541 lines · 104 KB · no license · 13 matches

  1. ---
  2. title: "Aberrant insula activity to negative and reduced learning from positive feedback underlie maladaptive self-beliefs in depression"
  3. author: "Nora Czekalla, Annalina V. Mayer & Laura Müller-Pinzler"
  4. format:
  5. html:
  6. page-layout: article
  7. self-contained: true
  8. grid:
  9. sidebar-width: 300px
  10. body-width: 900px
  11. margin-width: 300px
  12. gutter-width: 1.5rem
  13. toc: true
  14. toc-location: left
  15. df-print: paged
  16. code-fold: true
  17. code-summary: "show the code"
  18. editor: visual
  19. fig_caption: true
  20. tbl-cap-location: bottom
  21. execute:
  22. #echo: false
  23. warning: false
  24. ---
  25. ```{css}
  26. /*| echo: false */
  27. p {
  28. text-align: justify
  29. }
  30. ```
  31. ## Preamble to this document
  32. This report contains the code and data required to reproduce most of the results, plots and tables of the manuscript. Estimation of computational models using RStan and fMRI analyses using SPM are not included. If you are interested in these analyses, please contact the corresponding author.
  33. ## Data import and used packages
  34. ### Package library
  35. ```{r}
  36. library(here)
  37. library(tidyverse)
  38. library(psych)
  39. library(Hmisc)
  40. library(reshape2)
  41. library(nlme)
  42. library(ggpattern)
  43. library(corrplot)
  44. library(cocor)
  45. library(gt)
  46. library(rstatix)
  47. ```
  48. ### Data import
  49. ```{r}
  50. load(here("data_OSF.RDATA"))
  51. ```
  52. ### Custom functions
  53. ```{r}
  54. # layout for gt tables
  55. gt_layout <- function(x) {
  56. tab_options(
  57. x,
  58. table.font.names = "Times New Roman",
  59. table.font.size =16,
  60. heading.title.font.size = 16,
  61. table.border.top.style = "hidden",
  62. table.border.bottom.style = "hidden"
  63. ) %>%
  64. tab_style(
  65. style = cell_borders(
  66. sides = c("top", "bottom"),
  67. color = "white"
  68. ),
  69. locations = cells_body()
  70. )%>%
  71. tab_style(
  72. style = list(cell_borders(
  73. sides = c("top", "bottom"),
  74. color = "white"),
  75. cell_text(weight = "bold")),
  76. locations = cells_row_groups()
  77. )%>%
  78. tab_style(
  79. style = cell_borders(
  80. sides = c("bottom"),
  81. weight=px(2),
  82. color = "black"),
  83. locations = cells_title()
  84. )%>%
  85. tab_style(
  86. style = cell_borders(
  87. sides = c("top"),
  88. weight=px(2),
  89. color = "black"),
  90. locations = cells_footnotes()
  91. )%>%
  92. sub_missing(
  93. missing_text = ""
  94. )
  95. }
  96. # theme for plots
  97. snl_theme <- function() {
  98. theme(
  99. # add border 1)
  100. panel.border = element_rect(colour = "#004B5A", fill = NA, linetype = 1),
  101. # color background 2)
  102. panel.background = element_rect(fill = "#FFFFFF"),
  103. # modify grid 3)
  104. panel.grid.major.x = element_line(colour = "#CDDBD8", linetype = 3, linewidth = 0.5),
  105. panel.grid.minor.x = element_blank(),
  106. panel.grid.major.y = element_line(colour = "#CDDBD8", linetype = 3, linewidth = 0.5),
  107. panel.grid.minor.y = element_blank(),
  108. # modify text, axis and colour 4) and 5)
  109. axis.title.x = element_text(size = 20, face="bold", margin = margin(t = 10, r = 0, b = 0, l = 0)),
  110. axis.title.y = element_text(size = 20, face="bold", margin = margin(t = 0, r = 10, b = 0, l = 0)),
  111. axis.text.y = element_text(size = 20, color="black", margin = margin(t = 0, r = 5, b = 0, l = 0)),
  112. axis.text.x = element_text(size = 20, color="black", angle = 0, vjust = 0.5, margin = margin(t = 5, r = 0, b = 0, l = 0)),
  113. axis.ticks = element_line(colour = "#004B5A"),
  114. # legend at the bottom 6)
  115. legend.position = "bottom",
  116. legend.title=element_blank(),
  117. legend.text=element_text(size=18),
  118. legend.key.size = unit(2,"line")
  119. )
  120. }
  121. # round, format and mark p-values
  122. # x: input vector
  123. p <- function(x) {
  124. p_round(x, digits = 3) %>%
  125. p_format(digits = 3, accuracy = 0.001, leading.zero = FALSE)
  126. }
  127. p_txt <- function(x) {
  128. p_round(x, digits = 3) %>%
  129. p_format(digits = 3, accuracy = 0.001, leading.zero = FALSE)
  130. }
  131. col <- colorRampPalette(c("#BB4444", "#EE9988", "#FFFFFF", "#77AADD", "#4477AA"))
  132. ####### Adaptation of corrplot function from corrplot package #######
  133. ## adapt corrplot function to display significance (*) in the upper corner of each cell
  134. # +0.35 added at place_points = function(sig.locs, point) {
  135. # text(pos.pNew[, 1][sig.locs] + 0.35, pos.pNew[,
  136. # 2][sig.locs] + 0.35, ...
  137. draw_method_square = function(coords, values, asp_rescale_factor, fg, bg) {
  138. symbols(coords, add = TRUE, inches = FALSE,
  139. squares = asp_rescale_factor * abs(values) ^ 0.5,
  140. bg = bg, fg = fg)
  141. }
  142. draw_method_color = function(coords, fg, bg) {
  143. symbols(coords, squares = rep(1, nrow(coords)), fg = fg, bg = bg,
  144. add = TRUE, inches = FALSE)
  145. }
  146. draw_grid = function(coords, fg) {
  147. symbols(coords, add = TRUE, inches = FALSE, fg = fg, bg = NA,
  148. rectangles = matrix(1, nrow = nrow(coords), ncol = 2))
  149. }
  150. corrplot<- function (corr, method = c("circle", "square", "ellipse", "number",
  151. "shade", "color", "pie"), type = c("full", "lower", "upper"),
  152. col = NULL, col.lim = NULL, bg = "white", title = "", is.corr = TRUE,
  153. add = FALSE, diag = TRUE, outline = FALSE, mar = c(0, 0,
  154. 0, 0), addgrid.col = NULL, addCoef.col = NULL, addCoefasPercent = FALSE,
  155. order = c("original", "AOE", "FPC", "hclust", "alphabet"),
  156. hclust.method = c("complete", "ward", "ward.D", "ward.D2",
  157. "single", "average", "mcquitty", "median", "centroid"),
  158. addrect = NULL, rect.col = "black", rect.lwd = 2, tl.pos = NULL,
  159. tl.cex = 1, tl.col = "red", tl.offset = 0.4, tl.srt = 90,
  160. cl.pos = NULL, cl.length = NULL, cl.cex = 0.8, cl.ratio = 0.15,
  161. cl.align.text = "c", cl.offset = 0.5, number.cex = 1, number.font = 2,
  162. number.digits = NULL, addshade = c("negative", "positive",
  163. "all"), shade.lwd = 1, shade.col = "white", p.mat = NULL,
  164. sig.level = 0.05, insig = c("pch", "p-value", "blank", "n",
  165. "label_sig"), pch = 4, pch.col = "black", pch.cex = 3,
  166. plotCI = c("n", "square", "circle", "rect"), lowCI.mat = NULL,
  167. uppCI.mat = NULL, na.label = "?", na.label.col = "black",
  168. win.asp = 1, ...)
  169. {
  170. method = match.arg(method)
  171. type = match.arg(type)
  172. order = match.arg(order)
  173. hclust.method = match.arg(hclust.method)
  174. addshade = match.arg(addshade)
  175. insig = match.arg(insig)
  176. plotCI = match.arg(plotCI)
  177. if (win.asp != 1 && !(method %in% c("circle", "square"))) {
  178. stop("Parameter 'win.asp' is supported only for circle and square methods.")
  179. }
  180. asp_rescale_factor = min(1, win.asp)/max(1, win.asp)
  181. stopifnot(asp_rescale_factor >= 0 && asp_rescale_factor <=
  182. 1)
  183. if (!is.matrix(corr) && !is.data.frame(corr)) {
  184. stop("Need a matrix or data frame!")
  185. }
  186. if (is.null(addgrid.col)) {
  187. addgrid.col = switch(method, color = NA, shade = NA,
  188. "grey")
  189. }
  190. if (any(corr[!is.na(corr)] < col.lim[1]) || any(corr[!is.na(corr)] >
  191. col.lim[2])) {
  192. stop("color limits should cover matrix")
  193. }
  194. if (is.null(col.lim)) {
  195. if (is.corr) {
  196. col.lim = c(-1, 1)
  197. }
  198. else {
  199. if (!diag) {
  200. diag(corr) = NA
  201. }
  202. col.lim = c(min(corr, na.rm = TRUE), max(corr, na.rm = TRUE))
  203. }
  204. }
  205. SpecialCorr = 0
  206. if (is.corr) {
  207. if (min(corr, na.rm = TRUE) < -1 - .Machine$double.eps^0.75 ||
  208. max(corr, na.rm = TRUE) > 1 + .Machine$double.eps^0.75) {
  209. stop("The matrix is not in [-1, 1]!")
  210. }
  211. SpecialCorr = 1
  212. if (col.lim[1] < -1 | col.lim[2] > 1) {
  213. stop("col.lim should be within the interval [-1, 1]")
  214. }
  215. }
  216. intercept = 0
  217. zoom = 1
  218. if (!is.corr) {
  219. c_max = max(corr, na.rm = TRUE)
  220. c_min = min(corr, na.rm = TRUE)
  221. if ((col.lim[1] > c_min) | (col.lim[2] < c_max)) {
  222. stop("Wrong color: matrix should be in col.lim interval!")
  223. }
  224. if (diff(col.lim)/(c_max - c_min) > 2) {
  225. warning("col.lim interval too wide, please set a suitable value")
  226. }
  227. if (c_max <= 0 | c_min >= 0) {
  228. intercept = -col.lim[1]
  229. zoom = 1/(diff(col.lim))
  230. if (col.lim[1] * col.lim[2] < 0) {
  231. warning("col.lim interval not suitable to the matrix")
  232. }
  233. }
  234. else {
  235. stopifnot(c_max * c_min < 0)
  236. stopifnot(c_min < 0 && c_max > 0)
  237. intercept = 0
  238. zoom = 1/max(abs(col.lim))
  239. SpecialCorr = 1
  240. }
  241. corr = (intercept + corr) * zoom
  242. }
  243. col.lim2 = (intercept + col.lim) * zoom
  244. int = intercept * zoom
  245. if (is.null(col) & is.corr) {
  246. col = COL2("RdBu", 200)
  247. }
  248. if (is.null(col) & !is.corr) {
  249. if (col.lim[1] * col.lim[2] < 0) {
  250. col = COL2("RdBu", 200)
  251. }
  252. else {
  253. col = COL1("YlOrBr", 200)
  254. }
  255. }
  256. n = nrow(corr)
  257. m = ncol(corr)
  258. min.nm = min(n, m)
  259. ord = 1:min.nm
  260. if (order != "original") {
  261. ord = corrMatOrder(corr, order = order, hclust.method = hclust.method)
  262. corr = corr[ord, ord]
  263. }
  264. if (is.null(rownames(corr))) {
  265. rownames(corr) = 1:n
  266. }
  267. if (is.null(colnames(corr))) {
  268. colnames(corr) = 1:m
  269. }
  270. apply_mat_filter = function(mat) {
  271. x = matrix(1:n * m, nrow = n, ncol = m)
  272. switch(type, upper = mat[row(x) > col(x)] <- Inf, lower = mat[row(x) <
  273. col(x)] <- Inf)
  274. if (!diag) {
  275. diag(mat) = Inf
  276. }
  277. return(mat)
  278. }
  279. getPos.Dat = function(mat) {
  280. tmp = apply_mat_filter(mat)
  281. Dat = tmp[is.finite(tmp)]
  282. ind = which(is.finite(tmp), arr.ind = TRUE)
  283. Pos = ind
  284. Pos[, 1] = ind[, 2]
  285. Pos[, 2] = -ind[, 1] + 1 + n
  286. PosName = ind
  287. PosName[, 1] = colnames(mat)[ind[, 2]]
  288. PosName[, 2] = rownames(mat)[ind[, 1]]
  289. return(list(Pos, Dat, PosName))
  290. }
  291. getPos.NAs = function(mat) {
  292. tmp = apply_mat_filter(mat)
  293. ind = which(is.na(tmp), arr.ind = TRUE)
  294. Pos = ind
  295. Pos[, 1] = ind[, 2]
  296. Pos[, 2] = -ind[, 1] + 1 + n
  297. return(Pos)
  298. }
  299. testTemp = getPos.Dat(corr)
  300. Pos = getPos.Dat(corr)[[1]]
  301. PosName = getPos.Dat(corr)[[3]]
  302. if (any(is.na(corr)) && is.character(na.label)) {
  303. PosNA = getPos.NAs(corr)
  304. }
  305. else {
  306. PosNA = NULL
  307. }
  308. AllCoords = rbind(Pos, PosNA)
  309. n2 = max(AllCoords[, 2])
  310. n1 = min(AllCoords[, 2])
  311. nn = n2 - n1
  312. m2 = max(AllCoords[, 1])
  313. m1 = min(AllCoords[, 1])
  314. mm = max(1, m2 - m1)
  315. expand_expression = function(s) {
  316. ifelse(grepl("^[:=$]", s), parse(text = substring(s,
  317. 2)), s)
  318. }
  319. newrownames = sapply(rownames(corr)[(n + 1 - n2):(n + 1 -
  320. n1)], expand_expression)
  321. newcolnames = sapply(colnames(corr)[m1:m2], expand_expression)
  322. DAT = getPos.Dat(corr)[[2]]
  323. len.DAT = length(DAT)
  324. rm(expand_expression)
  325. assign.color = function(dat = DAT, color = col, isSpecialCorr = SpecialCorr) {
  326. if (isSpecialCorr) {
  327. newcorr = (dat + 1)/2
  328. }
  329. else {
  330. newcorr = dat
  331. }
  332. newcorr[newcorr <= 0] = 0
  333. newcorr[newcorr >= 1] = 1 - 1e-16
  334. color[floor(newcorr * length(color)) + 1]
  335. }
  336. col.fill = assign.color()
  337. isFALSE = function(x) identical(x, FALSE)
  338. isTRUE = function(x) identical(x, TRUE)
  339. if (isFALSE(tl.pos)) {
  340. tl.pos = "n"
  341. }
  342. if (is.null(tl.pos) || isTRUE(tl.pos)) {
  343. tl.pos = switch(type, full = "lt", lower = "ld", upper = "td")
  344. }
  345. if (isFALSE(cl.pos)) {
  346. cl.pos = "n"
  347. }
  348. if (is.null(cl.pos) || isTRUE(cl.pos)) {
  349. cl.pos = switch(type, full = "r", lower = "b", upper = "r")
  350. }
  351. if (isFALSE(outline)) {
  352. col.border = col.fill
  353. }
  354. else if (isTRUE(outline)) {
  355. col.border = "black"
  356. }
  357. else if (is.character(outline)) {
  358. col.border = outline
  359. }
  360. else {
  361. stop("Unsupported value type for parameter outline")
  362. }
  363. oldpar = par(mar = mar, bg = par()$bg)
  364. on.exit(par(oldpar), add = TRUE)
  365. if (!add) {
  366. plot.new()
  367. xlabwidth = max(strwidth(newrownames, cex = tl.cex))
  368. ylabwidth = max(strwidth(newcolnames, cex = tl.cex))
  369. laboffset = strwidth("W", cex = tl.cex) * tl.offset
  370. for (i in 1:50) {
  371. xlim = c(m1 - 0.5 - laboffset - xlabwidth * (grepl("l",
  372. tl.pos) | grepl("d", tl.pos)), m2 + 0.5 + mm *
  373. cl.ratio * (cl.pos == "r") + xlabwidth * abs(cos(tl.srt *
  374. pi/180)) * grepl("d", tl.pos))
  375. ylim = c(n1 - 0.5 - nn * cl.ratio * (cl.pos == "b") -
  376. laboffset, n2 + 0.5 + laboffset + ylabwidth *
  377. abs(sin(tl.srt * pi/180)) * grepl("t", tl.pos) +
  378. ylabwidth * abs(sin(tl.srt * pi/180)) * (type ==
  379. "lower") * grepl("d", tl.pos))
  380. plot.window(xlim, ylim, asp = 1, xaxs = "i", yaxs = "i")
  381. x.tmp = max(strwidth(newrownames, cex = tl.cex))
  382. y.tmp = max(strwidth(newcolnames, cex = tl.cex))
  383. laboffset.tmp = strwidth("W", cex = tl.cex) * tl.offset
  384. if (max(x.tmp - xlabwidth, y.tmp - ylabwidth, laboffset.tmp -
  385. laboffset) < 0.001) {
  386. break
  387. }
  388. xlabwidth = x.tmp
  389. ylabwidth = y.tmp
  390. laboffset = laboffset.tmp
  391. if (i == 50) {
  392. warning(c("Not been able to calculate text margin, ",
  393. "please try again with a clean new empty window using ",
  394. "{plot.new(); dev.off()} or reduce tl.cex"))
  395. }
  396. }
  397. if (.Platform$OS.type == "windows") {
  398. grDevices::windows.options(width = 7, height = 7 *
  399. diff(ylim)/diff(xlim))
  400. }
  401. xlim = xlim + diff(xlim) * 0.01 * c(-1, 1)
  402. ylim = ylim + diff(ylim) * 0.01 * c(-1, 1)
  403. plot.window(xlim = xlim, ylim = ylim, asp = win.asp,
  404. xlab = "", ylab = "", xaxs = "i", yaxs = "i")
  405. }
  406. laboffset = strwidth("W", cex = tl.cex) * tl.offset
  407. symbols(Pos, add = TRUE, inches = FALSE, rectangles = matrix(1,
  408. len.DAT, 2), bg = bg, fg = bg)
  409. if (method == "circle" && plotCI == "n") {
  410. symbols(Pos, add = TRUE, inches = FALSE, circles = asp_rescale_factor *
  411. 0.9 * abs(DAT)^0.5/2, fg = col.border, bg = col.fill)
  412. }
  413. if (method == "ellipse" && plotCI == "n") {
  414. ell.dat = function(rho, length = 99) {
  415. k = seq(0, 2 * pi, length = length)
  416. x = cos(k + acos(rho)/2)/2
  417. y = cos(k - acos(rho)/2)/2
  418. cbind(rbind(x, y), c(NA, NA))
  419. }
  420. ELL.dat = lapply(DAT, ell.dat)
  421. ELL.dat2 = 0.85 * matrix(unlist(ELL.dat), ncol = 2,
  422. byrow = TRUE)
  423. ELL.dat2 = ELL.dat2 + Pos[rep(1:length(DAT), each = 100),
  424. ]
  425. polygon(ELL.dat2, border = col.border, col = col.fill)
  426. }
  427. if (is.null(number.digits)) {
  428. number.digits = switch(addCoefasPercent + 1, 2, 0)
  429. }
  430. stopifnot(number.digits%%1 == 0)
  431. stopifnot(number.digits >= 0)
  432. if (method == "number" && plotCI == "n") {
  433. x = (DAT - int) * ifelse(addCoefasPercent, 100, 1)/zoom
  434. text(Pos[, 1], Pos[, 2], font = number.font, col = col.fill,
  435. labels = format(round(x, number.digits), nsmall = number.digits),
  436. cex = number.cex)
  437. }
  438. NA_LABEL_MAX_CHARS = 2
  439. if (is.matrix(PosNA) && nrow(PosNA) > 0) {
  440. stopifnot(is.matrix(PosNA))
  441. if (na.label == "square") {
  442. symbols(PosNA, add = TRUE, inches = FALSE, squares = rep(1,
  443. nrow(PosNA)), bg = na.label.col, fg = na.label.col)
  444. }
  445. else if (nchar(na.label) %in% 1:NA_LABEL_MAX_CHARS) {
  446. symbols(PosNA, add = TRUE, inches = FALSE, squares = rep(1,
  447. nrow(PosNA)), fg = bg, bg = bg)
  448. text(PosNA[, 1], PosNA[, 2], font = number.font,
  449. col = na.label.col, labels = na.label, cex = number.cex,
  450. ...)
  451. }
  452. else {
  453. stop(paste("Maximum number of characters for NA label is:",
  454. NA_LABEL_MAX_CHARS))
  455. }
  456. }
  457. if (method == "pie" && plotCI == "n") {
  458. symbols(Pos, add = TRUE, inches = FALSE, circles = rep(0.5,
  459. len.DAT) * 0.85, fg = col.border)
  460. pie.dat = function(theta, length = 100) {
  461. k = seq(pi/2, pi/2 - theta, length = 0.5 * length *
  462. abs(theta)/pi)
  463. x = c(0, cos(k)/2, 0)
  464. y = c(0, sin(k)/2, 0)
  465. cbind(rbind(x, y), c(NA, NA))
  466. }
  467. PIE.dat = lapply(DAT * 2 * pi, pie.dat)
  468. len.pie = unlist(lapply(PIE.dat, length))/2
  469. PIE.dat2 = 0.85 * matrix(unlist(PIE.dat), ncol = 2,
  470. byrow = TRUE)
  471. PIE.dat2 = PIE.dat2 + Pos[rep(1:length(DAT), len.pie),
  472. ]
  473. polygon(PIE.dat2, border = "black", col = col.fill)
  474. }
  475. if (method == "shade" && plotCI == "n") {
  476. symbols(Pos, add = TRUE, inches = FALSE, squares = rep(1,
  477. len.DAT), bg = col.fill, fg = addgrid.col)
  478. shade.dat = function(w) {
  479. x = w[1]
  480. y = w[2]
  481. rho = w[3]
  482. x1 = x - 0.5
  483. x2 = x + 0.5
  484. y1 = y - 0.5
  485. y2 = y + 0.5
  486. dat = NA
  487. if ((addshade == "positive" || addshade == "all") &&
  488. rho > 0) {
  489. dat = cbind(c(x1, x1, x), c(y, y1, y1), c(x,
  490. x2, x2), c(y2, y2, y))
  491. }
  492. if ((addshade == "negative" || addshade == "all") &&
  493. rho < 0) {
  494. dat = cbind(c(x1, x1, x), c(y, y2, y2), c(x,
  495. x2, x2), c(y1, y1, y))
  496. }
  497. return(t(dat))
  498. }
  499. pos_corr = rbind(cbind(Pos, DAT))
  500. pos_corr2 = split(pos_corr, 1:nrow(pos_corr))
  501. SHADE.dat = matrix(na.omit(unlist(lapply(pos_corr2,
  502. shade.dat))), byrow = TRUE, ncol = 4)
  503. segments(SHADE.dat[, 1], SHADE.dat[, 2], SHADE.dat[,
  504. 3], SHADE.dat[, 4], col = shade.col, lwd = shade.lwd)
  505. }
  506. if (method == "square" && plotCI == "n") {
  507. draw_method_square(Pos, DAT, asp_rescale_factor, col.border,
  508. col.fill)
  509. }
  510. if (method == "color" && plotCI == "n") {
  511. draw_method_color(Pos, col.border, col.fill)
  512. }
  513. draw_grid(AllCoords, addgrid.col)
  514. if (plotCI != "n") {
  515. if (is.null(lowCI.mat) || is.null(uppCI.mat)) {
  516. stop("Need lowCI.mat and uppCI.mat!")
  517. }
  518. if (order != "original") {
  519. lowCI.mat = lowCI.mat[ord, ord]
  520. uppCI.mat = uppCI.mat[ord, ord]
  521. }
  522. pos.lowNew = getPos.Dat(lowCI.mat)[[1]]
  523. lowNew = getPos.Dat(lowCI.mat)[[2]]
  524. pos.uppNew = getPos.Dat(uppCI.mat)[[1]]
  525. uppNew = getPos.Dat(uppCI.mat)[[2]]
  526. k1 = (abs(uppNew) > abs(lowNew))
  527. bigabs = uppNew
  528. bigabs[which(!k1)] = lowNew[!k1]
  529. smallabs = lowNew
  530. smallabs[which(!k1)] = uppNew[!k1]
  531. sig = sign(uppNew * lowNew)
  532. color_bigabs = col[ceiling((bigabs + 1) * length(col)/2)]
  533. color_smallabs = col[ceiling((smallabs + 1) * length(col)/2)]
  534. if (plotCI == "circle") {
  535. symbols(pos.uppNew[, 1], pos.uppNew[, 2], add = TRUE,
  536. inches = FALSE, circles = 0.95 * abs(bigabs)^0.5/2,
  537. bg = ifelse(sig > 0, col.fill, color_bigabs),
  538. fg = ifelse(sig > 0, col.fill, color_bigabs))
  539. symbols(pos.lowNew[, 1], pos.lowNew[, 2], add = TRUE,
  540. inches = FALSE, circles = 0.95 * abs(smallabs)^0.5/2,
  541. bg = ifelse(sig > 0, bg, color_smallabs), fg = ifelse(sig >
  542. 0, col.fill, color_smallabs))
  543. }
  544. if (plotCI == "square") {
  545. symbols(pos.uppNew[, 1], pos.uppNew[, 2], add = TRUE,
  546. inches = FALSE, squares = abs(bigabs)^0.5, bg = ifelse(sig >
  547. 0, col.fill, color_bigabs), fg = ifelse(sig >
  548. 0, col.fill, color_bigabs))
  549. symbols(pos.lowNew[, 1], pos.lowNew[, 2], add = TRUE,
  550. inches = FALSE, squares = abs(smallabs)^0.5,
  551. bg = ifelse(sig > 0, bg, color_smallabs), fg = ifelse(sig >
  552. 0, col.fill, color_smallabs))
  553. }
  554. if (plotCI == "rect") {
  555. rect.width = 0.25
  556. rect(pos.uppNew[, 1] - rect.width, pos.uppNew[,
  557. 2] + smallabs/2, pos.uppNew[, 1] + rect.width,
  558. pos.uppNew[, 2] + bigabs/2, col = col.fill,
  559. border = col.fill)
  560. segments(pos.lowNew[, 1] - rect.width, pos.lowNew[,
  561. 2] + DAT/2, pos.lowNew[, 1] + rect.width, pos.lowNew[,
  562. 2] + DAT/2, col = "black", lwd = 1)
  563. segments(pos.uppNew[, 1] - rect.width, pos.uppNew[,
  564. 2] + uppNew/2, pos.uppNew[, 1] + rect.width,
  565. pos.uppNew[, 2] + uppNew/2, col = "black", lwd = 1)
  566. segments(pos.lowNew[, 1] - rect.width, pos.lowNew[,
  567. 2] + lowNew/2, pos.lowNew[, 1] + rect.width,
  568. pos.lowNew[, 2] + lowNew/2, col = "black", lwd = 1)
  569. segments(pos.lowNew[, 1] - 0.5, pos.lowNew[, 2],
  570. pos.lowNew[, 1] + 0.5, pos.lowNew[, 2], col = "grey70",
  571. lty = 3)
  572. }
  573. }
  574. if (!is.null(addCoef.col) && method != "number") {
  575. text(Pos[, 1], Pos[, 2], col = addCoef.col, labels = round((DAT -
  576. int) * ifelse(addCoefasPercent, 100, 1)/zoom, number.digits),
  577. cex = number.cex, font = number.font)
  578. }
  579. if (!is.null(p.mat) && insig != "n") {
  580. if (order != "original") {
  581. p.mat = p.mat[ord, ord]
  582. }
  583. if (!is.null(rownames(p.mat)) | !is.null(rownames(p.mat))) {
  584. if (!all(colnames(p.mat) == colnames(corr)) | !all(rownames(p.mat) ==
  585. rownames(corr))) {
  586. warning("p.mat and corr may be not paired, their rownames and colnames are not totally same!")
  587. }
  588. }
  589. pos.pNew = getPos.Dat(p.mat)[[1]]
  590. pNew = getPos.Dat(p.mat)[[2]]
  591. if (insig == "label_sig") {
  592. if (!is.character(pch))
  593. pch = "*"
  594. place_points = function(sig.locs, point) {
  595. text(pos.pNew[, 1][sig.locs]+0.35, pos.pNew[, 2][sig.locs]+0.35,
  596. labels = point, col = pch.col, cex = pch.cex,
  597. lwd = 2)
  598. }
  599. if (length(sig.level) == 1) {
  600. place_points(sig.locs = which(pNew < sig.level),
  601. point = pch)
  602. }
  603. else {
  604. l = length(sig.level)
  605. for (i in seq_along(sig.level)) {
  606. iter = l + 1 - i
  607. pchTmp = paste(rep(pch, i), collapse = "")
  608. if (i == length(sig.level)) {
  609. locs = which(pNew < sig.level[iter])
  610. if (length(locs)) {
  611. place_points(sig.locs = locs, point = pchTmp)
  612. }
  613. }
  614. else {
  615. locs = which(pNew < sig.level[iter] & pNew >
  616. sig.level[iter - 1])
  617. if (length(locs)) {
  618. place_points(sig.locs = locs, point = pchTmp)
  619. }
  620. }
  621. }
  622. }
  623. }
  624. else {
  625. ind.p = which(pNew > sig.level)
  626. p_inSig = length(ind.p) > 0
  627. if (insig == "pch" && p_inSig) {
  628. points(pos.pNew[, 1][ind.p], pos.pNew[, 2][ind.p],
  629. pch = pch, col = pch.col, cex = pch.cex, lwd = 2)
  630. }
  631. if (insig == "p-value" && p_inSig) {
  632. text(pos.pNew[, 1][ind.p], pos.pNew[, 2][ind.p],
  633. round(pNew[ind.p], number.digits), col = pch.col)
  634. }
  635. if (insig == "blank" && p_inSig) {
  636. symbols(pos.pNew[, 1][ind.p], pos.pNew[, 2][ind.p],
  637. inches = FALSE, squares = rep(1, length(pos.pNew[,
  638. 1][ind.p])), fg = addgrid.col, bg = bg,
  639. add = TRUE)
  640. }
  641. }
  642. }
  643. if (cl.pos != "n") {
  644. colRange = assign.color(dat = col.lim2)
  645. ind1 = which(col == colRange[1])
  646. ind2 = which(col == colRange[2])
  647. colbar = col[ind1:ind2]
  648. if (is.null(cl.length)) {
  649. cl.length = ifelse(length(colbar) > 20, 11, length(colbar) +
  650. 1)
  651. }
  652. labels = seq(col.lim[1], col.lim[2], length = cl.length)
  653. if (cl.pos == "r") {
  654. vertical = TRUE
  655. xlim = c(m2 + 0.5 + mm * 0.02, m2 + 0.5 + mm * cl.ratio)
  656. ylim = c(n1 - 0.5, n2 + 0.5)
  657. }
  658. if (cl.pos == "b") {
  659. vertical = FALSE
  660. xlim = c(m1 - 0.5, m2 + 0.5)
  661. ylim = c(n1 - 0.5 - nn * cl.ratio, n1 - 0.5 - nn *
  662. 0.02)
  663. }
  664. colorlegend(colbar = colbar, labels = round(labels,
  665. 2), offset = cl.offset, ratio.colbar = 0.3, cex = cl.cex,
  666. xlim = xlim, ylim = ylim, vertical = vertical, align = cl.align.text)
  667. }
  668. if (tl.pos != "n") {
  669. pos.xlabel = cbind(m1:m2, n2 + 0.5 + laboffset)
  670. pos.ylabel = cbind(m1 - 0.5, n2:n1)
  671. if (tl.pos == "td") {
  672. if (type != "upper") {
  673. stop("type should be 'upper' if tl.pos is 'dt'.")
  674. }
  675. pos.ylabel = cbind(m1:(m1 + nn) - 0.5, n2:n1)
  676. }
  677. if (tl.pos == "ld") {
  678. if (type != "lower") {
  679. stop("type should be 'lower' if tl.pos is 'ld'.")
  680. }
  681. pos.xlabel = cbind(m1:m2, n2:(n2 - mm) + 0.5 + laboffset)
  682. }
  683. if (tl.pos == "d") {
  684. pos.ylabel = cbind(m1:(m1 + nn) - 0.5, n2:n1)
  685. pos.ylabel = pos.ylabel[1:min(n, m), ]
  686. symbols(pos.ylabel[, 1] + 0.5, pos.ylabel[, 2],
  687. add = TRUE, bg = bg, fg = addgrid.col, inches = FALSE,
  688. squares = rep(1, length(pos.ylabel[, 1])))
  689. text(pos.ylabel[, 1] + 0.5, pos.ylabel[, 2], newcolnames[1:min(n,
  690. m)], col = tl.col, cex = tl.cex, ...)
  691. }
  692. else {
  693. if (tl.pos != "l") {
  694. text(pos.xlabel[, 1], pos.xlabel[, 2], newcolnames,
  695. srt = tl.srt, adj = ifelse(tl.srt == 0, c(0.5,
  696. 0), c(0, 0)), col = tl.col, cex = tl.cex,
  697. offset = tl.offset, ...)
  698. }
  699. text(pos.ylabel[, 1], pos.ylabel[, 2], newrownames,
  700. col = tl.col, cex = tl.cex, pos = 2, offset = tl.offset,
  701. ...)
  702. }
  703. }
  704. title(title, ...)
  705. if (type == "full" && plotCI == "n" && !is.null(addgrid.col)) {
  706. rect(m1 - 0.5, n1 - 0.5, m2 + 0.5, n2 + 0.5, border = addgrid.col)
  707. }
  708. if (!is.null(addrect) && order == "hclust" && type == "full") {
  709. corrRect.hclust(corr, k = addrect, method = hclust.method,
  710. col = rect.col, lwd = rect.lwd)
  711. }
  712. corrPos = data.frame(PosName, Pos, DAT)
  713. colnames(corrPos) = c("xName", "yName", "x", "y", "corr")
  714. if (!is.null(p.mat)) {
  715. corrPos = cbind(corrPos, pNew)
  716. colnames(corrPos)[6] = c("p.value")
  717. }
  718. corrPos = corrPos[order(corrPos[, 3], -corrPos[, 4]), ]
  719. rownames(corrPos) = NULL
  720. res = list(corr = corr, corrPos = corrPos, arg = list(type = type))
  721. invisible(res)
  722. }
  723. ```
  724. ## Results
  725. ### Sample characteristics
  726. Participants diagnosed with major depressive disorder (MDD; *n* = `r nrow(clinicLOOP[clinicLOOP$Group=="MDD",])`) and healthy control (CON) participants (*n* = `r nrow(clinicLOOP[clinicLOOP$Group=="CON",])`) completed the LOOP task in the MRI.
  727. **Supplementary Table 1a**
  728. ```{r, warning=FALSE, message=FALSE}
  729. summary_stats <- group_by(clinicLOOP, Group) %>%
  730. summarise(
  731. age_mean = mean(age, na.rm = TRUE),
  732. BDI_mean = mean(BDI_sum, na.rm = TRUE),
  733. ATQ_mean = mean(ATQ, na.rm = TRUE),
  734. SIAS_mean = mean(SIAS, na.rm = TRUE),
  735. SDQ_mean = mean(selfconcept, na.rm = TRUE),
  736. age_sd = sd(age, na.rm = TRUE),
  737. BDI_sd = sd(BDI_sum, na.rm = TRUE),
  738. ATQ_sd = sd(ATQ, na.rm = TRUE),
  739. SIAS_sd = sd(SIAS, na.rm = TRUE),
  740. SDQ_sd = sd(selfconcept, na.rm = TRUE)
  741. )
  742. # t-tests
  743. # age_tt<-t.test(age ~ Group, data = clinicLOOP)
  744. BDI_tt<-t.test(BDI_sum ~ Group, data = clinicLOOP)
  745. ATQ_tt<-t.test(ATQ ~ Group, data = clinicLOOP)
  746. SIAS_tt<-t.test(SIAS ~ Group, data = clinicLOOP)
  747. SDQ_tt<-t.test(selfconcept ~ Group, data = clinicLOOP)
  748. # effect size
  749. # age_d<-cohens_d(age ~ Group, data = clinicLOOP, hedges.correction = TRUE)
  750. BDI_d<-cohens_d(BDI_sum ~ Group, data = clinicLOOP, hedges.correction = TRUE)
  751. ATQ_d<-cohens_d(ATQ ~ Group, data = clinicLOOP, hedges.correction = TRUE)
  752. SIAS_d<-cohens_d(SIAS ~ Group, data = clinicLOOP, hedges.correction = TRUE)
  753. SDQ_d<-cohens_d(selfconcept ~ Group, data = clinicLOOP, hedges.correction = TRUE)
  754. # Create the table
  755. num=5 # define number of variables
  756. table <- cbind(summary_stats[,1], round(summary_stats[,2:11],2)) %>%
  757. pivot_longer(cols = -Group)
  758. table<- cbind(table[1:num,2:3],table[(num+1):(2*num),3],table[(2*num+1):(3*num),3],table[(3*num+1):(4*num),3])
  759. colnames(table)<-c("n","M1","SD1","M","SD")
  760. table$"n"<-c("Age", "BDI sum", "SIAS mean", "ATQ mean", "SDQ-III mean")
  761. table$t<-c(NA,round(BDI_tt$statistic[[1]],2),round(ATQ_tt$statistic[[1]],2),round(SIAS_tt$statistic[[1]],2),round(SDQ_tt$statistic[[1]],2))
  762. # table$t<-c(round(age_tt$statistic[[1]],2),round(BDI_tt$statistic[[1]],2),round(ATQ_tt$statistic[[1]],2),round(SIAS_tt$statistic[[1]],2),round(SDQ_tt$statistic[[1]],2))
  763. table$p<-c(NA, p(BDI_tt$p.value), p(ATQ_tt$p.value), p(SIAS_tt$p.value), p(SDQ_tt$p.value))
  764. # table$p<-c(p(age_tt$p.value), p(BDI_tt$p.value), p(ATQ_tt$p.value), p(SIAS_tt$p.value), p(SDQ_tt$p.value))
  765. table$d<-c(NA,round(BDI_d$effsize[[1]],2),round(ATQ_d$effsize[[1]],2),round(SIAS_d$effsize[[1]],2),round(SDQ_d$effsize[[1]],2))
  766. # table$d<-c(round(age_d$effsize[[1]],2),round(BDI_d$effsize[[1]],2),round(ATQ_d$effsize[[1]],2),round(SIAS_d$effsize[[1]],2),round(SDQ_d$effsize[[1]],2))
  767. gt(table)|>
  768. tab_header(
  769. title = html("<i> Supplementary Table 1a.</i> Sample characteristics - Group comparison of age and psychometric tests")
  770. ) |>
  771. opt_align_table_header(align = "left")|>
  772. tab_spanner(
  773. label = "CON",
  774. columns = c(M1,SD1)
  775. ) |>
  776. tab_spanner(
  777. label = "MDD",
  778. columns = c(M, SD)
  779. ) |>
  780. tab_spanner(
  781. label = "t-test",
  782. columns = c(t, p, d)
  783. ) |>
  784. cols_label(
  785. n = html(" "),
  786. M1 = html("<i> M"),
  787. SD1 = html("<i> SD"),
  788. M = html("<i> M"),
  789. SD = html("<i> SD"),
  790. t = html("<i>t</i>"),
  791. p = html("<i>p"),
  792. d = html("Cohen's <i>d")
  793. )|>
  794. cols_align(
  795. align = "center"
  796. )|>
  797. tab_footnote(
  798. footnote= html("<i> Note.</i> Group comparison of sample characteristics using two-sample <i>t</i>-test. Beck's depression inventory (BDI-V, items on a 6-point likert scale from zero to five), Automatic Thought Questionnaire (ATQ, items on a 5-point likert scale from one to five), Social Interaction Anxiety scale (SIAS, items on a 5-point likert scale from zero to four), Self-esteem measured with the Self-Description Questionnaire-III (SDQ-III, subscale score). <i>M</i> = mean, <i>SD</i> = standard deviation, <i>t</i> = <i>t</i>-value with Welch correction, <i>d</i> = Cohen's <i>d</i> with Hedges correction. MDD = Major depressive disorder (<i>n</i> = 35), CON = control group (<i>n</i> = 32).")
  799. )|>
  800. gt_layout()
  801. ```
  802. **Supplementary Table 1b**
  803. ```{r, warning=FALSE, message=FALSE, results='asis'}
  804. ## define new variable
  805. clinicLOOP$prior_Self<-rowMeans(select(clinicLOOP,posAbilitySelfprior,negAbilitySelfprior)) #Category-specific estimation ability - self
  806. clinicLOOP$prior_Other<-rowMeans(select(clinicLOOP,posAbilityOtherprior,negAbilityOtherprior)) #Category-specific estimation ability - other
  807. clinicLOOP$prior_CertSelf<-rowMeans(select(clinicLOOP,posCertaintySelfprior,negCertaintySelfprior)) #Confidence of specific estimation ability - self
  808. clinicLOOP$prior_CertOther<-rowMeans(select(clinicLOOP,posCertaintyOtherprior,negCertaintyOtherprior)) #Confidence of specific estimation ability - other
  809. clinicLOOP$prior_EXPSelf<-rowMeans(select(clinicLOOP,EXPselfPos1,EXPselfNeg1)) #Performance expectation rating 1. trial - self
  810. clinicLOOP$prior_EXPOther<-rowMeans(select(clinicLOOP, EXPotherPos1, EXPotherNeg1)) #Performance expectation rating 1. trial - other
  811. clinicLOOP$ExpSelf <- rowMeans(select(clinicLOOP, posExpSelfprior, negExpSelfprior)) #Category-specific estimation experience
  812. clinicLOOP$ImportanceSelf<- rowMeans(select(clinicLOOP, posImportanceSelfprior, negImportanceSelfprior)) #Importance of estimation ability
  813. ## Supplementary Table 1b. Prior beliefs - group comparison
  814. summary_stats <- group_by(clinicLOOP, Group) %>%
  815. summarise(
  816. Sc_estim_mean = mean(selfconcept_estim, na.rm = TRUE),
  817. Sc_estCat_Self = mean(prior_Self, na.rm = TRUE),
  818. cert_estCat_Self = mean(prior_CertSelf, na.rm = TRUE),
  819. Sc_estCat_Other = mean(prior_Other, na.rm = TRUE),
  820. cert_estCat_Other = mean(prior_CertOther, na.rm = TRUE),
  821. Sc_estim_sd = sd(selfconcept_estim, na.rm = TRUE),
  822. Sc_estCat_Self_sd = sd(prior_Self, na.rm = TRUE),
  823. cert_estCat_Self_sd = sd(prior_CertSelf, na.rm = TRUE),
  824. Sc_estCat_Other_sd = sd(prior_Other, na.rm = TRUE),
  825. cert_estCat_Other_sd = sd(prior_CertOther, na.rm = TRUE)
  826. )
  827. # t-tests
  828. prior_estim<-t.test(selfconcept_estim~Group, data=clinicLOOP)
  829. prior_estCat_Self<-t.test(prior_Self~Group, data=clinicLOOP)
  830. cert_estCat_Self<-t.test(prior_CertSelf~Group, data=clinicLOOP)
  831. prior_estCat_Other<-t.test(prior_Other~Group, data=clinicLOOP)
  832. cert_estCat_Other<-t.test(prior_CertOther~Group, data=clinicLOOP)
  833. prior_sc<-t.test(selfconcept~Group, data=clinicLOOP)
  834. prior_t1Self<-t.test(prior_EXPSelf~Group, data=clinicLOOP)
  835. prior_t1Other<-t.test(prior_EXPOther~Group, data=clinicLOOP)
  836. # effect size
  837. prior_estim_d<-cohens_d(selfconcept_estim ~ Group, data = clinicLOOP, hedges.correction = TRUE)
  838. prior_estCat_Self_d<-cohens_d(prior_Self ~ Group, data = clinicLOOP, hedges.correction = TRUE)
  839. cert_estCat_Self_d<-cohens_d(prior_CertSelf ~ Group, data = clinicLOOP, hedges.correction = TRUE)
  840. prior_estCat_Other_d<-cohens_d(prior_Other ~ Group, data = clinicLOOP, hedges.correction = TRUE)
  841. cert_estCat_Other_d<-cohens_d(prior_CertOther ~ Group, data = clinicLOOP, hedges.correction = TRUE)
  842. # Create the table
  843. num=5 # define number of variables
  844. table <- cbind(summary_stats[,1], round(summary_stats[,2:(2*num+1)],2)) %>%
  845. pivot_longer(cols = -Group)
  846. table<- cbind(table[1:num,2:3],table[(num+1):(2*num),3], table[(2*num+1):(3*num),3],table[(3*num+1):(4*num),3])
  847. colnames(table)<-c("n","M1","SD1","M","SD")
  848. table$"n"<-c("Global estimation ability", "Specific estimation ability - self", "Confidence of sp. estimation ability - self", "Specific estimation ability - other", "Confidence of sp. estimation ability - other")
  849. table$t<-c(round(prior_estim$statistic[[1]],2), round(prior_estCat_Self$statistic[[1]],2), round(cert_estCat_Self$statistic[[1]],2), round(prior_estCat_Other$statistic[[1]],2), round(cert_estCat_Other$statistic[[1]],2))
  850. table$p<-c(p(prior_estim$p.value), p(prior_estCat_Self$p.value), p(cert_estCat_Self$p.value), p(prior_estCat_Other$p.value), p(cert_estCat_Other$p.value))
  851. table$d<-c(round(prior_estim_d$effsize[[1]],2),round(prior_estCat_Self_d$effsize[[1]],2),round(cert_estCat_Self_d$effsize[[1]],2),round(prior_estCat_Other_d$effsize[[1]],2),round(cert_estCat_Other_d$effsize[[1]],2))
  852. gt(table) |>
  853. tab_header(
  854. title = html("<i> Supplementary Table 1b.</i> Sample characteristics - Group comparison of prior beliefs about global and specific estimation abilities")
  855. ) |>
  856. opt_align_table_header(align = "left")|>
  857. tab_spanner(
  858. label = "CON",
  859. columns = c(M1,SD1)
  860. ) |>
  861. tab_spanner(
  862. label = "MDD",
  863. columns = c(M, SD)
  864. ) |>
  865. tab_spanner(
  866. label = "t-test",
  867. columns = c(t, p, d)
  868. ) |>
  869. cols_label(
  870. n = html(" "),
  871. M1 = html("<i> M"),
  872. SD1 = html("<i> SD"),
  873. M = html("<i> M"),
  874. SD = html("<i> SD"),
  875. t = html("<i>t</i>"),
  876. p = html("<i>p"),
  877. d = html("Cohen's <i>d")
  878. )|>
  879. cols_align(
  880. align = "center"
  881. )|>
  882. tab_footnote(
  883. footnote= html("<i> Note.</i> Group comparison of self-beliefs and beliefs about the other person rated in a pre-survey prior to the main task. Prior rating of global estimation ability (one item): 'I'm good at estimating,' (8-point Likert scale); mean of specific estimation ability ratings for the two self-related estimation categories (one item per category): 'How good are you at estimating [e.g., the weight of animals]?'; mean of two corresponding confidence ratings: 'How sure are you that your assessment of your ability is correct?'; mean of specific estimation ability ratings for the two other-related estimation categories: 'How good is the other person at estimating [e.g., the height of buildings]?'; mean of two corresponding other-related confidence ratings: 'How sure are you that your assessment of the other person's ability is correct?'. Specific estimation ability ratings on a scale from zero to 100% in comparison to a reference group; confidence ratings on a confidence interval scale from '+/- 50% (very unconfident)' to '+/- 0% (very confident)'. <i>M</i> = mean, <i>SD</i> = standard deviation, <i>t</i> = <i>t</i>-value with Welch correction, <i>d</i> = Cohen's <i>d</i> with Hedges correction. MDD = Major depressive disorder (<i>n</i> = 35), CON = control group (<i>n</i> = 32).")
  884. )|>
  885. gt_layout()
  886. ```
  887. **Supplementary Note 3: Group differences in global but not in specific prior beliefs**\
  888. Before comparing the process of belief formation between the two groups, we checked if there were already group differences in participants' prior beliefs regarding their estimation abilities. While individuals with depression showed a lower evaluation of the own abilities in general (*SDQ-III*, *t*(`r round(prior_sc$parameter[[1]],0)`) = `r round(prior_sc$statistic[[1]],2)`, *p* `r p_txt(prior_sc$p.value)`) as well as their general estimation abilities before the task (*t*(`r round(prior_estim$parameter[[1]],0)`) = `r round(prior_estim$statistic[[1]],2)`, *p* = `r p_txt(prior_estim$p.value)`). However, when asking more specifically for the performance in a certain estimation category or even more specific for the performance expectation in the upcoming first trail there were no group difference, neither for self (category-specific estimation ability: *t*(`r round(prior_estCat_Self$parameter[[1]],0)`) = `r round(prior_estCat_Self$statistic[[1]],2)`, *p* = `r p_txt(prior_estCat_Self$p.value)`; 1. performance expectation rating: *t*(`r round(prior_t1Self$parameter[[1]],0)`) = `r round(prior_t1Self$statistic[[1]],2)`, *p* = `r p_txt(prior_t1Self$p.value)`) nor for other-related prior beliefs (category-specific estimation ability: *t*(`r round(prior_estCat_Other$parameter[[1]],0)`) = `r round(prior_estCat_Other$statistic[[1]],2)`, *p* = `r p_txt(prior_estCat_Other$p.value)`; 1. performance expectation rating: *t*(`r round(prior_t1Other$parameter[[1]],0)`) = `r round(prior_t1Other$statistic[[1]],2)`, *p* = `r p_txt(prior_t1Other$p.value)`). This allows for a comparison of the learning process between groups independently of the prior beliefs.
  889. **Supplementary Table 1c**
  890. ```{r, warning=FALSE, message=FALSE}
  891. summary_stats <- group_by(clinicLOOP, Group) %>%
  892. summarise(
  893. ExpSelf_mean = mean(ExpSelf, na.rm = TRUE),
  894. ImportanceSelf_mean = mean(ImportanceSelf, na.rm = TRUE),
  895. knowOther_mean= mean(knowOther, na.rm = TRUE),
  896. likeOther1pre_mean= mean(likeOther1pre, na.rm = TRUE),
  897. likeOther2pre_mean= mean(likeOther2pre, na.rm = TRUE),
  898. ExpSelf_sd = sd(ExpSelf, na.rm = TRUE),
  899. ImportanceSelf_sd = sd(ImportanceSelf, na.rm = TRUE),
  900. knowOther_sd= sd(knowOther, na.rm = TRUE),
  901. likeOther1pre_sd= sd(likeOther1pre, na.rm = TRUE),
  902. likeOther2pre_sd= sd(likeOther2pre, na.rm = TRUE)
  903. )
  904. # t-tests
  905. ExpSelf <-t.test(ExpSelf ~ Group, data=clinicLOOP)
  906. ImportanceSelf <-t.test(ImportanceSelf ~ Group, data=clinicLOOP)
  907. knowOther <-t.test(knowOther~Group, data=clinicLOOP)
  908. likeOther1pre<-t.test(likeOther1pre~Group, data=clinicLOOP)
  909. likeOther2pre<-t.test(likeOther2pre~Group, data=clinicLOOP)
  910. # effect size
  911. ExpSelf_d<-cohens_d(ExpSelf ~ Group, data = clinicLOOP, var.equal = TRUE, hedges.correction = TRUE)
  912. ImportanceSelf_d<-cohens_d(ImportanceSelf ~ Group, data = clinicLOOP, var.equal = TRUE, hedges.correction = TRUE)
  913. knowOther_d<-cohens_d(knowOther ~ Group, data = clinicLOOP, var.equal = TRUE, hedges.correction = TRUE)
  914. likeOther1pre_d<-cohens_d(likeOther1pre ~ Group, data = clinicLOOP, var.equal = TRUE, hedges.correction = TRUE)
  915. likeOther2pre_d<-cohens_d(likeOther2pre ~ Group, data = clinicLOOP, var.equal = TRUE, hedges.correction = TRUE)
  916. # Create the table
  917. num=5 # define number of variables
  918. table <- cbind(summary_stats[,1], round(summary_stats[,2:(2*num+1)],2)) %>%
  919. pivot_longer(cols = -Group)
  920. table<- cbind(table[1:num,2:3],table[(num+1):(2*num),3],table[(2*num+1):(3*num),3],table[(3*num+1):(4*num),3])
  921. colnames(table)<-c("n","M1","SD1","M","SD")
  922. table$"n"<-c("Category-specific estimation experience", "Importance of estimation ability", "Familiarity of the other person", "Likeability of other person", "Estimated own likeability rated by other")
  923. table$t<-c(round(ExpSelf$statistic[[1]],2), round(ImportanceSelf$statistic[[1]],2), round(knowOther$statistic[[1]],2), round(likeOther1pre$statistic[[1]],2), round(likeOther2pre$statistic[[1]],2))
  924. table$p<-c(p(ExpSelf$p.value), p(ImportanceSelf$p.value), p(knowOther$p.value), p(likeOther1pre$p.value), p(likeOther2pre$p.value))
  925. table$d<-c(round(ExpSelf_d$effsize[[1]],2),round(ImportanceSelf_d$effsize[[1]],2),round(knowOther_d$effsize[[1]],2),round(likeOther1pre_d$effsize[[1]],2),round(likeOther2pre_d$effsize[[1]],2))
  926. gt(table) |>
  927. tab_header(
  928. title = html("<i> Supplementary Table 1c.</i> Sample characteristics - Group comparison of setting characteristics regarding the estimation tasks and the other person prior to the task")
  929. ) |>
  930. opt_align_table_header(align = "left")|>
  931. tab_spanner(
  932. label = "CON",
  933. columns = c(M1,SD1)
  934. ) |>
  935. tab_spanner(
  936. label = "MDD",
  937. columns = c(M, SD)
  938. ) |>
  939. tab_spanner(
  940. label = "t-test",
  941. columns = c(t, p, d)
  942. ) |>
  943. cols_label(
  944. n = html(" "),
  945. M1 = html("<i> M"),
  946. SD1 = html("<i> SD"),
  947. M = html("<i> M"),
  948. SD = html("<i> SD"),
  949. t = html("<i>t</i>"),
  950. p = html("<i>p"),
  951. d = html("Cohen's <i>d")
  952. )|>
  953. cols_align(
  954. align = "center"
  955. )|>
  956. tab_footnote(
  957. footnote= html("<i> Note.</i> Group differences in previous experience, importance of estimating, and attitude towards the other person. All characteristics were rated on one item each on a 7-point likert scale in a pre-survey prior to the main task. Item wordings: 1. 'How much experience do you have with estimating [e.g. the weight of animals]?', 2. 'How important is it to you to be good at estimating [e.g., the weight of animals]?', 3. 'How well do you know the other person?', 4. 'I like the other person.', 5. 'I think the other person finds me likable.'. <i>M</i> = mean, <i>SD</i> = standard deviation, <i>t</i> = <i>t</i>-value with Welch correction, <i>d</i> = Cohen's <i>d</i> with Hedges correction. MDD = Major depressive disorder (<i>n</i> = 35), CON = control group (<i>n</i> = 32).")
  958. )|>
  959. gt_layout()
  960. ```
  961. ### Negativity bias in self-belief formation
  962. ```{r, warning=FALSE, message=FALSE}
  963. lr<-data.frame(select(clinicLOOP, a_posSelf, b_negSelf, c_posOther, d_negOther, subj, Group))
  964. lrLong<-reshape2::melt(lr, id.vars=c("subj", "Group"), variable.name="PEcondition", value.name = "learningRates")
  965. lrLong$Valence<-factor(c(rep(1, nrow(lr)), rep(-1,nrow(lr)),rep(1, nrow(lr)), rep(-1,nrow(lr))), labels=c("neg","pos"))
  966. lrLong$Agent<-factor(c(rep(1, 2*nrow(lr)), rep(-1,2*nrow(lr))), labels=c("other", "self"))
  967. # Model-based analysis of learning rates - group comparison
  968. lrGLM <- lme(
  969. learningRates ~ Valence * Agent * Group,
  970. random = list(subj = pdDiag(~ Valence + Agent)),
  971. data = lrLong,
  972. method = "ML"
  973. )
  974. lrGLM_ci <- intervals(lrGLM, level = 0.95,which = c("fixed"))
  975. #post-hoc t-test LR self
  976. lrSelf <- lrLong[lrLong$Agent == "self",]
  977. lrSelf_pos <- lrSelf[lrSelf$Valence == "pos", "learningRates"]
  978. lrSelf_neg <- lrSelf[lrSelf$Valence == "neg", "learningRates"]
  979. lr_tt<-t.test(lrSelf_neg, lrSelf_pos, paired=T)
  980. ```
  981. Consistent with our previous studies, the winning model for both the depression and healthy control groups showed higher learning rates for negative compared to positive prediction errors in forming novel self-beliefs. This negativity bias was not present when participants formed beliefs about the other person's ability (PE-Valence x Agent interaction: *t*(`r summary(lrGLM)$tTable[5,3]`) = `r round(summary(lrGLM)$tTable[5,4],2)`, *p* = `r p_txt(summary(lrGLM)$tTable[5,5])`); Supplementary Table 5; negativity bias: post-hoc a~Self/PE-~ vs a~Self/PE+~; *t*(`r lr_tt$parameter[["df"]]`) = `r round(lr_tt$statistic[["t"]],2)`, *p* `r p_txt(lr_tt[["p.value"]])`).
  982. **Supplementary Table 5**
  983. ```{r, warning=FALSE, message=FALSE}
  984. ## Supplementary Table 2. Model-based analysis of belief updating behavior (learning rates)
  985. tbl<-data.frame(pred=c("(Intercept)", "PE-Valence [PE+]", "Agent [Self]", "Group", "PE-Valence x Agent", "PE-Valence x Group", "Agent x Group", "PE-Valence x Agent x Group"), summary(lrGLM)$tTable)
  986. tbl$Value<-round(tbl$Value,2)
  987. tbl$Std.Error<-round(tbl$Std.Error,2)
  988. tbl$lower<-round(lrGLM_ci$fixed[,1],2)
  989. tbl$upper<-round(lrGLM_ci$fixed[,3],2)
  990. tbl$t.value<-round(tbl$t.value,2)
  991. tbl$p.value<-p(tbl$p.value)
  992. tbl <- relocate(tbl,lower:upper, .before = `DF`)
  993. gt(tbl)|>
  994. tab_header(
  995. title = html("<i>Supplementary Table 5.</i> Model-based analysis of belief updating behavior (learning rates) in individuals with and without depression")
  996. )|>
  997. opt_align_table_header(align = "left")|>
  998. cols_label(
  999. pred = html(" "),
  1000. Value = html("<i> Estimate"),
  1001. Std.Error = html("<i> SE"),
  1002. DF = html("<i> df"),
  1003. t.value = html("<i> t"),
  1004. p.value = html("<i> p")
  1005. )|>
  1006. tab_spanner(
  1007. label = html("95% CI"),
  1008. columns = c(lower:upper)
  1009. )|>
  1010. cols_align(
  1011. align = "center"
  1012. )|>
  1013. tab_footnote(
  1014. footnote= html("<i> Note.</i> Prediction Error Valence (PE-Valence, [PE+, PE-]) x Agent [Self, Other] x Group [MDD, CON] linear mixed-effects model fit by maximum likelihood. Dependent variable: learning parameters of the winning model. Beta-estimate, <i>SE</i> = standard error, <i>CI</i> = confidence interval, <i>df</i> = degrees of freedom, <i>t</i> = t-value, MDD = Major depressive disorder (n = 35), CON = control group (n = 32).")
  1015. )|>
  1016. gt_layout()
  1017. ```
  1018. **Supplementary Figure 3A: Residuals vs. fitted values for the mixed-effects model on learning rates**
  1019. ```{r, warning=FALSE, message=FALSE}
  1020. plot(fitted(lrGLM), resid(lrGLM),
  1021. xlab = "Fitted values",
  1022. ylab = "Residuals")
  1023. abline(h = 0, col = "blue")
  1024. ```
  1025. **Supplementary Figure 3B: Q-Q plot of residuals for the mixed-effects model on learning rates**
  1026. ```{r, warning=FALSE, message=FALSE}
  1027. qqnorm(resid(lrGLM))
  1028. qqline(resid(lrGLM), col = "blue")
  1029. ```
  1030. **Supplementary Table 4.**
  1031. ```{r, warning=FALSE, message=FALSE}
  1032. LOOsAll<-select(clinicLOOP,Group,contains("LOO_"))
  1033. KsAll<-select(clinicLOOP,Group,contains("k_"))
  1034. LOOs<-c(colSums(LOOsAll[,2:9]), colSums(LOOsAll[LOOsAll$Group=="MDD",2:9]),
  1035. colSums(LOOsAll[LOOsAll$Group=="CON",2:9]))
  1036. LOOsSD<-c(sapply(LOOsAll[,2:9],var), sapply(LOOsAll[LOOsAll$Group=="MDD",2:9],var), sapply(LOOsAll[LOOsAll$Group=="CON",2:9],var))
  1037. LOOsSD<-c(sapply(X=LOOsSD[1:8], FUN = function(X) sqrt(X*nrow(LOOsAll))),sapply(X=LOOsSD[9:16], FUN = function(X) sqrt(X*nrow(LOOsAll[LOOsAll$Group=="MDD",]))),sapply(X=LOOsSD[17:24], FUN = function(X) sqrt(X*nrow(LOOsAll[LOOsAll$Group=="CON",]))))
  1038. LOOsDiff<-c(sapply(X=LOOs[1:8], FUN = function(X) X-LOOs[8]),sapply(X=LOOs[9:16], FUN = function(X) X-LOOs[16]),sapply(X=LOOs[17:24], FUN = function(X) X-LOOs[24]))
  1039. Ks<-c(colSums(KsAll[,2:9]), colSums(KsAll[KsAll$Group=="MDD",2:9]),
  1040. colSums(KsAll[KsAll$Group=="CON",2:9]))*100/(nrow(clinicLOOP)*80)
  1041. LOOTable<-data.frame(
  1042. modelCat<-c(" ","S = O"," "," ","S &ne; O"," "," "," ", " ","S = O"," "," ","S &ne; O"," "," "," ", " ","S = O"," "," ","S &ne; O"," "," "," "),
  1043. model<-c("Mean Model (M0)","Unity Model (M1)","Ability Mode (M3)","Valence Model (M2)","Unity Model (M4)","Ability Model (M7)","Valence Model (M5)","Wighted Valence Model (M6)", "Mean Model (M0)","Unity Model (M1)","Ability Model (M3)","Valence Model (M2)","Unity Model (M4)","Ability Model (M7)","Valence Model (M5)","Wighted Valence Model (M6)", "Mean Model (M0)","Unity Model (M1)","Ability Model (M3)","Valence Model (M2)","Unity Model (M4)","Ability Model (M7)","Valence Model (M5)","Wighted Valence Model (M6)"),
  1044. LOO<-round(LOOs,1),
  1045. SD<-round(LOOsSD,2),
  1046. LOOsDiff<-round(LOOsDiff,1),
  1047. Ks<-round(Ks,2),paraNum<-c(4,5,6,6,6,8,8,9),
  1048. group<-c(rep("Whole sample",8),rep("MDD",8),rep("CON",8))
  1049. )
  1050. colnames(LOOTable)<-c("modelCat", "Model", "LOO","SD","Diff", "k","paraNum","group")
  1051. # sort rows
  1052. LOOTable$order<-c(1,2,4,3,5,8,6,7,9,10,12,11,13,16,14,15,17,18,20,19,21,24,22,23)
  1053. LOOTable<-LOOTable[order(LOOTable$order,decreasing = F),]
  1054. LOOTable<- subset(LOOTable, select = -order)
  1055. gt(LOOTable,groupname_col = "group")|>
  1056. tab_header(
  1057. title = html("<i> Supplementary Table 4. Model comparison")
  1058. )|>
  1059. fmt_markdown(
  1060. columns = modelCat
  1061. )|>
  1062. opt_align_table_header(align = "left")|>
  1063. cols_label(
  1064. modelCat = html("<i> Model"),
  1065. Model = html(" "),
  1066. LOO = html("<i> PSIS-LOO"),
  1067. SD = html("<i> LOO-SD"),
  1068. Diff = html("<i> LOO-Diff"),
  1069. k = html("<i> % of k > 0.7"),
  1070. paraNum = html("<i> No. Est. Parameters")
  1071. )|>
  1072. tab_footnote(
  1073. footnote= html("<i> Note.</i> LOO = sum PSIS-LOO, approximate leave-one-out cross-validation (LOO) using Pareto-smoothed importance sampling (PSIS); LOO-SE = Standard error of PSIS-LOO; LOO-Diff (SE-Diff) = Difference in expected predictive accuracy (PSIS-LOO) for all models from the model with the highest PSIS-LOO (wighted Valence Model) and standard errors of differences; percentage of <i>k</i>-estimated shape parameters of the generalized Pareto distribution - exceeding 0.7 (all according to Vehtari et al.1); No. Est. Parameters = number of estimated parameters in the model; S = O: same learning rates for Self and Other, S &ne; O: separate learning rates for Self and Other, MDD = Major depressive disorder (n = 35), CON = control group (n = 32).")
  1074. )|>
  1075. gt_layout()
  1076. ```
  1077. ### No learning differences between individuals with depression and healthy controls
  1078. When comparing learning rates between the two groups, there was no difference in the overall extent of learning (main effect Group: *t*(`r summary(lrGLM)$tTable[4,3]`) = `r round(summary(lrGLM)$tTable[4,4],2)`, *p* = `r p_txt(summary(lrGLM)$tTable[4,5])`) and no difference in the extent of the negativity bias (PE-Valence x Agent x Group interaction: *t*(`r summary(lrGLM)$tTable[8,3]`) = `r round(summary(lrGLM)$tTable[8,4],2)`, *p* = `r p_txt(summary(lrGLM)$tTable[8,5])`; Fig. 1B and C, Supplementary Table 5). This is in line with the analysis of the expectation ratings in a model-agnostic approach (Supplementary Note 4, Supplementary Table 2). It suggests that people diagnosed with depression do not differ from healthy controls when forming novel beliefs in response to self-related performance feedback.
  1079. **Predicted and actual ratings of expected performance for both groups over time (Figure 1B)**
  1080. ```{r, warning=FALSE, message=FALSE}
  1081. EXP<-data.frame(select(clinicLOOP,subj, Group,contains("EXPselfPos"),contains("EXPselfNeg"), contains("EXPotherPos"), contains("EXPotherNeg"),starts_with("X")))
  1082. # prepare data for EXP ratings plot
  1083. expMean<-data.frame(expRating=c(colMeans(EXP[EXP$Group=="MDD",3:ncol(EXP)]),colMeans(EXP[EXP$Group=="CON",3:ncol(EXP)])))
  1084. expMean$model<-factor(c(rep(c(rep(1,80),rep(2,80)),2)),labels=c("data","model"))
  1085. expMean$groupCond<-factor(c(rep(c(rep(1,20),rep(2,20)),4),rep(c(rep(3,20),rep(4,20)),4)),labels=c("MDD-High","MDD-Low","CON-High","CON-Low"))
  1086. expMean$trial<-rep(1:20,16)
  1087. expMean$condition<-sort(rep(1:16,20),decreasing = T)
  1088. # plot ratings of expected performance over time
  1089. ggplot(expMean, aes(x=trial,y=expRating, group=condition)) +
  1090. geom_line(aes(color=groupCond, linetype=model), linewidth=1.5)+
  1091. labs(y="Performance expectation", x="Trial") +
  1092. labs(linetype = "model") +
  1093. labs(colour = "groupCond") +
  1094. scale_linetype_discrete(labels = c('Data', 'Winning Model'))+
  1095. scale_color_manual(values=c("#23538d","#c00000","#558ed5","#e69999"),
  1096. labels = c("MDD-High","MDD-Low","CON-High","CON-Low"))+
  1097. theme_bw()+
  1098. snl_theme()+
  1099. theme(legend.position="right", legend.text=element_text(size=12))
  1100. ```
  1101. **Learning rates of the winning model for both groups (Figure 1C)**
  1102. ```{r, warning=FALSE, message=FALSE}
  1103. lrLong$Val_Group<-factor(c(rep(3,35), rep(1,32),rep(4,35), rep(2,32),rep(7,35), rep(5,32),rep(8,35), rep(6,32)), labels=c("CON_PE+(Self)","CON_PE-(Self)","MDD_PE+(Self)", "MDD_PE-(Self)","CON_PE+(Other)","CON_PE-(Other)","MDD_PE+(Other)", "MDD_PE-(Other)"))
  1104. set.seed((1))
  1105. ggplot(data = lrLong, aes(y = learningRates, x = Group, fill = Val_Group)) +
  1106. geom_point(aes(color=Val_Group), position = position_jitterdodge (dodge.width = 0.75, jitter.width = 0.5), size=2, alpha = 0.8) +
  1107. geom_boxplot(lwd=1, outlier.shape = NA, alpha = 0.5, position = position_dodge(width = 0.75), width = .6,
  1108. color = "black") +
  1109. labs(y="Learning rate") +
  1110. guides(fill= "none")+
  1111. scale_color_manual(values=c("#558ed5","#e69999","#23538d","#c00000","#558ed5","#e69999","#23538d","#c00000","#558ed5","#e69999","#23538d","#c00000","#558ed5","#e69999","#23538d","#c00000"))+
  1112. scale_fill_manual(values=c("#558ed5","#e69999","#23538d","#c00000","#558ed5","#e69999","#23538d","#c00000","#558ed5","#e69999","#23538d","#c00000","#558ed5","#e69999","#23538d","#c00000"))+
  1113. theme_bw()+
  1114. snl_theme()+
  1115. theme(axis.title.x = element_blank(),axis.text.x = element_text(face="bold",size = 18, color="black"),legend.text=element_text(size=12),legend.key.size = unit(2,"point"))
  1116. ```
  1117. **Supplementary Note 4: Model-agnostic behavioral analyses**
  1118. ```{r, warning=FALSE, message=FALSE}
  1119. # prepare data set for model-agnostic analysis
  1120. EXP<-data.frame(select(clinicLOOP,subj, Group,contains("EXPselfPos"),contains("EXPselfNeg"), contains("EXPotherPos"), contains("EXPotherNeg")))
  1121. EXPLong<-reshape2::melt(EXP,id.vars=c("subj", "Group"),value.name=("expRating"))
  1122. EXPLong$agent<-factor(c(rep(1,40*nrow(EXP)),rep(-1,40*nrow(EXP))),labels=c("other","self"))
  1123. EXPLong$ability<-factor(c(rep(1,20*nrow(EXP)),rep(-1,20*nrow(EXP)),rep(1,20*nrow(EXP)),rep(-1,20*nrow(EXP))),labels=c("low","high"))
  1124. EXPLong$trial<-sort(rep(1:20,nrow(EXP)))
  1125. # Model-free analysis of performance expectation ratings - group comparison (mixed-effect model)
  1126. EXPmodel <- lme(
  1127. expRating ~ ability * agent * trial * Group,
  1128. random = ~ 1 + ability + agent + trial | subj,
  1129. data = EXPLong,
  1130. method = "ML"
  1131. )
  1132. # confidence intervals
  1133. EXPmodel_ci <- intervals(EXPmodel, level = 0.95,which = c("fixed"))
  1134. ```
  1135. We performed a model-agnostic analysis on our performance expectation ratings over time to capture the basic effects of belief updating in our observed data and compare them between the two groups. The model included the factors Ability (High/Low) x Agent (Self/Other) x Group (MDD/CON) and Trial (20 trials) as a continuous predictor. Intercept, Ability, Agent, Trial, and Group were modeled as fixed effects. Random intercepts and random slopes for all within-subject factors (Ability, Agent, and Trial) were included for each participant. Model assumptions,
  1136. including normality of residuals and homoscedasticity, were visually inspected,
  1137. and no major violations were observed (see Supplementary Fig. 1). The linear
  1138. mixed model showed a significant main effect of Ability condition (*t*(`r summary(EXPmodel)$tTable[2,3]`) = `r round(summary(EXPmodel)$tTable[2,4],2)`, *p* `r p_txt(summary(EXPmodel)$tTable[2,5])`) and interaction of Trial x Ability condition (*t*(`r summary(EXPmodel)$tTable[7,3]`) = `r round(summary(EXPmodel)$tTable[7,4],2)`, *p* `r p_txt(summary(EXPmodel)$tTable[7,5])`), indicating that participants adapted their performance expectation ratings according to the presented feedback in each Ability condition (see Fig. 1B). Moreover, there was a trend-wise effect for Agent (*t*(`r summary(EXPmodel)$tTable[3,3]`) = `r round(summary(EXPmodel)$tTable[3,4],2)`, *p* = `r p_txt(summary(EXPmodel)$tTable[3,5])`) and a significant interaction of Trial x Agent (*t*(`r summary(EXPmodel)$tTable[8,3]`) = `r round(summary(EXPmodel)$tTable[8,4],2)`, *p* = `r p_txt(summary(EXPmodel)$tTable[8,5])`), indicating that participants evaluated their own performance increasingly more negatively over time than the other's performance. The main effect Group and all interactions including Group were not significant (for a full results table, see Supplementary Table 2).
  1139. **Supplementary Figure 1A: Residuals vs. fitted values for the behavioral mixed-effects model**
  1140. ```{r, warning=FALSE, message=FALSE}
  1141. plot(fitted(EXPmodel), resid(EXPmodel),
  1142. xlab = "Fitted values",
  1143. ylab = "Residuals")
  1144. abline(h = 0, col = "blue")
  1145. ```
  1146. **Supplementary Figure 1B: Q-Q plot of residuals for the behavioral mixed-effects model**
  1147. ```{r, warning=FALSE, message=FALSE}
  1148. qqnorm(resid(EXPmodel))
  1149. qqline(resid(EXPmodel), col = "blue")
  1150. ```
  1151. **Supplementary Table 2**
  1152. ```{r, warning=FALSE, message=FALSE}
  1153. tbl<-data.frame(pred=c("(Intercept)", "Ability [High]", "Agent [Self]", "Trial", "Group [MDD]", "Ability x Agent", "Ability x Trial", "Agent x Trial", "Ability x Group", "Agent x Group", "Trial x Group", "Ability x Agent x Trial", "Ability x Agent x Group", "Ability x Trial x Group", "Agent x Trial x Group", "Ability x Agent x Trial x Group"), summary(EXPmodel)$tTable)
  1154. tbl$Value<-round(tbl$Value,2)
  1155. tbl$Std.Error<-round(tbl$Std.Error,2)
  1156. tbl$lower <- round(EXPmodel_ci$fixed[,1],2)
  1157. tbl$upper <- round(EXPmodel_ci$fixed[,3],2)
  1158. tbl$t.value<-round(tbl$t.value,2)
  1159. tbl$p.value<-p(tbl$p.value)
  1160. tbl <- relocate(tbl,lower:upper, .before = `DF`)
  1161. gt(tbl)|>
  1162. tab_header(
  1163. title = html("<i> Supplementary Table 2. Model-agnostic analysis of belief updating behavior in individuals with and without depression")
  1164. )|>
  1165. opt_align_table_header(align = "left"
  1166. )|>
  1167. cols_label(
  1168. pred = html(" "),
  1169. Value = html("<i> Estimate"),
  1170. Std.Error = html("<i> SE"),
  1171. DF = html("<i> df"),
  1172. t.value = html("<i> t"),
  1173. p.value = html("<i> p")
  1174. )|>
  1175. tab_spanner(
  1176. label = html("95% CI"),
  1177. columns = c(lower:upper)
  1178. )|>
  1179. cols_align(
  1180. align = "center"
  1181. )|>
  1182. tab_footnote(
  1183. footnote= html("<i> Note.</i> Trial (continuous, 1-20) x Agent [Self, Other] x Ability condition [High, Low] x Group [MDD, CON] linear mixed-effects model fit by maximum likelihood. Dependent variable: trial-by-trial ratings of expected performance. Beta-estimate, <i>SE</i> = standard error, <i>CI</i> = confidence interval, <i>df</i> = degrees of freedom, <i>t</i> = t-value, MDD = Major depressive disorder (<i>n</i> = 35), CON = control group (<i>n</i> = 32).")
  1184. )|>
  1185. gt_layout(
  1186. )
  1187. ```
  1188. ### Disregard of positive feedback with higher symptom burden
  1189. **Dimension reduction to obtain a summary measure of psychopathology**
  1190. ```{r}
  1191. ## PCA to create an overall psychopathology score
  1192. PCA<-principal(select(clinicLOOP, selfconcept, BDI_sum, ATQ, SIAS),
  1193. residuals = FALSE,rotate="varimax", covar=FALSE,oblique.scores=TRUE)
  1194. # add score to data set
  1195. clinicLOOP$psychPath<-PCA$scores
  1196. ```
  1197. **Factor loadings of the psychopathology score (Figure 1D)**
  1198. ```{r}
  1199. # create plot with factor loadings
  1200. l=data.frame(loadings=loadings(PCA)[],var=c("SDQ-III", "BDI","ATQ","SIAS"))
  1201. ggplot(l, aes(x=var, y=PC1)) +
  1202. ylab("Factor loadings") +
  1203. geom_bar(color="black", lwd=2, fill="grey", position = "dodge", width=0.75, stat = "identity")+
  1204. geom_hline(yintercept=0, lwd=2)+
  1205. scale_y_continuous(breaks = seq(-1, 1, .25), limits = c(-1, 1)) +
  1206. theme_bw()+
  1207. snl_theme()+
  1208. theme(axis.title.x = element_blank())
  1209. ```
  1210. **Output PCA**
  1211. ```{r, echo=F}
  1212. PCA
  1213. ```
  1214. **Disregard of positive information in association with psychopathology**
  1215. ```{r, warning=FALSE, message=FALSE}
  1216. ## create correlation matrix (Learning rates [aPE+, aPE-], Psychopathology score for MDD group
  1217. corMat<-as.matrix(select(clinicLOOP[clinicLOOP$Group=="MDD",], a_posSelf, b_negSelf, psychPath, BDI_sum)) # add any 4. variable for a 4. column (will be overwritten)
  1218. colnames(corMat)<- c("aPE+", "aPE-","MDD", "CON")
  1219. corPat<-rcorr(corMat,type = "spearman")
  1220. # CON group
  1221. corMat<-as.matrix(select(clinicLOOP[clinicLOOP$Group=="CON",], a_posSelf, b_negSelf, psychPath, BDI_sum))
  1222. colnames(corMat)<- c("aPE+", "aPE-","Psychopathology", " ")
  1223. corCon<-rcorr(corMat,type = "spearman")
  1224. # combine values from LR/ Psychopathology correlation in one matrix
  1225. corPat$r[,4]<-corCon$r[,3]
  1226. corPat$P[,4]<-corCon$P[,3]
  1227. corPat$n[,4]<-corCon$n[,3]
  1228. ## compare correlation coefficients
  1229. # Learning rates PE+ vs PE- - Self
  1230. compCorSelf=cocor.indep.groups(r1.jk=abs(corPat$r[1,3]), r2.hm=abs(corPat$r[2,3]), n1=nrow(clinicLOOP[clinicLOOP$Group=="MDD",]), n2=nrow(clinicLOOP[clinicLOOP$Group=="CON",]), alternative="two.sided", alpha=0.05, conf.level=0.95, null.value=0)
  1231. ```
  1232. Within the clinical sample, symptom burden was associated with reduced self-belief updating following positive prediction errors (MDD: positive learning rate *r*a~Self/PE+~= `r round(corPat$r[1,3],2)`, *p*= `r p_txt(corPat$P[1,3])`*;* for comparison, negative learning rate *r*a~Self/PE-~= `r round(corPat$r[2,3],2)`, *p*= `r p_txt(corPat$P[2,3])`; difference of absolute values: *z* = `r round(compCorSelf@fisher1925[["statistic"]],2)`, *p* = `r p_txt(compCorSelf@fisher1925[["p.value"]])` ; Fig. 1E, Supplementary Fig. 5. For more detailed correlations with symptom scores, see Supplementary Fig. 6). This indicates that individuals with higher symptom burden integrate positive feedback less, while learning from negative feedback remains unaffected.
  1233. **Figure 1E**
  1234. ```{r, warning=FALSE, message=FALSE}
  1235. ggplot(clinicLOOP[clinicLOOP$Group=="MDD",],aes(x=psychPath, y=a_posSelf)) +
  1236. geom_smooth(method=lm, color="#23538d", fill="#23538d", se=T, lwd=1.5) +
  1237. geom_point(color="#23538d", size=3) +
  1238. ggtitle("MDD sample") +
  1239. labs(x="Psychopathology score",y="Positive learning rate - Self") +
  1240. theme_bw()+
  1241. snl_theme()
  1242. ```
  1243. ```{r, echo=FALSE, warning=FALSE, message=FALSE}
  1244. cor<-corr.test(clinicLOOP[clinicLOOP$Group=="MDD",]$psychPath, clinicLOOP[clinicLOOP$Group=="MDD",]$a_posSelf,method="spearman",
  1245. alpha=.05,ci=TRUE)
  1246. ```
  1247. *r~SP~*= `r round(cor[["r"]],2)` \[`r round(cor[["ci"]]$lower,2)`,`r round(cor[["ci"]]$upper,2)`\], *p* = `r p_txt(cor[["p"]])`
  1248. **Supplementary Figure 5: Association of self-related learning rates and psychopathology scores separately for both groups**
  1249. ```{r, warning=FALSE, message=FALSE}
  1250. corrplot(corPat$r[1:2,3:4], method="color", col=col(200),
  1251. type="full",
  1252. addCoef.col = "black", # Add coefficient of correlation
  1253. tl.col="black", tl.srt=60, tl.cex= 1.7, number.cex=2, #Text label color and rotation
  1254. # Combine with significance
  1255. p.mat = corPat$P[1:2,3:4], sig.level = 0.05, insig = "label_sig",
  1256. pch.cex = 3,
  1257. # hide correlation coefficient on the principal diagonal
  1258. diag=T,
  1259. cl.pos="n", main="Within-group psychopathology score",
  1260. mar=c(0,0,2,0))
  1261. ```
  1262. ```{r, warning=FALSE, message=FALSE}
  1263. pvals <- corPat$P[1:2, 3:4]
  1264. colnames(pvals) <- c("MDDgr","CONgr")
  1265. pvals_fdr_pepos <- p.adjust(pvals[1,], method = "fdr")
  1266. pvals_fdr_peneg <- p.adjust(pvals[2,], method = "fdr")
  1267. pvals_fdr <- rbind(pvals_fdr_pepos, pvals_fdr_peneg)
  1268. # pvals_fdr <- matrix(p.adjust(pvals, method = "fdr"), nrow = nrow(pvals))
  1269. rownames(pvals_fdr) <- rownames(pvals)
  1270. colnames(pvals_fdr) <- colnames(pvals)
  1271. # Combine into one data frame
  1272. p_table <- as.data.frame(pvals) %>%
  1273. tibble::rownames_to_column("Variable")
  1274. # Add FDR columns
  1275. for (col in colnames(pvals)) {
  1276. p_table[[paste0(col, "_FDR")]] <- pvals_fdr[, col]
  1277. }
  1278. p_table <- relocate(p_table,MDDgr_FDR, .before = `CONgr`)
  1279. # Round
  1280. p_table <- p_table %>%
  1281. mutate(across(-Variable, ~ sprintf("%.3f", .)))
  1282. col <- colorRampPalette(c("#BB4444", "#EE9988", "#FFFFFF", "#77AADD", "#4477AA"))
  1283. # Create a gt table
  1284. gt(p_table) |>
  1285. tab_header(
  1286. title = html("<i>P</i>-values supplementary figure 1")
  1287. ) |>
  1288. cols_label(
  1289. Variable = html(" "),
  1290. MDDgr = html("<i> p"),
  1291. MDDgr_FDR = html("<i>p</i> (FDR)"),
  1292. CONgr = html("<i> p"),
  1293. CONgr_FDR = html("<i>p</i> (FDR)")
  1294. ) |>
  1295. opt_align_table_header(align = "left")|>
  1296. tab_spanner(
  1297. label = "MDD",
  1298. columns = c(MDDgr,MDDgr_FDR)
  1299. ) |>
  1300. tab_spanner(
  1301. label = "CON",
  1302. columns = c(CONgr, CONgr_FDR)
  1303. )|>
  1304. cols_align(
  1305. align = "center"
  1306. )|>
  1307. gt_layout()
  1308. ```
  1309. *Supplementary Figure 5.* Spearman correlations between self-related learning rates for positive (aPE+) and negative prediction errors (aPE-) and Psychopathology score for MDD and CON group. MDD = Major depressive disorder, CON = Control, \* *p* \< .05.
  1310. **Supplementary Figure 6: Association between learning rates and symptom scores separately for both groups**
  1311. ```{r, warning=FALSE, message=FALSE}
  1312. ## create correlation matrix with symptom scores separately
  1313. # MDD group
  1314. corMat<-as.matrix(select(clinicLOOP[clinicLOOP$Group=="MDD",], a_posSelf, b_negSelf, BDI_sum, ATQ, SIAS, selfconcept))
  1315. colnames(corMat)<- c("aPE+", "aPE-", "BDI", "ATQ", "SIAS", "SDQ-III")
  1316. corPat<-rcorr(corMat,type = "spearman")
  1317. # CON group
  1318. corMat<-as.matrix(select(clinicLOOP[clinicLOOP$Group=="CON",], a_posSelf, b_negSelf, BDI_sum, ATQ, SIAS, selfconcept))
  1319. colnames(corMat)<- c("aPE+", "aPE-", "BDI", "ATQ", "SIAS", "SDQ-III")
  1320. corCon<-rcorr(corMat,type = "spearman")
  1321. ## create plots
  1322. # MDD group
  1323. corrplot(corPat$r[1:2,3:6], method="color", col=col(200),
  1324. type="full",
  1325. addCoef.col = "black", # Add coefficient of correlation
  1326. tl.col="black", tl.srt=60, tl.cex= 1.6, number.cex=2, #Text label color and rotation
  1327. # Combine with significance
  1328. p.mat = corPat$P[1:2,3:6], sig.level = 0.05, insig = "label_sig",
  1329. pch.cex = 3,
  1330. # hide correlation coefficient on the principal diagonal
  1331. diag=T,
  1332. cl.pos="n", main="MDD",
  1333. mar=c(0,0,2,0))
  1334. # CON group
  1335. corrplot(corCon$r[1:2,3:6], method="color", col=col(200),
  1336. type="full",
  1337. addCoef.col = "black", # Add coefficient of correlation
  1338. tl.col="black", tl.srt=60, tl.cex= 1.6, number.cex=2, #Text label color and rotation
  1339. # Combine with significance
  1340. #p.mat = corCon$P[1:2,3:6], sig.level = 0.05, insig = "label_sig",
  1341. #pch.cex = 1.6,
  1342. # hide correlation coefficient on the principal diagonal
  1343. diag=T,
  1344. cl.pos="n", main="CON",
  1345. mar=c(0,0,2,0))
  1346. ```
  1347. ```{r, warning=FALSE, message=FALSE}
  1348. pvals <- corPat$P[1:2,3:6]
  1349. colnames(pvals) <- c("BD","AT", "SI","SD")
  1350. pvals_fdr_pepos <- p.adjust(pvals[1,], method = "fdr")
  1351. pvals_fdr_peneg <- p.adjust(pvals[2,], method = "fdr")
  1352. pvals_fdr <- rbind(pvals_fdr_pepos, pvals_fdr_peneg)
  1353. # pvals_fdr <- matrix(p.adjust(pvals, method = "fdr"), nrow = nrow(pvals))
  1354. rownames(pvals_fdr) <- rownames(pvals)
  1355. colnames(pvals_fdr) <- colnames(pvals)
  1356. # Combine into one data frame
  1357. p_table <- as.data.frame(pvals) %>%
  1358. tibble::rownames_to_column("Variable")
  1359. # Add FDR columns
  1360. for (col in colnames(pvals)) {
  1361. p_table[[paste0(col, "_FDR")]] <- pvals_fdr[, col]
  1362. }
  1363. #relocate
  1364. p_table <- p_table %>%
  1365. select(Variable, BD, BD_FDR, AT, AT_FDR, SI, SI_FDR, SD, SD_FDR)
  1366. # Round
  1367. p_table <- p_table %>%
  1368. mutate(across(-Variable, ~ sprintf("%.3f", .)))
  1369. # Create a gt table
  1370. gt(p_table) |>
  1371. tab_header(
  1372. title = html("<i>P</i>-values supplementary figure 2 (MDD group)")
  1373. ) |>
  1374. cols_label(
  1375. Variable = html(" "),
  1376. BD = html("<i> p"),
  1377. BD_FDR = html("<i>p</i> (FDR)"),
  1378. AT = html("<i> p"),
  1379. AT_FDR = html("<i>p</i> (FDR)"),
  1380. SI = html("<i> p"),
  1381. SI_FDR = html("<i>p</i> (FDR)"),
  1382. SD = html("<i> p"),
  1383. SD_FDR = html("<i>p</i> (FDR)")
  1384. ) |>
  1385. opt_align_table_header(align = "left")|>
  1386. tab_spanner(
  1387. label = "BDI",
  1388. columns = c(BD,BD_FDR)
  1389. ) |>
  1390. tab_spanner(
  1391. label = "ATQ",
  1392. columns = c(AT, AT_FDR)
  1393. )|>
  1394. tab_spanner(
  1395. label = "SIAS",
  1396. columns = c(SI,SI_FDR)
  1397. ) |>
  1398. tab_spanner(
  1399. label = "SDQ",
  1400. columns = c(SD, SD_FDR)
  1401. )|>
  1402. cols_align(
  1403. align = "center"
  1404. )|>
  1405. gt_layout()
  1406. ```
  1407. ```{r, echo=FALSE, warning=FALSE, message=FALSE}
  1408. pvals <- corCon$P[1:2,3:6]
  1409. colnames(pvals) <- c("BD","AT", "SI","SD")
  1410. pvals_fdr_pepos <- p.adjust(pvals[1,], method = "fdr")
  1411. pvals_fdr_peneg <- p.adjust(pvals[2,], method = "fdr")
  1412. pvals_fdr <- rbind(pvals_fdr_pepos, pvals_fdr_peneg)
  1413. # pvals_fdr <- matrix(p.adjust(pvals, method = "fdr"), nrow = nrow(pvals))
  1414. rownames(pvals_fdr) <- rownames(pvals)
  1415. colnames(pvals_fdr) <- colnames(pvals)
  1416. # Combine into one data frame
  1417. p_table <- as.data.frame(pvals) %>%
  1418. tibble::rownames_to_column("Variable")
  1419. # Add FDR columns
  1420. for (col in colnames(pvals)) {
  1421. p_table[[paste0(col, "_FDR")]] <- pvals_fdr[, col]
  1422. }
  1423. #relocate
  1424. p_table <- p_table %>%
  1425. select(Variable, BD, BD_FDR, AT, AT_FDR, SI, SI_FDR, SD, SD_FDR)
  1426. # Round
  1427. p_table <- p_table %>%
  1428. mutate(across(-Variable, ~ sprintf("%.3f", .)))
  1429. # Create a gt table
  1430. gt(p_table) |>
  1431. tab_header(
  1432. title = html("<i>P</i>-values supplementary figure 2 (CON group)")
  1433. ) |>
  1434. cols_label(
  1435. Variable = html(" "),
  1436. BD = html("<i> p"),
  1437. BD_FDR = html("<i>p</i> (FDR)"),
  1438. AT = html("<i> p"),
  1439. AT_FDR = html("<i>p</i> (FDR)"),
  1440. SI = html("<i> p"),
  1441. SI_FDR = html("<i>p</i> (FDR)"),
  1442. SD = html("<i> p"),
  1443. SD_FDR = html("<i>p</i> (FDR)")
  1444. ) |>
  1445. opt_align_table_header(align = "left")|>
  1446. tab_spanner(
  1447. label = "BDI",
  1448. columns = c(BD,BD_FDR)
  1449. ) |>
  1450. tab_spanner(
  1451. label = "ATQ",
  1452. columns = c(AT, AT_FDR)
  1453. )|>
  1454. tab_spanner(
  1455. label = "SIAS",
  1456. columns = c(SI,SI_FDR)
  1457. ) |>
  1458. tab_spanner(
  1459. label = "SDQ",
  1460. columns = c(SD, SD_FDR)
  1461. )|>
  1462. cols_align(
  1463. align = "center"
  1464. )|>
  1465. gt_layout()
  1466. col <- colorRampPalette(c("#BB4444", "#EE9988", "#FFFFFF", "#77AADD", "#4477AA"))
  1467. ```
  1468. *Supplementary Figure 6.* Spearman correlation between the self-related learning rates for positive (aPE+) and negative prediction errors (aPE-) with the separate elements of the Psychopathology score: Beck's depression inventory (BDI-V), Automatic Thought Questionnaire (ATQ), Social Interaction Anxiety scale (SIAS), Self-Description Questionnaire-III (SDQ-III subscale scores). MDD = Major depressive disorder, CON = Control, \* *p* \< .05.
  1469. ### Imbalanced prediction error signaling in depression during feedback processing
  1470. **Figure 2**
  1471. *Right anterior insula ROI*
  1472. ```{r, warning=FALSE, message=FALSE}
  1473. ## Fig. 2 Group x PE interaction in anterior insula ROI
  1474. PExGr<-data.frame(select(clinicLOOP, pos_rDVins, neg_rDVins, subj, Group)) # parameter estimates at peak level extracted from matlab, SPM
  1475. PExGr_Long<-reshape2::melt(PExGr, id.vars=c("subj", "Group"), variable.name="PEcondition", value.name = "paramEst")
  1476. PExGr_Long$PEcondition<-factor(c(rep(1, nrow(PExGr)), rep(2,nrow(PExGr))), labels=c("pos","neg"))
  1477. PExGr_Long$Group<-factor(PExGr_Long$Group)
  1478. set.seed(1)
  1479. ggplot(data = PExGr_Long, aes(y = paramEst, x = Group, color=PEcondition, fill=PEcondition)) +
  1480. geom_hline(yintercept=0, lwd=1.5, linetype=2, color="#CDDBD8")+
  1481. geom_point(position = position_jitterdodge (dodge.width = 0.6, jitter.width = 0.45), size=3, alpha = 0.8) +
  1482. geom_boxplot(aes(x=Group,fill=PEcondition), lwd=1.5, outlier.shape = NA, alpha = 0.5, position = position_dodge(width = 0.6), width = .5,
  1483. color = "black") +
  1484. labs(x="none") +
  1485. labs(y="Parameter estimate (38,-12,2)") +
  1486. guides(fill="none")+
  1487. scale_x_discrete(labels=c("CON","MDD")) +
  1488. scale_color_manual(values=c("#23538d","#c00000"))+
  1489. scale_fill_manual(values=c("#23538d","#c00000"))+
  1490. theme_bw()+
  1491. snl_theme()+
  1492. theme(axis.title.x = element_blank(),axis.text.x = element_text(face="bold",size = 16, color="black"),legend.key.size = unit(2,"point"))
  1493. ```
  1494. *Right posterior insula ROI*
  1495. ```{r, warning=FALSE, message=FALSE}
  1496. ## Fig. 2 Group x PE interaction posterior insula ROI
  1497. PExGr<-data.frame(select(clinicLOOP, pos_rPins, neg_rPins, subj, Group)) # parameter estimates at peak level extracted from matlab, SPM
  1498. PExGr_Long<-reshape2::melt(PExGr, id.vars=c("subj", "Group"), variable.name="PEcondition", value.name = "paramEst")
  1499. PExGr_Long$PEcondition<-factor(c(rep(1, nrow(PExGr)), rep(2,nrow(PExGr))), labels=c("pos","neg"))
  1500. PExGr_Long$Group<-factor(PExGr_Long$Group)
  1501. # create plot
  1502. set.seed(2)
  1503. ggplot(data = PExGr_Long, aes(y = paramEst, x = Group, color=PEcondition, fill=PEcondition)) +
  1504. geom_hline(yintercept=0, lwd=1.5, linetype=2, color="#CDDBD8")+
  1505. geom_point(position = position_jitterdodge (dodge.width = 0.6, jitter.width = 0.45), size=3, alpha = 0.8) +
  1506. geom_boxplot(aes(x=Group,fill=PEcondition), lwd=1.5, outlier.shape = NA, alpha = 0.5, position = position_dodge(width = 0.6), width = .5,
  1507. color = "black") +
  1508. labs(x="none") +
  1509. labs(y="Parameter estimate (38,-12,2)") +
  1510. guides(fill="none")+
  1511. scale_x_discrete(labels=c("CON","MDD")) +
  1512. scale_color_manual(values=c("#23538d","#c00000"))+
  1513. scale_fill_manual(values=c("#23538d","#c00000"))+
  1514. theme_bw()+
  1515. snl_theme()+
  1516. theme(axis.title.x = element_blank(),axis.text.x = element_text(face="bold",size = 16, color="black"),legend.key.size = unit(2,"point"))
  1517. ```
  1518. *Figure 2.* Differential insula tracking of prediction error valence in depression. The interaction (MDD\[PE \] \> MDD \[PE+\]) **\>** (CON \[PE-\] \> CON \[PE-\]) shows a greater difference between PE- vs. PE+ in the MDD compared to the CON group. CON = control group (n = 32), MDD = Major Depressive Disorder (n = 35). The plot depicts the parameter estimates of the Group \[CON, MDD\] x Prediction error valence \[PE+, PE-\] interaction at peak level for the three regions of interest in the right insula. Brain plot: uncorrected p \< 0.05 within ROI for display purposes.
  1519. **Supplementary Figure 7: Neural activation associated with negative compared to positive prediction error processing -- whole brain analysis**
  1520. *Right insula*
  1521. ```{r, warning=FALSE, message=FALSE}
  1522. PExGr<-data.frame(select(clinicLOOP, Pos_nPEgrpPE_rIns, Neg_nPEgrpPE_rIns, subj, Group))
  1523. PExGr_Long<-reshape2::melt(PExGr, id.vars=c("subj", "Group"), variable.name="PEcondition", value.name = "paramEst")
  1524. PExGr_Long$PEcondition<-factor(c(rep(1, nrow(PExGr)), rep(2,nrow(PExGr))), labels=c("pos","neg"))
  1525. PExGr_Long$Group<-factor(PExGr_Long$Group)
  1526. # create plot
  1527. set.seed(1)
  1528. ggplot(data = PExGr_Long, aes(y = paramEst, x = Group, pattern=PEcondition)) +
  1529. geom_hline(yintercept=0, lwd=2, color="#FFFFFF")+
  1530. geom_hline(yintercept=0, lwd=2, linetype=2, color="#CDDBD8")+
  1531. geom_point(aes(shape=PEcondition), position = position_jitterdodge (dodge.width = 0.6, jitter.width = 0.45), size=5, alpha = 0.8,color= "#C00000") +
  1532. scale_shape_manual(values=c(20,18), labels = c("Positive PE", "Negative PE"))+
  1533. geom_boxplot_pattern(aes(x=Group,pattern=PEcondition), fill = "#C00000", lwd=2, outlier.shape = NA, alpha = 0.5, position = position_dodge(width = 0.6), width = .5,
  1534. color = "black", pattern_color = "white", pattern_angle = 45, pattern_density = 0.1, pattern_spacing = 0.025, pattern_key_scale_factor = 0.6) +
  1535. labs(x="none") +
  1536. labs(y="Parameter estimates (42,16,2)") +
  1537. scale_x_discrete(labels=c("CON","MDD")) +
  1538. scale_pattern_discrete(choices =c("none","stripe"))+
  1539. theme_bw()+
  1540. snl_theme()+
  1541. theme(axis.title.x = element_blank(),axis.text.x = element_text(face="bold",size = 18, color="black"),legend.key.size = unit(2,"point"))
  1542. ```
  1543. *Left insula*
  1544. ```{r, warning=FALSE, message=FALSE}
  1545. PExGr<-data.frame(select(clinicLOOP, Pos_nPEgrpPE_lIns, Neg_nPEgrpPE_lIns, subj, Group))
  1546. PExGr_Long<-reshape2::melt(PExGr, id.vars=c("subj", "Group"), variable.name="PEcondition", value.name = "paramEst")
  1547. PExGr_Long$PEcondition<-factor(c(rep(1, nrow(PExGr)), rep(2,nrow(PExGr))), labels=c("pos","neg"))
  1548. PExGr_Long$Group<-factor(PExGr_Long$Group)
  1549. # create plot
  1550. set.seed(1)
  1551. ggplot(data = PExGr_Long, aes(y = paramEst, x = Group, pattern=PEcondition)) +
  1552. geom_hline(yintercept=0, lwd=2, color="#FFFFFF")+
  1553. geom_hline(yintercept=0, lwd=2, linetype=2, color="#CDDBD8")+
  1554. geom_point(aes(shape=PEcondition), position = position_jitterdodge (dodge.width = 0.6, jitter.width = 0.45), size=5, alpha = 0.8,color= "#C00000") +
  1555. scale_shape_manual(values=c(20,18), labels = c("Positive PE", "Negative PE"))+
  1556. geom_boxplot_pattern(aes(x=Group,pattern=PEcondition), fill = "#C00000", lwd=2, outlier.shape = NA, alpha = 0.5, position = position_dodge(width = 0.6), width = .5,
  1557. color = "black", pattern_color = "white", pattern_angle = 45, pattern_density = 0.1, pattern_spacing = 0.025, pattern_key_scale_factor = 0.6) +
  1558. labs(x="none") +
  1559. labs(y="Parameter estimates (-40,12,2)") +
  1560. scale_x_discrete(labels=c("CON","MDD")) +
  1561. scale_pattern_discrete(choices =c("none","stripe"))+
  1562. theme_bw()+
  1563. snl_theme()+
  1564. theme(axis.title.x = element_blank(),axis.text.x = element_text(face="bold",size = 18, color="black"),legend.key.size = unit(2,"point"))
  1565. ```
  1566. *Supplementary Figure 7.* Neural activation associated with negative compared to positive prediction error processing (continuous PE-Valence effect). Parameter estimates for positive and negative prediction error processing at peak level within the insula cluster.
  1567. ### Exploratory analysis within the clinical sample
  1568. ```{r, warning=FALSE, message=FALSE}
  1569. ## Supplementary Table 8. Emotions
  1570. summary_stats <- group_by(clinicLOOP, Group) %>%
  1571. summarise(
  1572. happy = mean(happinessSelf, na.rm = TRUE),
  1573. arousal = mean(arousalSelf, na.rm = TRUE),
  1574. pride = mean(prideSelf, na.rm = TRUE),
  1575. emba = mean(embarrassmentSelf, na.rm = TRUE),
  1576. tired = mean(tirednessSelf, na.rm = TRUE),
  1577. happy_sd = sd(happinessSelf, na.rm = TRUE),
  1578. arousal_sd = sd(arousalSelf, na.rm = TRUE),
  1579. pride_sd = sd(prideSelf, na.rm = TRUE),
  1580. emba_sd = sd(embarrassmentSelf, na.rm = TRUE),
  1581. tired_sd = sd(tirednessSelf, na.rm = TRUE),
  1582. )
  1583. # t-tests
  1584. happy<-t.test(happinessSelf~Group, data=clinicLOOP)
  1585. arousal<-t.test(arousalSelf~Group, data=clinicLOOP)
  1586. pride<-t.test(prideSelf~Group, data=clinicLOOP)
  1587. emba <- t.test(embarrassmentSelf~Group, data=clinicLOOP)
  1588. tired<-t.test(tirednessSelf~Group, data=clinicLOOP)
  1589. # effect size
  1590. happy_d<-cohens_d(happinessSelf ~ Group, data = clinicLOOP, hedges.correction = TRUE)
  1591. arousal_d<-cohens_d(arousalSelf ~ Group, data = clinicLOOP, hedges.correction = TRUE)
  1592. pride_d<-cohens_d(prideSelf ~ Group, data = clinicLOOP, hedges.correction = TRUE)
  1593. emba_d<-cohens_d(embarrassmentSelf ~ Group, data = clinicLOOP, hedges.correction = TRUE)
  1594. tired_d<-cohens_d(tirednessSelf ~ Group, data = clinicLOOP, hedges.correction = TRUE)
  1595. # Create the table
  1596. num=5 # define number of variables
  1597. table <- cbind(summary_stats[,1], round(summary_stats[,2:(2*num+1)],2)) %>%
  1598. pivot_longer(cols = -Group)
  1599. table<- cbind(table[1:num,2:3],table[(num+1):(2*num),3], table[(2*num+1):(3*num),3],table[(3*num+1):(4*num),3])
  1600. colnames(table)<-c("n","M1","SD1","M","SD")
  1601. table$"n"<-c("Happiness", "Arousal", "Pride", "Embarrassment", "Tiredness")
  1602. table$t<-c(round(happy$statistic[[1]],2), round(arousal$statistic[[1]],2), round(pride$statistic[[1]],2), round(emba$statistic[[1]],2), round(tired$statistic[[1]],2))
  1603. table$p<-c(p(happy$p.value), p(arousal$p.value), p(pride$p.value), p(emba$p.value), p(tired$p.value))
  1604. table$d<-c(round(happy_d$effsize[[1]],2),round(arousal_d$effsize[[1]],2),round(pride_d$effsize[[1]],2),round(emba_d$effsize[[1]],2),round(tired_d$effsize[[1]],2))
  1605. gt(table) |>
  1606. tab_header(
  1607. title = html("<i> Supplementary Table 8.</i> Emotions - group comparison")
  1608. ) |>
  1609. opt_align_table_header(align = "left")|>
  1610. tab_spanner(
  1611. label = "CON",
  1612. columns = c(M1,SD1)
  1613. ) |>
  1614. tab_spanner(
  1615. label = "MDD",
  1616. columns = c(M, SD)
  1617. ) |>
  1618. tab_spanner(
  1619. label = "t-test",
  1620. columns = c(t, p)
  1621. ) |>
  1622. cols_label(
  1623. n = html(" "),
  1624. M1 = html("<i> M"),
  1625. SD1 = html("<i> SD"),
  1626. M = html("<i> M"),
  1627. SD = html("<i> SD"),
  1628. t = html("<i>t</i>"),
  1629. p = html("<i>p"),
  1630. d = html("Cohen's <i>d")
  1631. )|>
  1632. cols_align(
  1633. align = "center"
  1634. )|>
  1635. tab_footnote(
  1636. footnote= html("<i> Note.</i> Group comparison of emotion ratings during task performance. Two ratings per emotion on a continuous scale from zero to 100 following the presentation of self-related feedback trials. <i>M</i> = mean, <i>SD</i> = standard deviation, <i>d</i> = Cohen's <i>d</i> with Hedges correction. MDD = Major depressive disorder (n = 35), CON = control group (n = 32).")
  1637. )|>
  1638. gt_layout()
  1639. ```
  1640. **Association of affective experience and brain activity for positive and negative prediction errors within the clinical sample**
  1641. **Fig. 2/ Supplementary Fig. 8**
  1642. **Positive PE trials**
  1643. ```{r, warning=FALSE, message=FALSE}
  1644. ## create correlation matrix
  1645. corMat<-as.matrix(data.frame(select(clinicLOOP[clinicLOOP$Group=="MDD",], starts_with("SelfPos")),select(clinicLOOP[clinicLOOP$Group=="MDD",], happinessSelf, prideSelf, embarrassmentSelf)))
  1646. colnames(corMat)<- c("Ant ins (r)", "P ins (r)", "Ant ins (l)", "P ins (l)", "Amy (r)", "Amy (l)", "VS", "Happiness", "Pride", "Emba")
  1647. corPos<-rcorr(corMat,type = "spearman")
  1648. # plot
  1649. corrplot(corPos$r[8:10,1:7], method="color",
  1650. type="full",
  1651. addCoef.col = "black", # Add coefficient of correlation
  1652. tl.col="black", tl.srt=60, tl.cex= 1.5, number.cex=1.1,
  1653. p.mat = corPos$P[8:10,1:7], sig.level = 0.05, insig = "label_sig", pch.cex = 1.2,
  1654. diag=T,cl.cex = 0.8, cl.ratio=0.1,
  1655. mar=c(0,0,1.5,0))
  1656. ```
  1657. ```{r, warning=FALSE, message=FALSE}
  1658. pvals <- corPos$P[8:10,1:7]
  1659. colnames(pvals) <- c("AIr","PIr", "AIl","PIl","AMr","AMl","V")
  1660. pvals_hap_fdr <- p.adjust(pvals[1,], method = "fdr")
  1661. pvals_pri_fdr <- p.adjust(pvals[2,], method = "fdr")
  1662. pvals_emb_fdr <- p.adjust(pvals[3,], method = "fdr")
  1663. pvals_fdr <- rbind(pvals_hap_fdr, pvals_pri_fdr, pvals_emb_fdr)
  1664. # pvals_fdr <- matrix(p.adjust(pvals, method = "fdr"), nrow = nrow(pvals))
  1665. rownames(pvals_fdr) <- rownames(pvals)
  1666. colnames(pvals_fdr) <- colnames(pvals)
  1667. # Combine into one data frame
  1668. p_table <- as.data.frame(pvals) %>%
  1669. tibble::rownames_to_column("Variable")
  1670. # Add FDR columns
  1671. for (col in colnames(pvals)) {
  1672. p_table[[paste0(col, "_FDR")]] <- pvals_fdr[, col]
  1673. }
  1674. #relocate
  1675. p_table <- p_table %>%
  1676. select(Variable,
  1677. AIr, AIr_FDR,
  1678. PIr, PIr_FDR,
  1679. AIl, AIl_FDR,
  1680. PIl, PIl_FDR,
  1681. AMr, AMr_FDR,
  1682. AMl, AMl_FDR,
  1683. V, V_FDR)
  1684. # Round
  1685. p_table <- p_table %>%
  1686. mutate(across(-Variable, ~ sprintf("%.3f", .)))
  1687. # Create a gt table
  1688. gt(p_table) |>
  1689. tab_header(
  1690. title = html("<i>P</i>-values supplementary figure 5 (positive PE trials)")
  1691. ) |>
  1692. cols_label(
  1693. Variable = html(" "),
  1694. AIr = html("<i> p"),
  1695. AIr_FDR = html("<i>p</i> (FDR)"),
  1696. PIr = html("<i> p"),
  1697. PIr_FDR = html("<i>p</i> (FDR)"),
  1698. AIl = html("<i> p"),
  1699. AIl_FDR = html("<i>p</i> (FDR)"),
  1700. PIl = html("<i> p"),
  1701. PIl_FDR = html("<i>p</i> (FDR)"),
  1702. AMr = html("<i> p"),
  1703. AMr_FDR = html("<i>p</i> (FDR)"),
  1704. AMl = html("<i> p"),
  1705. AMl_FDR = html("<i>p</i> (FDR)"),
  1706. V = html("<i> p"),
  1707. V_FDR = html("<i>p</i> (FDR)"),
  1708. ) |>
  1709. opt_align_table_header(align = "left")|>
  1710. tab_spanner(
  1711. label = "Ant ins (r)",
  1712. columns = c(AIr, AIr_FDR)
  1713. ) |>
  1714. tab_spanner(
  1715. label = "Post ins (r)",
  1716. columns = c(PIr, PIr_FDR)
  1717. )|>
  1718. tab_spanner(
  1719. label = "Ant ins (l)",
  1720. columns = c(AIl, AIl_FDR)
  1721. ) |>
  1722. tab_spanner(
  1723. label = "Post ins (l)",
  1724. columns = c(PIl, PIl_FDR)
  1725. )|>
  1726. tab_spanner(
  1727. label = "Amy (r)",
  1728. columns = c(AMr, AMr_FDR)
  1729. ) |>
  1730. tab_spanner(
  1731. label = "Amy (l)",
  1732. columns = c(AMl, AMl_FDR)
  1733. )|>
  1734. tab_spanner(
  1735. label = "VS",
  1736. columns = c(V, V_FDR)
  1737. ) |>
  1738. cols_align(
  1739. align = "center"
  1740. )|>
  1741. gt_layout()
  1742. ```
  1743. **Negative PE trials**
  1744. ```{r, warning=FALSE, message=FALSE}
  1745. ## create correlation matrix
  1746. corMat<-as.matrix(data.frame(select(clinicLOOP[clinicLOOP$Group=="MDD",], starts_with("SelfNeg")),select(clinicLOOP[clinicLOOP$Group=="MDD",], happinessSelf, prideSelf, embarrassmentSelf)))
  1747. colnames(corMat)<- c("Ant ins (r)", "P ins (r)", "Ant ins (l)", "P ins (l)", "Amy (r)", "Amy (l)", "VS", "Happiness","Pride", "Emba")
  1748. corNeg<-rcorr(corMat,type = "spearman")
  1749. col <- colorRampPalette(c("#BB4444", "#EE9988", "#FFFFFF", "#77AADD", "#4477AA"))
  1750. # plot
  1751. corrplot(corNeg$r[8:10,1:7], method="color", col=col(200),
  1752. type="full",
  1753. addCoef.col = "black", # Add coefficient of correlation
  1754. tl.col="black", tl.srt=60, tl.cex= 1.5, number.cex=1.1,
  1755. p.mat = corNeg$P[8:10,1:7], sig.level = 0.05, insig = "label_sig", pch.cex = 1.2,
  1756. diag=T,cl.cex = 0.8, cl.ratio=0.1,
  1757. mar=c(0,0,1.5,0))
  1758. ```
  1759. ```{r, warning=FALSE, message=FALSE}
  1760. pvals <- corNeg$P[8:10,1:7]
  1761. colnames(pvals) <- c("AIr","PIr", "AIl","PIl","AMr","AMl","V")
  1762. pvals_hap_fdr <- p.adjust(pvals[1,], method = "fdr")
  1763. pvals_pri_fdr <- p.adjust(pvals[2,], method = "fdr")
  1764. pvals_emb_fdr <- p.adjust(pvals[3,], method = "fdr")
  1765. pvals_fdr <- rbind(pvals_hap_fdr, pvals_pri_fdr, pvals_emb_fdr)
  1766. # pvals_fdr <- matrix(p.adjust(pvals, method = "fdr"), nrow = nrow(pvals))
  1767. rownames(pvals_fdr) <- rownames(pvals)
  1768. colnames(pvals_fdr) <- colnames(pvals)
  1769. # Combine into one data frame
  1770. p_table <- as.data.frame(pvals) %>%
  1771. tibble::rownames_to_column("Variable")
  1772. # Add FDR columns
  1773. for (col in colnames(pvals)) {
  1774. p_table[[paste0(col, "_FDR")]] <- pvals_fdr[, col]
  1775. }
  1776. #relocate
  1777. p_table <- p_table %>%
  1778. select(Variable,
  1779. AIr, AIr_FDR,
  1780. PIr, PIr_FDR,
  1781. AIl, AIl_FDR,
  1782. PIl, PIl_FDR,
  1783. AMr, AMr_FDR,
  1784. AMl, AMl_FDR,
  1785. V, V_FDR)
  1786. # Round
  1787. p_table <- p_table %>%
  1788. mutate(across(-Variable, ~ sprintf("%.3f", .)))
  1789. # Create a gt table
  1790. gt(p_table) |>
  1791. tab_header(
  1792. title = html("<i>P</i>-values supplementary figure 5 (negative PE trials)")
  1793. ) |>
  1794. cols_label(
  1795. Variable = html(" "),
  1796. AIr = html("<i> p"),
  1797. AIr_FDR = html("<i>p</i> (FDR)"),
  1798. PIr = html("<i> p"),
  1799. PIr_FDR = html("<i>p</i> (FDR)"),
  1800. AIl = html("<i> p"),
  1801. AIl_FDR = html("<i>p</i> (FDR)"),
  1802. PIl = html("<i> p"),
  1803. PIl_FDR = html("<i>p</i> (FDR)"),
  1804. AMr = html("<i> p"),
  1805. AMr_FDR = html("<i>p</i> (FDR)"),
  1806. AMl = html("<i> p"),
  1807. AMl_FDR = html("<i>p</i> (FDR)"),
  1808. V = html("<i> p"),
  1809. V_FDR = html("<i>p</i> (FDR)"),
  1810. ) |>
  1811. opt_align_table_header(align = "left")|>
  1812. tab_spanner(
  1813. label = "Ant ins (r)",
  1814. columns = c(AIr, AIr_FDR)
  1815. ) |>
  1816. tab_spanner(
  1817. label = "Post ins (r)",
  1818. columns = c(PIr, PIr_FDR)
  1819. )|>
  1820. tab_spanner(
  1821. label = "Ant ins (l)",
  1822. columns = c(AIl, AIl_FDR)
  1823. ) |>
  1824. tab_spanner(
  1825. label = "Post ins (l)",
  1826. columns = c(PIl, PIl_FDR)
  1827. )|>
  1828. tab_spanner(
  1829. label = "Amy (r)",
  1830. columns = c(AMr, AMr_FDR)
  1831. ) |>
  1832. tab_spanner(
  1833. label = "Amy (l)",
  1834. columns = c(AMl, AMl_FDR)
  1835. )|>
  1836. tab_spanner(
  1837. label = "VS",
  1838. columns = c(V, V_FDR)
  1839. ) |>
  1840. cols_align(
  1841. align = "center"
  1842. )|>
  1843. gt_layout()
  1844. ```
  1845. *Supplementary Figure 8.* Spearman correlations between the affect ratings and brain activity within ROIs in response to positive and negative prediction errors (categorical PE effect). \* p \< .05.
  1846. Correlations with **symptom burden** within the clinical sample show the same directional pattern as the group comparison, indicating that higher symptom burden is associated with greater activation following negative prediction errors, although not statistically significant:
  1847. ```{r, warning=FALSE, message=FALSE}
  1848. #### MDD group only, psychopathology score PE Category
  1849. corMat<-as.matrix(data.frame(select(clinicLOOP[clinicLOOP$Group=="MDD",], starts_with("SelfPos")),select(clinicLOOP[clinicLOOP$Group=="MDD",], psychPath, a_posSelf)))
  1850. colnames(corMat)<- c("Ant ins (r)", "P ins (r)", "Ant ins (l)", "P ins (l)", "Amy (r)", "Amy (l)", "VS", "PE+ trials/Psychopathology", "PE- trials/Psychopathology")
  1851. corPos<-rcorr(corMat,type = "spearman")
  1852. corMat<-as.matrix(data.frame(select(clinicLOOP[clinicLOOP$Group=="MDD",], starts_with("SelfNeg")),select(clinicLOOP[clinicLOOP$Group=="MDD",], psychPath, a_posSelf)))
  1853. colnames(corMat)<- c("Ant ins (r)", "P ins (r)", "Ant ins (l)", "P ins (l)", "Amy (r)", "Amy (l)", "VS", "PE+ trials/Psychopathology", "PE- trials/Psychopathology")
  1854. corNeg<-rcorr(corMat,type = "spearman")
  1855. corPos$r[9,]<-corNeg$r[8,]
  1856. corPos$P[9,]<-corNeg$P[8,]
  1857. corPos$n[9,]<-corNeg$n[8,]
  1858. col <- colorRampPalette(c("#BB4444", "#EE9988", "#FFFFFF", "#77AADD", "#4477AA"))
  1859. ## create plots for pos/ neg PE Category with PP Score
  1860. corrplot(corPos$r[8:9,1:7], method="color", col=col(200),
  1861. type="full",
  1862. addCoef.col = "black", # Add coefficient of correlation
  1863. tl.col="black", tl.srt=60, tl.cex= 1.5, number.cex=1.1,
  1864. # p.mat = corPos$P[8:9,1:7], sig.level = 0.05, insig = "label_sig", pch.cex = 1.2,
  1865. diag=T,cl.cex = 0.8, cl.ratio=0.1,
  1866. mar=c(0,0,1.5,0))
  1867. ```
  1868. ```{r, warning=FALSE, message=FALSE}
  1869. pvals <- corPos$P[8:9,1:7]
  1870. colnames(pvals) <- c("AIr","PIr", "AIl","PIl","AMr","AMl","V")
  1871. pvals_fdr_pepos <- p.adjust(pvals[1,], method = "fdr")
  1872. pvals_fdr_peneg <- p.adjust(pvals[2,], method = "fdr")
  1873. pvals_fdr <- rbind(pvals_fdr_pepos, pvals_fdr_peneg)
  1874. # pvals_fdr <- matrix(p.adjust(pvals, method = "fdr"), nrow = nrow(pvals))
  1875. rownames(pvals_fdr) <- rownames(pvals)
  1876. colnames(pvals_fdr) <- colnames(pvals)
  1877. # Combine into one data frame
  1878. p_table <- as.data.frame(pvals) %>%
  1879. tibble::rownames_to_column("Variable")
  1880. # Add FDR columns
  1881. for (col in colnames(pvals)) {
  1882. p_table[[paste0(col, "_FDR")]] <- pvals_fdr[, col]
  1883. }
  1884. #relocate
  1885. p_table <- p_table %>%
  1886. select(Variable,
  1887. AIr, AIr_FDR,
  1888. PIr, PIr_FDR,
  1889. AIl, AIl_FDR,
  1890. PIl, PIl_FDR,
  1891. AMr, AMr_FDR,
  1892. AMl, AMl_FDR,
  1893. V, V_FDR)
  1894. # Round
  1895. p_table <- p_table %>%
  1896. mutate(across(-Variable, ~ sprintf("%.3f", .)))
  1897. # Create a gt table
  1898. gt(p_table) |>
  1899. tab_header(
  1900. title = html("<i>P</i>-values for correlations with psychopathology score")
  1901. ) |>
  1902. cols_label(
  1903. Variable = html(" "),
  1904. AIr = html("<i> p"),
  1905. AIr_FDR = html("<i>p</i> (FDR)"),
  1906. PIr = html("<i> p"),
  1907. PIr_FDR = html("<i>p</i> (FDR)"),
  1908. AIl = html("<i> p"),
  1909. AIl_FDR = html("<i>p</i> (FDR)"),
  1910. PIl = html("<i> p"),
  1911. PIl_FDR = html("<i>p</i> (FDR)"),
  1912. AMr = html("<i> p"),
  1913. AMr_FDR = html("<i>p</i> (FDR)"),
  1914. AMl = html("<i> p"),
  1915. AMl_FDR = html("<i>p</i> (FDR)"),
  1916. V = html("<i> p"),
  1917. V_FDR = html("<i>p</i> (FDR)"),
  1918. ) |>
  1919. opt_align_table_header(align = "left")|>
  1920. tab_spanner(
  1921. label = "Ant ins (r)",
  1922. columns = c(AIr, AIr_FDR)
  1923. ) |>
  1924. tab_spanner(
  1925. label = "Post ins (r)",
  1926. columns = c(PIr, PIr_FDR)
  1927. )|>
  1928. tab_spanner(
  1929. label = "Ant ins (l)",
  1930. columns = c(AIl, AIl_FDR)
  1931. ) |>
  1932. tab_spanner(
  1933. label = "Post ins (l)",
  1934. columns = c(PIl, PIl_FDR)
  1935. )|>
  1936. tab_spanner(
  1937. label = "Amy (r)",
  1938. columns = c(AMr, AMr_FDR)
  1939. ) |>
  1940. tab_spanner(
  1941. label = "Amy (l)",
  1942. columns = c(AMl, AMl_FDR)
  1943. )|>
  1944. tab_spanner(
  1945. label = "VS",
  1946. columns = c(V, V_FDR)
  1947. ) |>
  1948. cols_align(
  1949. align = "center"
  1950. )|>
  1951. gt_layout()
  1952. ```
  1953. Generally, while participants receive recurrent performance feedback, insula activation in negative prediction error trials is correlated with the learning behavior as indicated by the negative learning rates (see Supplementary Fig. 10).
  1954. **Supplementary Figure 10:** **Association of learning rates and brain activity for positive and negative prediction errors**
  1955. ```{r, warning=FALSE, message=FALSE}
  1956. ## create correlation matrix
  1957. # Positive PE Condition
  1958. corMat<-as.matrix(data.frame(select(clinicLOOP[clinicLOOP$Group=="MDD",], starts_with("SelfPos")),select(clinicLOOP[clinicLOOP$Group=="MDD",], a_posSelf, b_negSelf)))
  1959. colnames(corMat)<- c("Ant Ins (r)", "P ins (r)", "Ant Ins (l)", "P ins (l)", "Amy (r)", "Amy (l)", "VS", "PE+ trials/aPE+", "PE- trials/aPE-")
  1960. corPos<-rcorr(corMat,type = "spearman")
  1961. # Negative PE Condition
  1962. corMat<-as.matrix(data.frame(select(clinicLOOP[clinicLOOP$Group=="MDD",], starts_with("SelfNeg")),select(clinicLOOP[clinicLOOP$Group=="MDD",], a_posSelf, b_negSelf)))
  1963. colnames(corMat)<- c("Ant Ins (r)", "P ins (r)", "Ant Ins (l)", "P ins (l)", "Amy (r)", "Amy (l)", "VS", "aPE+", "aPE-")
  1964. corNeg<-rcorr(corMat,type = "spearman")
  1965. # combine correlations of interest (according to hypothesis LR+/PE+ processing and LR-/PE- processing) in one matrix
  1966. corPos$r[9,]<-corNeg$r[9,]
  1967. corPos$P[9,]<-corNeg$P[9,]
  1968. corPos$n[9,]<-corNeg$n[9,]
  1969. col <- colorRampPalette(c("#BB4444", "#EE9988", "#FFFFFF", "#77AADD", "#4477AA"))
  1970. ## create plots
  1971. corrplot(corPos$r[8:9,1:7], method="color", col=col(200),
  1972. type="full",
  1973. addCoef.col = "black", # Add coefficient of correlation
  1974. tl.col="black", tl.srt=60, tl.cex= 1.8, number.cex=1.1,
  1975. p.mat = corPos$P[8:9,1:7], sig.level = 0.05, insig = "label_sig",
  1976. pch.cex = 1.5, cl.cex = 0.8, cl.ratio=0.1,
  1977. # hide correlation coefficient on the principal diagonal
  1978. diag=T,mar=c(0,0,1.5,0))
  1979. ```
  1980. ```{r, warning=FALSE, message=FALSE}
  1981. pvals <- corPos$P[8:9,1:7]
  1982. colnames(pvals) <- c("AIr","PIr", "AIl","PIl","AMr","AMl","V")
  1983. pvals_fdr_pepos <- p.adjust(pvals[1,], method = "fdr")
  1984. pvals_fdr_peneg <- p.adjust(pvals[2,], method = "fdr")
  1985. pvals_fdr <- rbind(pvals_fdr_pepos, pvals_fdr_peneg)
  1986. # pvals_fdr <- matrix(p.adjust(pvals, method = "fdr"), nrow = nrow(pvals))
  1987. rownames(pvals_fdr) <- rownames(pvals)
  1988. colnames(pvals_fdr) <- colnames(pvals)
  1989. # Combine into one data frame
  1990. p_table <- as.data.frame(pvals) %>%
  1991. tibble::rownames_to_column("Variable")
  1992. # Add FDR columns
  1993. for (col in colnames(pvals)) {
  1994. p_table[[paste0(col, "_FDR")]] <- pvals_fdr[, col]
  1995. }
  1996. #relocate
  1997. p_table <- p_table %>%
  1998. select(Variable,
  1999. AIr, AIr_FDR,
  2000. PIr, PIr_FDR,
  2001. AIl, AIl_FDR,
  2002. PIl, PIl_FDR,
  2003. AMr, AMr_FDR,
  2004. AMl, AMl_FDR,
  2005. V, V_FDR)
  2006. # Round
  2007. p_table <- p_table %>%
  2008. mutate(across(-Variable, ~ sprintf("%.3f", .)))
  2009. # Create a gt table
  2010. gt(p_table) |>
  2011. tab_header(
  2012. title = html("<i>P</i>-values supplementary figure 6")
  2013. ) |>
  2014. cols_label(
  2015. Variable = html(" "),
  2016. AIr = html("<i> p"),
  2017. AIr_FDR = html("<i>p</i> (FDR)"),
  2018. PIr = html("<i> p"),
  2019. PIr_FDR = html("<i>p</i> (FDR)"),
  2020. AIl = html("<i> p"),
  2021. AIl_FDR = html("<i>p</i> (FDR)"),
  2022. PIl = html("<i> p"),
  2023. PIl_FDR = html("<i>p</i> (FDR)"),
  2024. AMr = html("<i> p"),
  2025. AMr_FDR = html("<i>p</i> (FDR)"),
  2026. AMl = html("<i> p"),
  2027. AMl_FDR = html("<i>p</i> (FDR)"),
  2028. V = html("<i> p"),
  2029. V_FDR = html("<i>p</i> (FDR)"),
  2030. ) |>
  2031. opt_align_table_header(align = "left")|>
  2032. tab_spanner(
  2033. label = "Ant ins (r)",
  2034. columns = c(AIr, AIr_FDR)
  2035. ) |>
  2036. tab_spanner(
  2037. label = "Post ins (r)",
  2038. columns = c(PIr, PIr_FDR)
  2039. )|>
  2040. tab_spanner(
  2041. label = "Ant ins (l)",
  2042. columns = c(AIl, AIl_FDR)
  2043. ) |>
  2044. tab_spanner(
  2045. label = "Post ins (l)",
  2046. columns = c(PIl, PIl_FDR)
  2047. )|>
  2048. tab_spanner(
  2049. label = "Amy (r)",
  2050. columns = c(AMr, AMr_FDR)
  2051. ) |>
  2052. tab_spanner(
  2053. label = "Amy (l)",
  2054. columns = c(AMl, AMl_FDR)
  2055. )|>
  2056. tab_spanner(
  2057. label = "VS",
  2058. columns = c(V, V_FDR)
  2059. ) |>
  2060. cols_align(
  2061. align = "center"
  2062. )|>
  2063. gt_layout()
  2064. ```
  2065. *Supplementary Figure 10.* Spearman correlations between learning rates for self-related positive (aPE+) and negative prediction errors (aPE-) and brain activity within ROIs in response to PE+ and PE- (categorical PE effect). \* *p* \< .05.
  2066. ### Exploratory analysis within control sample
  2067. **Association of affective experience and brain activity for positive and negative prediction errors within the control sample**
  2068. **Supplementary Fig. 9**
  2069. **Positive PE trials**
  2070. ```{r, warning=FALSE, message=FALSE}
  2071. ## create correlation matrix
  2072. corMat<-as.matrix(data.frame(select(clinicLOOP[clinicLOOP$Group=="CON",], starts_with("SelfPos")),select(clinicLOOP[clinicLOOP$Group=="CON",], happinessSelf, prideSelf, embarrassmentSelf)))
  2073. colnames(corMat)<- c("Ant ins (r)", "P ins (r)", "Ant ins (l)", "P ins (l)", "Amy (r)", "Amy (l)", "VS", "Happiness", "Pride", "Emba")
  2074. corPos<-rcorr(corMat,type = "spearman")
  2075. # plot
  2076. corrplot(corPos$r[8:10,1:7], method="color",
  2077. type="full",
  2078. addCoef.col = "black", # Add coefficient of correlation
  2079. tl.col="black", tl.srt=60, tl.cex= 1.5, number.cex=1.1,
  2080. # p.mat = corPos$P[8:10,1:7], sig.level = 0.05, insig = "n", pch.cex = 1.2,
  2081. diag=T,cl.cex = 0.8, cl.ratio=0.1,
  2082. mar=c(0,0,1.5,0))
  2083. ```
  2084. ```{r, warning=FALSE, message=FALSE}
  2085. pvals <- corPos$P[8:10,1:7]
  2086. colnames(pvals) <- c("AIr","PIr", "AIl","PIl","AMr","AMl","V")
  2087. pvals_hap_fdr <- p.adjust(pvals[1,], method = "fdr")
  2088. pvals_pri_fdr <- p.adjust(pvals[2,], method = "fdr")
  2089. pvals_emb_fdr <- p.adjust(pvals[3,], method = "fdr")
  2090. pvals_fdr <- rbind(pvals_hap_fdr, pvals_pri_fdr, pvals_emb_fdr)
  2091. # pvals_fdr <- matrix(p.adjust(pvals, method = "fdr"), nrow = nrow(pvals))
  2092. rownames(pvals_fdr) <- rownames(pvals)
  2093. colnames(pvals_fdr) <- colnames(pvals)
  2094. # Combine into one data frame
  2095. p_table <- as.data.frame(pvals) %>%
  2096. tibble::rownames_to_column("Variable")
  2097. # Add FDR columns
  2098. for (col in colnames(pvals)) {
  2099. p_table[[paste0(col, "_FDR")]] <- pvals_fdr[, col]
  2100. }
  2101. #relocate
  2102. p_table <- p_table %>%
  2103. select(Variable,
  2104. AIr, AIr_FDR,
  2105. PIr, PIr_FDR,
  2106. AIl, AIl_FDR,
  2107. PIl, PIl_FDR,
  2108. AMr, AMr_FDR,
  2109. AMl, AMl_FDR,
  2110. V, V_FDR)
  2111. # Round
  2112. p_table <- p_table %>%
  2113. mutate(across(-Variable, ~ sprintf("%.3f", .)))
  2114. # Create a gt table
  2115. gt(p_table) |>
  2116. tab_header(
  2117. title = html("<i>P</i>-values supplementary figure XX (positive PE trials, control group")
  2118. ) |>
  2119. cols_label(
  2120. Variable = html(" "),
  2121. AIr = html("<i> p"),
  2122. AIr_FDR = html("<i>p</i> (FDR)"),
  2123. PIr = html("<i> p"),
  2124. PIr_FDR = html("<i>p</i> (FDR)"),
  2125. AIl = html("<i> p"),
  2126. AIl_FDR = html("<i>p</i> (FDR)"),
  2127. PIl = html("<i> p"),
  2128. PIl_FDR = html("<i>p</i> (FDR)"),
  2129. AMr = html("<i> p"),
  2130. AMr_FDR = html("<i>p</i> (FDR)"),
  2131. AMl = html("<i> p"),
  2132. AMl_FDR = html("<i>p</i> (FDR)"),
  2133. V = html("<i> p"),
  2134. V_FDR = html("<i>p</i> (FDR)"),
  2135. ) |>
  2136. opt_align_table_header(align = "left")|>
  2137. tab_spanner(
  2138. label = "Ant ins (r)",
  2139. columns = c(AIr, AIr_FDR)
  2140. ) |>
  2141. tab_spanner(
  2142. label = "Post ins (r)",
  2143. columns = c(PIr, PIr_FDR)
  2144. )|>
  2145. tab_spanner(
  2146. label = "Ant ins (l)",
  2147. columns = c(AIl, AIl_FDR)
  2148. ) |>
  2149. tab_spanner(
  2150. label = "Post ins (l)",
  2151. columns = c(PIl, PIl_FDR)
  2152. )|>
  2153. tab_spanner(
  2154. label = "Amy (r)",
  2155. columns = c(AMr, AMr_FDR)
  2156. ) |>
  2157. tab_spanner(
  2158. label = "Amy (l)",
  2159. columns = c(AMl, AMl_FDR)
  2160. )|>
  2161. tab_spanner(
  2162. label = "VS",
  2163. columns = c(V, V_FDR)
  2164. ) |>
  2165. cols_align(
  2166. align = "center"
  2167. )|>
  2168. gt_layout()
  2169. ```
  2170. **Negative PE trials**
  2171. ```{r, warning=FALSE, message=FALSE}
  2172. ## create correlation matrix
  2173. corMat<-as.matrix(data.frame(select(clinicLOOP[clinicLOOP$Group=="CON",], starts_with("SelfNeg")),select(clinicLOOP[clinicLOOP$Group=="CON",], happinessSelf, prideSelf, embarrassmentSelf)))
  2174. colnames(corMat)<- c("Ant ins (r)", "P ins (r)", "Ant ins (l)", "P ins (l)", "Amy (r)", "Amy (l)", "VS", "Happiness","Pride", "Emba")
  2175. corNeg<-rcorr(corMat,type = "spearman")
  2176. col <- colorRampPalette(c("#BB4444", "#EE9988", "#FFFFFF", "#77AADD", "#4477AA"))
  2177. # plot
  2178. corrplot(corNeg$r[8:10,1:7], method="color", col=col(200),
  2179. type="full",
  2180. addCoef.col = "black", # Add coefficient of correlation
  2181. tl.col="black", tl.srt=60, tl.cex= 1.5, number.cex=1.1,
  2182. p.mat = corNeg$P[8:10,1:7], sig.level = 0.05, insig = "label_sig", pch.cex = 1.2,
  2183. diag=T,cl.cex = 0.8, cl.ratio=0.1,
  2184. mar=c(0,0,1.5,0))
  2185. ```
  2186. ```{r, warning=FALSE, message=FALSE}
  2187. pvals <- corNeg$P[8:10,1:7]
  2188. colnames(pvals) <- c("AIr","PIr", "AIl","PIl","AMr","AMl","V")
  2189. pvals_hap_fdr <- p.adjust(pvals[1,], method = "fdr")
  2190. pvals_pri_fdr <- p.adjust(pvals[2,], method = "fdr")
  2191. pvals_emb_fdr <- p.adjust(pvals[3,], method = "fdr")
  2192. pvals_fdr <- rbind(pvals_hap_fdr, pvals_pri_fdr, pvals_emb_fdr)
  2193. # pvals_fdr <- matrix(p.adjust(pvals, method = "fdr"), nrow = nrow(pvals))
  2194. rownames(pvals_fdr) <- rownames(pvals)
  2195. colnames(pvals_fdr) <- colnames(pvals)
  2196. # Combine into one data frame
  2197. p_table <- as.data.frame(pvals) %>%
  2198. tibble::rownames_to_column("Variable")
  2199. # Add FDR columns
  2200. for (col in colnames(pvals)) {
  2201. p_table[[paste0(col, "_FDR")]] <- pvals_fdr[, col]
  2202. }
  2203. #relocate
  2204. p_table <- p_table %>%
  2205. select(Variable,
  2206. AIr, AIr_FDR,
  2207. PIr, PIr_FDR,
  2208. AIl, AIl_FDR,
  2209. PIl, PIl_FDR,
  2210. AMr, AMr_FDR,
  2211. AMl, AMl_FDR,
  2212. V, V_FDR)
  2213. # Round
  2214. p_table <- p_table %>%
  2215. mutate(across(-Variable, ~ sprintf("%.3f", .)))
  2216. # Create a gt table
  2217. gt(p_table) |>
  2218. tab_header(
  2219. title = html("<i>P</i>-values supplementary figure XX (negative PE trials, control group)")
  2220. ) |>
  2221. cols_label(
  2222. Variable = html(" "),
  2223. AIr = html("<i> p"),
  2224. AIr_FDR = html("<i>p</i> (FDR)"),
  2225. PIr = html("<i> p"),
  2226. PIr_FDR = html("<i>p</i> (FDR)"),
  2227. AIl = html("<i> p"),
  2228. AIl_FDR = html("<i>p</i> (FDR)"),
  2229. PIl = html("<i> p"),
  2230. PIl_FDR = html("<i>p</i> (FDR)"),
  2231. AMr = html("<i> p"),
  2232. AMr_FDR = html("<i>p</i> (FDR)"),
  2233. AMl = html("<i> p"),
  2234. AMl_FDR = html("<i>p</i> (FDR)"),
  2235. V = html("<i> p"),
  2236. V_FDR = html("<i>p</i> (FDR)"),
  2237. ) |>
  2238. opt_align_table_header(align = "left")|>
  2239. tab_spanner(
  2240. label = "Ant ins (r)",
  2241. columns = c(AIr, AIr_FDR)
  2242. ) |>
  2243. tab_spanner(
  2244. label = "Post ins (r)",
  2245. columns = c(PIr, PIr_FDR)
  2246. )|>
  2247. tab_spanner(
  2248. label = "Ant ins (l)",
  2249. columns = c(AIl, AIl_FDR)
  2250. ) |>
  2251. tab_spanner(
  2252. label = "Post ins (l)",
  2253. columns = c(PIl, PIl_FDR)
  2254. )|>
  2255. tab_spanner(
  2256. label = "Amy (r)",
  2257. columns = c(AMr, AMr_FDR)
  2258. ) |>
  2259. tab_spanner(
  2260. label = "Amy (l)",
  2261. columns = c(AMl, AMl_FDR)
  2262. )|>
  2263. tab_spanner(
  2264. label = "VS",
  2265. columns = c(V, V_FDR)
  2266. ) |>
  2267. cols_align(
  2268. align = "center"
  2269. )|>
  2270. gt_layout()
  2271. ```
  2272. ## Methods
  2273. **Supplementary Note 7: Posterior predictive checks - Behavioral analyses on the predicted data.**
  2274. ```{r, warning=FALSE, message=FALSE}
  2275. ## Repeat analyses of belief updating behavior on the predicted data
  2276. # prepare data
  2277. yrep<-data.frame(select(clinicLOOP,subj, Group,starts_with("X")))
  2278. yrepLong<-reshape2::melt(yrep,id.vars=c("subj", "Group"),value.name=("expModel"))
  2279. yrepLong$agent<-factor(c(rep(1,40*nrow(yrep)),rep(-1,40*nrow(yrep))),labels=c("other","self"))
  2280. yrepLong$ability<-factor(c(rep(1,20*nrow(yrep)),rep(-1,20*nrow(yrep)),rep(1,20*nrow(yrep)),rep(-1,20*nrow(yrep))),labels=c("low","high"))
  2281. yrepLong$trial<-sort(rep(1:20,nrow(yrep)))
  2282. # model
  2283. yrepmodel<- lme(
  2284. expModel ~ ability * agent * trial * Group,
  2285. random = ~ 1 + ability + agent + trial | subj,
  2286. data = yrepLong,
  2287. method = "ML"
  2288. )
  2289. # yrepmodel<-lme(expModel ~ ability + agent + trial + Group
  2290. # + ability:agent + ability:trial + ability:Group + agent:trial + agent:Group + trial:Group
  2291. # + ability:agent:trial + ability:agent:Group + ability:trial:Group + agent:trial:Group
  2292. # + ability:agent:trial:Group , random = ~1|subj, data = yrepLong, method = 'ML')
  2293. ```
  2294. We repeated the analyses (Supplementary Note 4) using the predicted data from the winning model to see whether our winning model captured the core effects in our model-agnostic analysis. We could reproduce all effects from the model-agnostic analysis with the predicted data: main effect Ability condition: *t*(`r summary(yrepmodel)$tTable[2,3]`) = `r round(summary(yrepmodel)$tTable[2,4],2)`, *p* = `r p_txt(summary(yrepmodel)$tTable[2,5])`, main effect Agent condition: *t*(`r summary(yrepmodel)$tTable[3,3]`) = `r round(summary(yrepmodel)$tTable[3,4],2)`, *p* = `r p_txt(summary(yrepmodel)$tTable[3,5])`, interaction Trial x Ability condition: *t*(`r summary(yrepmodel)$tTable["abilityhigh:trial",3]`) = `r round(summary(yrepmodel)$tTable["abilityhigh:trial",4],2)`, *p* `r p_txt(summary(yrepmodel)$tTable["abilityhigh:trial",5])`, interaction Trial x Agent condition *t*(`r summary(yrepmodel)$tTable["agentself:trial",3]`) = `r round(summary(yrepmodel)$tTable["agentself:trial",4],2)`, *p* `r p_txt(summary(yrepmodel)$tTable["agentself:trial",5])`). This confirms that the winning model recapitulates the main effects in our data.
  2295. **Supplementary Figure 2:** **Correlation of model parameters of the winning model**
  2296. ```{r, warning=FALSE, message=FALSE}
  2297. # define matrix with model parameters
  2298. corMat<-as.matrix(data.frame(select(clinicLOOP, SW1, SW2, SW3, SW4, a_posSelf, b_negSelf, c_posOther, d_negOther,w)))
  2299. colnames(corMat)<- c(":EXP[1]-H/Self", ":EXP[1]-L/Self", ":EXP[1]-H/Other", ":EXP[1]-L/Other", "aPE+/Self", "aPE-/Self","aPE+/Other", "aPE-/Other","w")
  2300. # create correlation plot using Spearman correlation
  2301. corPara<-rcorr(corMat,type = "spearman")
  2302. col <- colorRampPalette(c("#BB4444", "#EE9988", "#FFFFFF", "#77AADD", "#4477AA"))
  2303. # create plot
  2304. corrplot(corPara$r, method="color", col=col(200),
  2305. type="full",
  2306. addCoef.col = "black", # Add coefficient of correlation
  2307. tl.col="black", tl.srt=60, tl.cex= 1, number.cex=0.9, #Text label color and rotation
  2308. # Combine with significance
  2309. p.mat = corPara$P, sig.level = 0.05, insig = "label_sig", pch.cex = 1.2,
  2310. diag=F)
  2311. ```
  2312. *Supplementary Figure 2.* Spearman correlations of model parameters for the winning model. EXP1 = estimated first expected performance for the two ability conditions (H = high, L = low), separately for Self and Other. a = learning rates for positive (aPE+) and negative prediction errors (aPE-), separately for Self and Other. w = weighting factor. \* *p* \< .05.

QuartoReport.qmd, no license · at the source

Overview

Authors: Nora Czekalla1, Alexander Schröder1, Annalina V Mayer1, Janine Stierand2, David S Stolz1, Tobias Kube3, Christoph W Korn4, Ines Wilhelm2, Jan Philipp Klein5, Frieder M Paulus1, Sören Krach1, Laura Müller-Pinzler1
  1. Social Neuroscience Lab, Department of Psychiatry and Psychotherapy, University of Luebeck, Luebeck, Germany
  2. Sleep and Mental Health, Department of Psychiatry and Psychotherapy, University of Luebeck, Luebeck, Germany
  3. Department of Clinical Psychology and Experimental Psychopathology, Goethe University Frankfurt, Frankfurt am Main, Germany
  4. Section Social Neuroscience, Department of General Psychiatry, University of Heidelberg, Heidelberg, Germany
  5. Department of Psychiatry, Psychosomatics and Psychotherapy, University of Luebeck, Luebeck, Germany
Institutions: University of Lübeck (Germany); Goethe University Frankfurt (Germany); Heidelberg University (Germany)
Journal: Translational psychiatry, volume 16, issue 1, article 397
Dates: received 10 December 2025; accepted 24 July 2026; published online 6 August 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1038/s41398-026-04341-7 · PMID 42562807 · PMCID PMC13447838 · OpenAlex W7196934651
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: fMRI (modality), human (organism), depression (population), cognitive (subfield)
Methods: Statistics, Smoothing, state filtering, decompositions, Machine learning, Connectivity, fMRI & imaging
Keywords: Learning and memory, Depression, Human behaviour
MeSH: Cerebral Cortex*, Feedback, Psychological*, Insular Cortex*, Learning*, Major Depressive Disorder*, Self Concept*, Adult, Case-Control Studies, Female, Functional Neuroimaging, Humans, Magnetic Resonance Imaging, Male, Young Adult (* major topic)
Topic: Anxiety, Depression, Psychometrics, Treatment, Cognitive Processes (Experimental and Cognitive Psychology, Psychology), according to OpenAlex
Funding: Deutsche Forschungsgemeinschaft (German Research Foundation) (KR 3803/14-1, MU 4373/1-3, Project-ID 541063275 - TRR 418)
Citations: not cited yet (Europe PMC); 68 references in the paper

Abstract

Background: Maladaptive self-beliefs are a core symptom of major depressive disorder. These beliefs are perpetuated by a negatively biased integration of self-related feedback. Understanding the neurocomputational mechanisms of biased belief updating may help to counteract maladaptive beliefs and the maintenance of depression.

Methods: The present study uses a belief-updating task and functional neuroimaging to examine the neurocomputational mechanisms associated with self-related feedback processing in individuals with major depression (n = 35) and matched healthy controls (n = 32). We hypothesized that increased symptom burden in depression is associated with negatively biased self-belief updating and altered hemodynamic responses to social feedback.

Results: Our findings show that, in the clinical sample, the incorporation of unexpected positive feedback was reduced with greater symptom burden, and that insula reactivity was generally elevated to unexpected negative feedback.

Conclusion: The interplay of increased hemodynamic responsiveness to negative feedback and the reduced learning from positive feedback provide new insights into cognitive distortions in depression and may explain the persistence of maladaptive self-beliefs and, thus, the maintenance of depression.

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 13 matches between paragraphs and lines of code.

OSF gwkp3

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Languages: Quarto (1)
Size: 4 files, 1 script
Software Heritage: not checked
Found in: “Code availability”
Holds: 1 notebook
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: nlme (1 file), psych (1 file), reshape2 (1 file), rstatix (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
At the source: osf.io/gwkp3/

The paper's code and data availability statement is in the Data section.

Tracing map

Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.

What the map holds:

  • 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 1 script, each with its path and the digest of its content;
  • 13 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 behavioral data and code used to generate the behavioral analyses are available at https://osf.io/gwkp3/ (Identifier: 10.17605/OSF.IO/GWKP3). For a quick overview, see R Markdown/Quarto output document. Brain imaging data and analysis scripts, as well as R Stan scripts to estimate the computational models, are available from the corresponding author upon reasonable request.

The behavioral data and code used to generate the behavioral analyses are available at https://osf.io/gwkp3/ (Identifier: 10.17605/OSF.IO/GWKP3). For a quick overview, see R Markdown/Quarto output document. Brain imaging data and analysis scripts, as well as R Stan scripts to estimate the computational models, are available from the corresponding author upon reasonable request.

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, 12 authors, 3 keywords, 14 MeSH terms, 1 funder, 47 references.

Cite

This paper

Czekalla, N., Schröder, A., Mayer, A. V., Stierand, J., Stolz, D. S., Kube, T., Korn, C. W., Wilhelm, I., Klein, J. P., Paulus, F. M., Krach, S., & Müller-Pinzler, L. (2026). Aberrant insula activity to negative and reduced learning from positive feedback underlie maladaptive self-beliefs in depression. Translational psychiatry, 16(1), 397. https://doi.org/10.1038/s41398-026-04341-7

BibTeX

@article{czekalla2026aberrant,
author = {Czekalla, Nora and Schröder, Alexander and Mayer, Annalina V and Stierand, Janine and Stolz, David S and Kube, Tobias and Korn, Christoph W and Wilhelm, Ines and Klein, Jan Philipp and Paulus, Frieder M and Krach, Sören and Müller-Pinzler, Laura},
title = {{Aberrant insula activity to negative and reduced learning from positive feedback underlie maladaptive self-beliefs in depression}},
journal = {Translational psychiatry},
year = {2026},
month = aug,
volume = {16},
number = {1},
pages = {397},
publisher = {Nature Publishing Group},
issn = {2158-3188},
doi = {10.1038/s41398-026-04341-7},
url = {https://doi.org/10.1038/s41398-026-04341-7},
pmid = {42562807},
pmcid = {PMC13447838}
}

RIS

TY - JOUR
AU - Czekalla, Nora
AU - Schröder, Alexander
AU - Mayer, Annalina V
AU - Stierand, Janine
AU - Stolz, David S
AU - Kube, Tobias
AU - Korn, Christoph W
AU - Wilhelm, Ines
AU - Klein, Jan Philipp
AU - Paulus, Frieder M
AU - Krach, Sören
AU - Müller-Pinzler, Laura
TI - Aberrant insula activity to negative and reduced learning from positive feedback underlie maladaptive self-beliefs in depression
T2 - Translational psychiatry
J2 - Transl Psychiatry
PY - 2026
DA - 2026/08/06
VL - 16
IS - 1
SP - 397
SN - 2158-3188
PB - Nature Publishing Group
DO - 10.1038/s41398-026-04341-7
UR - https://doi.org/10.1038/s41398-026-04341-7
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41398-026-04341-7",
"type": "article-journal",
"title": "Aberrant insula activity to negative and reduced learning from positive feedback underlie maladaptive self-beliefs in depression",
"container-title": "Translational psychiatry",
"author": [
{
"family": "Czekalla",
"given": "Nora"
},
{
"family": "Schröder",
"given": "Alexander"
},
{
"family": "Mayer",
"given": "Annalina V"
},
{
"family": "Stierand",
"given": "Janine"
},
{
"family": "Stolz",
"given": "David S"
},
{
"family": "Kube",
"given": "Tobias"
},
{
"family": "Korn",
"given": "Christoph W"
},
{
"family": "Wilhelm",
"given": "Ines"
},
{
"family": "Klein",
"given": "Jan Philipp"
},
{
"family": "Paulus",
"given": "Frieder M"
},
{
"family": "Krach",
"given": "Sören"
},
{
"family": "Müller-Pinzler",
"given": "Laura"
}
],
"container-title-short": "Transl Psychiatry",
"volume": "16",
"issue": "1",
"page": "397",
"DOI": "10.1038/s41398-026-04341-7",
"PMID": "42562807",
"PMCID": "PMC13447838",
"ISSN": "2158-3188",
"publisher": "Nature Publishing Group",
"URL": "https://doi.org/10.1038/s41398-026-04341-7",
"language": "en",
"issued": {
"date-parts": [
[
2026,
8,
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.1038/s42003-026-10229-5 [code]
The neurocomputational mechanisms underlying the impact of social comparison on effort investment.
Journal: Communications biology
In common: psych, tidyverse, 5 references
[2] doi:10.1371/journal.pbio.3003767 [code]
Ultrasound neuromodulation reveals distinct roles of the dorsal anterior cingulate cortex and anterior insula in learning.
Journal: PLoS biology
In common: psych, reshape2, tidyverse, cognitive, 3 references
[3] doi:10.1016/j.nicl.2026.104012 [code]
Structural-functional multilayer brain network properties and outcome of combined repetitive transcranial magnetic stimulation and psychotherapy for obsessive-compulsive disorder.
Journal: NeuroImage. Clinical
In common: nlme, psych, rstatix, 2 other tools, fMRI
[4] doi:10.1038/s41467-026-71415-x [code]
Regional BOLD variability reflects microstructural maturation and neuronal ensheathment in the preterm infant cortex.
Journal: Nature communications
In common: nlme, psych, rstatix, 2 other tools, fMRI
[5] doi:10.1126/sciadv.aec9291 [code]
Computational mechanisms of perception in autism revealed using games inspired by rodent operant tasks.
Journal: Science advances
In common: nlme, psych, rstatix, 2 other tools, cognitive
[6] doi:10.1073/pnas.2606871123 [code]
Oxytocin modulates the neurocomputational mechanisms engaged in learning rank relationships in social networks.
Journal: Proceedings of the National Academy of Sciences of the United States of America
In common: nlme, psych, reshape2, 1 other tool, 1 reference
[7] doi:10.1093/pnasnexus/pgag138 [code]
Regretting a chance to connect: How neural responses to missed social opportunities predict self-disclosure.
Journal: PNAS nexus
In common: nlme, psych, reshape2, 1 other tool, fMRI, cognitive
[8] doi:10.1038/s41467-026-74565-0 [code]
The functional neurobiology of dispositions towards negative emotions.
Journal: Nature communications
In common: nlme, psych, reshape2, 1 other tool, cognitive
[9] doi:10.1038/s41398-026-04010-9 [code]
Bullying victimization and brain development: a longitudinal structural magnetic resonance imaging study from adolescence to early adulthood.
Journal: Translational psychiatry
In common: nlme, psych, rstatix, 1 other tool
[10] doi:10.1093/braincomms/fcag121 [code]
Anterior insular co-activation patterns associated with stress markers in chronic primary pain.
Journal: Brain communications
In common: psych, rstatix, reshape2, 1 other tool, fMRI

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.

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.