OSCR

Altered semantic prediction error processing with increasing schizotypal and autistic traits.

Code ↔ Paper

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

The 1 match
  1. [1] § Methods › Stimuli ↔ scripts/behavioural_analyses_plots_osf.Rmd, lines 640 to 656 · score 0.53 · cloze probability, psycholinguistic properties, sentence, entropy, word · Report a mismatch

Paper

Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

R Markdown · 658 lines · 26 KB · no license · 1 match

  1. ---
  2. title: "R Notebook"
  3. output:
  4. html_document:
  5. df_print: paged
  6. ---
  7. List of figures:
  8. 1. Mean confidence for entropy conditions split by number of channels
  9. 2. Mean clarity for entropy conditions split by number of channels
  10. 3. Proportion of words, correct words, no words for entropy conditions --> zoom in for nowords --> split by channels
  11. 4. Scatterplot for SPQ and number of nowords --> split by channels
  12. # load packages
  13. ```{r}
  14. library(ggplot2)
  15. library(svglite)
  16. library(ggcorrplot)
  17. library(dplyr)
  18. library(ggpubr)
  19. library(RColorBrewer)
  20. library(ggExtra)
  21. library(tidyr)
  22. library(psych)
  23. library(afex)
  24. library(report)
  25. library(apa)
  26. library(ggfortify)
  27. library(emmeans)
  28. library(flextable)
  29. library(stringr)
  30. ```
  31. # read data
  32. ```{r}
  33. df_clean_55 <- read.csv2(".../df_clean_55_allvariables_final_updated.csv", header=TRUE)
  34. ```
  35. # define factors
  36. ```{r}
  37. df_clean_55$participant_private_id<-factor(df_clean_55$participant_private_id)
  38. df_clean_55$condition<-factor(df_clean_55$condition, levels = c("el", "em", "eh", "elmm"))
  39. df_clean_55$channel_nr<-factor(df_clean_55$channel_nr, levels = c("12", "6", "3", "1"))
  40. df_clean_55$word_noword<-factor(df_clean_55$word_noword, levels = c("correctword", "word", "noword"))
  41. ```
  42. # select colours for channels and condition
  43. ```{r}
  44. colours_channels = c('#bfe6c3','#6fcf97','#2f9e44','#1b5e20')
  45. colours_clinicaltraits <- c("#a5a5a5", "#284b63", "#549DA0")
  46. colours_condition = c('#ffadbc', '#ff4769', '#b80022','#660013')
  47. ```
  48. # 1. Mean confidence for entropy conditions split by number of channels
  49. --> x: condition, y: confidence, group by: channel number -> without noword
  50. # 1.1 ANOVA
  51. ```{r}
  52. # Exlude nowords
  53. df_clean_55_wonowords <- df_clean_55 %>%
  54. filter(word_noword == "correctword" | word_noword =="word") %>%
  55. select(participant_private_id, condition, confidence, word_noword, channel_nr) %>%
  56. group_by(participant_private_id, condition, channel_nr, .drop = FALSE) %>%
  57. summarize(mean_confidence = mean(confidence)*100)
  58. # ANOVA
  59. anova_confidence <- aov_ez('participant_private_id', 'mean_confidence', df_clean_55_wonowords, within = c('condition', 'channel_nr'))
  60. anova_confidence
  61. anova_apa(anova_confidence)
  62. summary(anova_confidence)
  63. knitr::kable(nice(anova_confidence, correction = "GG"))
  64. ```
  65. ```{r}
  66. interaction.plot(df_clean_55_wonowords$condition, df_clean_55_wonowords$channel_nr, df_clean_55_wonowords$mean_confidence)
  67. ```
  68. ```{r}
  69. interaction_effect <- emmeans(anova_confidence, ~condition|channel_nr)
  70. interaction_effect
  71. ```
  72. ```{r}
  73. pairs(interaction_effect, adjust = "tukey")
  74. ```
  75. ```{r}
  76. results = as.data.frame(pairs(interaction_effect, adjust = "tukey"))
  77. results <- as.data.frame(lapply(results, function(x) if(is.numeric(x)) round(x, 2) else x))
  78. results_table = flextable(results)
  79. print(results_table, preview = "docx")
  80. ```
  81. # 1.2 Plot
  82. ```{r}
  83. ggplot(data = df_clean_55_wonowords, aes (x = condition, y = mean_confidence)) +
  84. labs(x = "Entropy Condition", y = "Mean Confidence in %") +
  85. #stat_boxplot(geom='errorbar', aes(fill = channel_nr)) +
  86. geom_boxplot(aes(fill = channel_nr)) +
  87. scale_fill_manual(values = colours_condition, name="Entropy Condition", breaks=c("el", "em", "eh", "elmm"), labels=c("low", "medium", "high", "low (mismatch)" )) +
  88. scale_fill_manual(values = colours_channels, name = "Channel Number") +
  89. scale_x_discrete(labels=c("el" = "low", "em" = "medium",
  90. "eh" = "high", "elmm" = "low (mismatch)")) +
  91. scale_y_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100)) +
  92. theme_minimal() +
  93. theme(axis.text = element_text(size = 21)) +
  94. theme(axis.title = element_text(size = 24)) +
  95. theme(legend.position="none")
  96. ggsave(".../55_confidence_entropy_bychannels_boxplots.svg", width=10, height=6, dpi = 600, device = "svg")
  97. ```
  98. ## Correlations
  99. # SPQ
  100. ```{r}
  101. df_clean_55_spq <- df_clean_55 %>%
  102. #filter(word_noword == "correctword") %>%
  103. select(participant_private_id, confidence, word_noword, condition, total_score_spq) %>%
  104. group_by(participant_private_id, condition, total_score_spq, .drop = FALSE) %>%
  105. summarize(mean_confidence = mean(confidence)*100)
  106. ggscatter(df_clean_55_spq, x = "mean_confidence", y = "total_score_spq",
  107. size = 1.5,
  108. add = "reg.line", # Add regression line
  109. conf.int = TRUE, # Add confidence interval
  110. color = "condition", palette = colours_condition
  111. )+
  112. #scale_y_continuous(limits = c(0, 60), breaks = c(0, 10, 20, 30, 40, 50, 60)) +
  113. scale_x_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100)) +
  114. stat_cor(method = "pearson", aes(color = condition), label.x = 0) +
  115. labs(x = "Mean Confidence Rating", y = "SPQ") +
  116. theme_minimal() + theme(legend.position = "none")
  117. ggsave(".../55_scatter_SPQ_confidence.svg", width=6, height=6, dpi = 600, device = "svg")
  118. ```
  119. # AQ
  120. ```{r}
  121. df_clean_55_spq <- df_clean_55 %>%
  122. #filter(word_noword == "correctword") %>%
  123. select(participant_private_id, confidence, word_noword, condition, total_score_aq) %>%
  124. group_by(participant_private_id, condition, total_score_aq, .drop = FALSE) %>%
  125. summarize(mean_confidence = mean(confidence)*100)
  126. ggscatter(df_clean_55_spq, x = "mean_confidence", y = "total_score_aq",
  127. size = 1.5,
  128. add = "reg.line", # Add regression line
  129. conf.int = TRUE, # Add confidence interval
  130. color = "condition", palette = colours_condition
  131. )+
  132. #scale_y_continuous(limits = c(0, 60), breaks = c(0, 10, 20, 30, 40, 50, 60)) +
  133. scale_x_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100)) +
  134. stat_cor(method = "pearson", aes(color = condition), label.x = 0) +
  135. labs(x = "Mean Confidence Rating", y = "AQ") +
  136. theme_minimal() + theme(legend.position = "none")
  137. ggsave(".../55_scatter_AQ_confidence.svg", width=6, height=6, dpi = 600, device = "svg")
  138. ```
  139. # VCI
  140. ```{r}
  141. df_clean_55_spq <- df_clean_55 %>%
  142. #filter(word_noword == "correctword") %>%
  143. select(participant_private_id, confidence, word_noword, condition, total_score_SV) %>%
  144. group_by(participant_private_id, condition, total_score_SV, .drop = FALSE) %>%
  145. summarize(mean_confidence = mean(confidence)*100)
  146. ggscatter(df_clean_55_spq, x = "mean_confidence", y = "total_score_SV",
  147. size = 1.5,
  148. add = "reg.line", # Add regression line
  149. conf.int = TRUE, # Add confidence interval
  150. color = "condition", palette = colours_condition
  151. )+
  152. #scale_y_continuous(limits = c(0, 60), breaks = c(0, 10, 20, 30, 40, 50, 60)) +
  153. scale_x_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100)) +
  154. stat_cor(method = "pearson", aes(color = condition), label.x = 0) +
  155. labs(x = "Mean Confidence Rating", y = "VCI") +
  156. theme_minimal() + theme(legend.position = "none")
  157. ggsave(".../55_scatter_VCI_confidence.svg", width=6, height=6, dpi = 600, device = "svg")
  158. ```
  159. # 2. Mean clarity for entropy conditions split by number of channels
  160. --> x: condition, y: confidence, group by: channel number -> including nowords
  161. ## 2.1 ANOVA
  162. ```{r}
  163. # data set
  164. df_clean_55_clarity <- df_clean_55 %>%
  165. select(participant_private_id, condition, clarity, word_noword, channel_nr) %>%
  166. group_by(participant_private_id, condition, channel_nr, .drop = FALSE) %>%
  167. summarize(mean_clarity = mean(clarity)*100)
  168. # ANOVA
  169. anova_clarity <- aov_ez('participant_private_id', 'mean_clarity', df_clean_55_clarity, within = c('condition', 'channel_nr'))
  170. anova_clarity
  171. anova_apa(anova_clarity)
  172. summary(anova_clarity)
  173. table_clarity <- nice(anova_clarity, correction = "GG")
  174. table_clarity
  175. knitr::kable(nice(anova_clarity, correction = "GG"))
  176. ```
  177. ```{r}
  178. interaction.plot(df_clean_55_clarity$condition, df_clean_55_clarity$channel_nr, df_clean_55_clarity$mean_clarity)
  179. ```
  180. ```{r}
  181. interaction_effect <- emmeans(anova_clarity, ~condition|channel_nr)
  182. interaction_effect
  183. ```
  184. ```{r}
  185. pairs(interaction_effect, adjust = "tukey")
  186. ```
  187. ```{r}
  188. results = as.data.frame(pairs(interaction_effect, adjust = "tukey"))
  189. results <- as.data.frame(lapply(results, function(x) if(is.numeric(x)) round(x, 2) else x))
  190. results_table = flextable(results)
  191. print(results_table, preview = "docx")
  192. ```
  193. ## 2.2 Plot
  194. ```{r}
  195. ggplot(df_clean_55_clarity, aes (x = condition, y = mean_clarity)) +
  196. labs(x = "Entropy Condition", y = "Mean Clarity in %") +
  197. geom_boxplot(aes(fill = channel_nr)) +
  198. scale_fill_manual(values = colours_condition, name="Entropy Condition", breaks=c("el", "em", "eh", "elmm"), labels=c("low", "medium", "high", "low (mismatch)" )) +
  199. scale_fill_manual(values = colours_channels, name = "Channel Number") +
  200. theme_minimal() +
  201. scale_x_discrete(labels=c("el" = "low", "em" = "medium",
  202. "eh" = "high", "elmm" = "low (mismatch)")) +
  203. scale_y_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100)) +
  204. theme(axis.text = element_text(size = 21)) +
  205. theme(axis.title = element_text(size = 24)) +
  206. theme(legend.position="none")
  207. ggsave(".../55_clarity_entropy_bychannels_boxplots.svg", width=10, height=6, dpi = 600, device = "svg")
  208. ```
  209. ## Correlations
  210. # SPQ
  211. ```{r}
  212. df_clean_55_spq <- df_clean_55 %>%
  213. #filter(word_noword == "correctword") %>%
  214. select(participant_private_id, clarity, word_noword, condition, total_score_spq) %>%
  215. group_by(participant_private_id, condition, total_score_spq, .drop = FALSE) %>%
  216. summarize(mean_clarity = mean(clarity)*100)
  217. ggscatter(df_clean_55_spq, x = "mean_clarity", y = "total_score_spq",
  218. size = 1.5,
  219. add = "reg.line", # Add regression line
  220. conf.int = TRUE, # Add confidence interval
  221. color = "condition", palette = colours_condition
  222. )+
  223. #scale_y_continuous(limits = c(0, 60), breaks = c(0, 10, 20, 30, 40, 50, 60)) +
  224. scale_x_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100)) +
  225. stat_cor(method = "pearson", aes(color = condition), label.x = 75) +
  226. labs(x = "Mean Clarity Rating", y = "SPQ") +
  227. theme_minimal() + theme(legend.position = "none")
  228. ggsave(".../55_scatter_SPQ_clarity.svg", width=6, height=6, dpi = 600, device = "svg")
  229. ```
  230. # AQ
  231. ```{r}
  232. df_clean_55_spq <- df_clean_55 %>%
  233. #filter(word_noword == "correctword") %>%
  234. select(participant_private_id, clarity, word_noword, condition, total_score_aq) %>%
  235. group_by(participant_private_id, condition, total_score_aq, .drop = FALSE) %>%
  236. summarize(mean_clarity = mean(clarity)*100)
  237. ggscatter(df_clean_55_spq, x = "mean_clarity", y = "total_score_aq",
  238. size = 1.5,
  239. add = "reg.line", # Add regression line
  240. conf.int = TRUE, # Add confidence interval
  241. color = "condition", palette = colours_condition
  242. )+
  243. #scale_y_continuous(limits = c(0, 60), breaks = c(0, 10, 20, 30, 40, 50, 60)) +
  244. scale_x_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100)) +
  245. stat_cor(method = "pearson", aes(color = condition), label.x = 75) +
  246. labs(x = "Mean Clarity Rating", y = "AQ")+
  247. theme_minimal() + theme(legend.position = "none")
  248. ggsave(".../55_scatter_AQ_clarity.svg", width=6, height=6, dpi = 600, device = "svg")
  249. ```
  250. # VCI
  251. ```{r}
  252. df_clean_55_spq <- df_clean_55 %>%
  253. #filter(word_noword == "correctword") %>%
  254. select(participant_private_id, clarity, word_noword, condition, total_score_SV) %>%
  255. group_by(participant_private_id, condition, total_score_SV, .drop = FALSE) %>%
  256. summarize(mean_clarity = mean(clarity)*100)
  257. ggscatter(df_clean_55_spq, x = "mean_clarity", y = "total_score_SV",
  258. size = 1.5,
  259. add = "reg.line", # Add regression line
  260. conf.int = TRUE, # Add confidence interval
  261. color = "condition", palette = colours_condition
  262. )+
  263. #scale_y_continuous(limits = c(0, 60), breaks = c(0, 10, 20, 30, 40, 50, 60)) +
  264. scale_x_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100)) +
  265. stat_cor(method = "pearson", aes(color = condition), label.x = 75) +
  266. labs(x = "Mean Clarity Rating", y = "VCI")+
  267. theme_minimal() + theme(legend.position = "none")
  268. ggsave(".../55_scatter_VCI_clarity.svg", width=6, height=6, dpi = 600, device = "svg")
  269. ```
  270. # 3. Facet Plot: Proportion of responses (correctword, word, noword) by entropy
  271. ## 3.1 ANOVA
  272. ```{r}
  273. # reshape df_clean
  274. df_clean_plots <- df_clean_55 %>%
  275. select(participant_private_id, channel_nr, condition, word_noword, clarity, confidence, total_score_spq, total_score_aq, total_score_SV) %>%
  276. group_by(participant_private_id,condition, word_noword, total_score_spq, total_score_aq, total_score_SV, .drop = FALSE) %>%
  277. summarize(
  278. word_noword_count = length(word_noword)
  279. )
  280. df_clean_plots$percent_perform <- NA
  281. df_clean_plots$percent_perform <- ifelse(df_clean_plots$condition == "em", df_clean_plots$word_noword_count/80*100, df_clean_plots$word_noword_count/40*100 )
  282. #df_clean_plots$percent_perform <- df_clean_plots$word_noword_count/200*100
  283. df_clean_plots$word_noword <- factor(df_clean_plots$word_noword, levels = c("correctword", "word", "noword"))
  284. df_clean_plots$condition<-factor(df_clean_plots$condition, levels = c("el", "em", "eh", "elmm"))
  285. ```
  286. ## Correct responses
  287. ```{r}
  288. df_clean_plots_corr <- df_clean_plots %>% filter(word_noword == "correctword")
  289. # ANOVA
  290. anova_proportionofcorrectresponses <- aov_ez(id = 'participant_private_id', dv ='percent_perform', data = df_clean_plots_corr, within = c('condition'))
  291. #anova_proportionofresponses <- ezANOVA(data = df_clean_plots, dv = .(percent_perform), wid = .(participant_private_id), within = .(condition, word_noword), type = 3, detailed = TRUE)
  292. anova_proportionofcorrectresponses
  293. anova_apa(anova_proportionofcorrectresponses)
  294. summary(anova_proportionofcorrectresponses)
  295. table_proportionofresponses <- nice(anova_proportionofcorrectresponses, correction = "GG")
  296. table_proportionofresponses
  297. knitr::kable(nice(anova_proportionofcorrectresponses, correction = "GG"))
  298. ```
  299. ```{r}
  300. interaction_effect <- emmeans(anova_proportionofcorrectresponses, ~condition)
  301. interaction_effect
  302. ```
  303. ```{r}
  304. pairs(interaction_effect, adjust = "tukey")
  305. ```
  306. ```{r}
  307. results = as.data.frame(pairs(interaction_effect, adjust = "tukey"))
  308. results <- as.data.frame(lapply(results, function(x) if(is.numeric(x)) round(x, 2) else x))
  309. results_table = flextable(results)
  310. print(results_table, preview = "docx")
  311. ```
  312. ## No responses
  313. ```{r}
  314. df_clean_plots_noword <- df_clean_plots %>% filter(word_noword == "noword")
  315. # ANOVA
  316. anova_proportionofnoresponses <- aov_ez(id = 'participant_private_id', dv ='percent_perform', data = df_clean_plots_noword, within = c('condition'))
  317. #anova_proportionofresponses <- ezANOVA(data = df_clean_plots, dv = .(percent_perform), wid = .(participant_private_id), within = .(condition, word_noword), type = 3, detailed = TRUE)
  318. anova_proportionofnoresponses
  319. anova_apa(anova_proportionofnoresponses)
  320. summary(anova_proportionofnoresponses)
  321. table_proportionofresponses <- nice(anova_proportionofnoresponses, correction = "GG")
  322. table_proportionofresponses
  323. knitr::kable(nice(anova_proportionofnoresponses, correction = "GG"))
  324. ```
  325. ```{r}
  326. interaction_effect <- emmeans(anova_proportionofnoresponses, ~condition)
  327. interaction_effect
  328. ```
  329. ```{r}
  330. pairs(interaction_effect, adjust = "tukey")
  331. ```
  332. ```{r}
  333. results = as.data.frame(pairs(interaction_effect, adjust = "tukey"))
  334. results <- as.data.frame(lapply(results, function(x) if(is.numeric(x)) round(x, 2) else x))
  335. results_table = flextable(results)
  336. print(results_table, preview = "docx")
  337. ```
  338. ## Task-based hallucinations / words
  339. ```{r}
  340. df_clean_plots_word <- df_clean_plots %>% filter(word_noword == "word")
  341. # ANOVA
  342. anova_proportionoftbh <- aov_ez(id = 'participant_private_id', dv ='percent_perform', data = df_clean_plots_word, within = c('condition'))
  343. #anova_proportionofresponses <- ezANOVA(data = df_clean_plots, dv = .(percent_perform), wid = .(participant_private_id), within = .(condition, word_noword), type = 3, detailed = TRUE)
  344. anova_proportionoftbh
  345. anova_apa(anova_proportionoftbh)
  346. summary(anova_proportionoftbh)
  347. table_proportionofresponses <- nice(anova_proportionoftbh, correction = "GG")
  348. table_proportionofresponses
  349. knitr::kable(nice(anova_proportionoftbh, correction = "GG"))
  350. ```
  351. ```{r}
  352. interaction_effect <- emmeans(anova_proportionoftbh, ~condition)
  353. interaction_effect
  354. ```
  355. ```{r}
  356. pairs(interaction_effect, adjust = "tukey")
  357. ```
  358. ```{r}
  359. results = as.data.frame(pairs(interaction_effect, adjust = "tukey"))
  360. results <- as.data.frame(lapply(results, function(x) if(is.numeric(x)) round(x, 2) else x))
  361. results_table = flextable(results)
  362. print(results_table, preview = "docx")
  363. ```
  364. ## 3.2 Plot
  365. ```{r}
  366. df_clean_plots <- df_clean_plots %>%
  367. mutate(condition = recode(condition, "el" = "low entropy", "em" = "medium entropy", "eh" = "high entropy", "elmm" = "low entropy (mismatch)"))
  368. df_clean_plots$condition <- factor(df_clean_plots$condition, levels = c("low entropy", "medium entropy", "high entropy", "low entropy (mismatch)"))
  369. ggplot(df_clean_plots, aes (x = word_noword, y = percent_perform)) +
  370. geom_boxplot() +
  371. # scale_fill_manual(values = colours_channels, name = "Number of Channels",
  372. #guide = guide_legend(reverse = FALSE)) +
  373. facet_wrap (~condition, ncol = 2) +
  374. labs(x = "Response Type", y = "Proportion of Response Types in %") +
  375. #scale_y_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100)) +
  376. scale_x_discrete(labels=c("correctword" = "correct\nword", "noword" = "no\nword", "word" = "incorrect\nword")) +
  377. theme_bw() + theme( panel.grid.major = element_blank(),
  378. panel.grid.minor = element_blank()) +
  379. theme(panel.spacing=unit(1,"lines"))
  380. theme(axis.text = element_text(size = 40)) +
  381. theme(axis.title = element_text(size = 40)) +
  382. theme(strip.text = element_text(size = 40)) +
  383. theme(legend.position="none")
  384. ggsave(".../55_percentage_facet_entropy_boxplots.svg", width=9, height=8, dpi = 600, device = "svg")
  385. ```
  386. # 4. Correlations
  387. ## Correct words
  388. ### SPQ
  389. ```{r}
  390. # reshape df_clean
  391. df_clean_plots_corrwords <- df_clean_plots %>%
  392. filter(word_noword =="correctword")
  393. ggscatter(df_clean_plots_corrwords, x = "percent_perform", y = "total_score_spq",
  394. size = 1.5,
  395. add = "reg.line", # Add regression line
  396. conf.int = TRUE, # Add confidence interval
  397. color = "condition", palette = colours_condition,
  398. conf.int.fill = "#ccccccff"
  399. )+
  400. #scale_y_continuous(limits = c(0, 60), breaks = c(0, 10, 20, 30, 40, 50, 60)) +
  401. #scale_x_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100)) +
  402. stat_cor(aes(color = condition), label.x = 3) +
  403. labs(x = "Proportion of Correct Words in %", y = "SPQ") +
  404. theme_minimal() + theme(legend.position = "none")
  405. ggsave(".../55_scatter_SPQ_correctwords.svg", width=6, height=6, dpi = 600, device = "svg")
  406. ```
  407. ```{r}
  408. ggscatter(df_clean_plots_corrwords, x = "percent_perform", y = "total_score_aq",
  409. size = 1.5,
  410. add = "reg.line", # Add regression line
  411. conf.int = TRUE, # Add confidence interval
  412. color = "condition", palette = colours_condition,
  413. conf.int.fill = "#ccccccff"
  414. )+
  415. #scale_y_continuous(limits = c(0, 60), breaks = c(0, 10, 20, 30, 40, 50, 60)) +
  416. #scale_x_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100)) +
  417. stat_cor(aes(color = condition), label.x = 3) +
  418. labs(x = "Proportion of Correct Words in %", y = "AQ")+
  419. theme_minimal() + theme(legend.position = "none")
  420. ggsave(".../55_scatter_AQ_correctwords.svg", width=6, height=6, dpi = 600, device = "svg")
  421. ```
  422. ```{r}
  423. # reshape df_clean
  424. ggscatter(df_clean_plots_corrwords, x = "percent_perform", y = "total_score_SV",
  425. size = 1.5,
  426. add = "reg.line", # Add regression line
  427. conf.int = TRUE, # Add confidence interval
  428. color = "condition", palette = colours_condition,
  429. conf.int.fill = "#ccccccff"
  430. )+
  431. #scale_y_continuous(limits = c(0, 60), breaks = c(0, 10, 20, 30, 40, 50, 60)) +
  432. #scale_x_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100)) +
  433. stat_cor(aes(color = condition), label.x = 3) +
  434. labs(x = "Proportion of Correct Words in %", y = "VCI")+
  435. theme_minimal() + theme(legend.position = "none")
  436. ggsave(".../55_scatter_VCI_correctwords.svg", width=6, height=6, dpi = 600, device = "svg")
  437. ```
  438. ## No words
  439. ### SPQ
  440. ```{r}
  441. # reshape df_clean
  442. df_clean_plots_nowords <- df_clean_plots %>%
  443. filter(word_noword =="noword")
  444. ggscatter(df_clean_plots_nowords, x = "percent_perform", y = "total_score_spq",
  445. size = 1.5,
  446. add = "reg.line", # Add regression line
  447. conf.int = TRUE, # Add confidence interval
  448. color = "condition", palette = colours_condition,
  449. conf.int.fill = "#ccccccff"
  450. )+
  451. #scale_y_continuous(limits = c(0, 60), breaks = c(0, 10, 20, 30, 40, 50, 60)) +
  452. scale_x_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100)) +
  453. stat_cor(aes(color = condition), label.x = 60) +
  454. labs(x = "Proportion of No Words in %", y = "SPQ")+
  455. theme_minimal() + theme(legend.position = "none")
  456. ggsave(".../55_scatter_SPQ_nowords.svg", width=6, height=6, dpi = 600, device = "svg")
  457. ```
  458. ```{r}
  459. ggscatter(df_clean_plots_nowords, x = "percent_perform", y = "total_score_aq",
  460. size = 1.5,
  461. add = "reg.line", # Add regression line
  462. conf.int = TRUE, # Add confidence interval
  463. color = "condition", palette = colours_condition,
  464. conf.int.fill = "#ccccccff"
  465. )+
  466. #scale_y_continuous(limits = c(0, 60), breaks = c(0, 10, 20, 30, 40, 50, 60)) +
  467. scale_x_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100)) +
  468. stat_cor(aes(color = condition), label.x = 60) +
  469. labs(x = "Proportion of No Words in %", y = "AQ")+
  470. theme_minimal() + theme(legend.position = "none")
  471. ggsave(".../figures/55_scatter_AQ_nowords.svg", width=6, height=6, dpi = 600, device = "svg")
  472. ```
  473. ```{r}
  474. # reshape df_clean
  475. ggscatter(df_clean_plots_nowords, x = "percent_perform", y = "total_score_SV",
  476. size = 1.5,
  477. add = "reg.line", # Add regression line
  478. conf.int = TRUE, # Add confidence interval
  479. color = "condition", palette = colours_condition,
  480. conf.int.fill = "#ccccccff"
  481. )+
  482. #scale_y_continuous(limits = c(0, 60), breaks = c(0, 10, 20, 30, 40, 50, 60)) +
  483. scale_x_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100)) +
  484. stat_cor(aes(color = condition), label.x = 60) +
  485. labs(x = "Proportion of No Words in %", y = "VCI")+
  486. theme_minimal() + theme(legend.position = "none")
  487. ggsave(".../55_scatter_VCI_nowords.svg", width=6, height=6, dpi = 600, device = "svg")
  488. ```
  489. ## Task-based hallucinations
  490. ### SPQ
  491. ```{r}
  492. # reshape df_clean
  493. df_clean_plots_tbh <- df_clean_plots %>%
  494. filter(word_noword =="word")
  495. ggscatter(df_clean_plots_tbh, x = "percent_perform", y = "total_score_spq",
  496. size = 1.5,
  497. add = "reg.line", # Add regression line
  498. conf.int = TRUE, # Add confidence interval
  499. color = "condition", palette = colours_condition,
  500. conf.int.fill = "#ccccccff"
  501. )+
  502. #scale_y_continuous(limits = c(0, 60), breaks = c(0, 10, 20, 30, 40, 50, 60)) +
  503. scale_x_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100)) +
  504. stat_cor(aes(color = condition), label.x = 60) +
  505. labs(x = "Proportion of Task-Based Hallucinations in %", y = "SPQ")+
  506. theme_minimal() + theme(legend.position = "none")
  507. ggsave(".../55_scatter_SPQ_words.svg", width=6, height=6, dpi = 600, device = "svg")
  508. ```
  509. ```{r}
  510. ggscatter(df_clean_plots_tbh, x = "percent_perform", y = "total_score_aq",
  511. size = 1.5,
  512. add = "reg.line", # Add regression line
  513. conf.int = TRUE, # Add confidence interval
  514. color = "condition", palette = colours_condition,
  515. conf.int.fill = "#ccccccff"
  516. )+
  517. #scale_y_continuous(limits = c(0, 60), breaks = c(0, 10, 20, 30, 40, 50, 60)) +
  518. scale_x_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100)) +
  519. stat_cor(aes(color = condition), label.x = 60) +
  520. labs(x = "Proportion of Task-Based Hallucinations in %", y = "AQ")+
  521. theme_minimal() + theme(legend.position = "none")
  522. ggsave(".../55_scatter_AQ_words.svg", width=6, height=6, dpi = 600, device = "svg")
  523. ```
  524. ```{r}
  525. # reshape df_clean
  526. ggscatter(df_clean_plots_tbh, x = "percent_perform", y = "total_score_SV",
  527. size = 1.5,
  528. add = "reg.line", # Add regression line
  529. conf.int = TRUE, # Add confidence interval
  530. color = "condition", palette = colours_condition,
  531. conf.int.fill = "#ccccccff"
  532. )+
  533. #scale_y_continuous(limits = c(0, 60), breaks = c(0, 10, 20, 30, 40, 50, 60)) +
  534. scale_x_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100)) +
  535. stat_cor(aes(color = condition), label.x = 60) +
  536. labs(x = "Proportion of Task-Based Hallucinations in %", y = "VCI")+
  537. theme_minimal() + theme(legend.position = "none")
  538. ggsave(".../55_scatter_VCI_words.svg", width=6, height=6, dpi = 600, device = "svg")
  539. ```
  540. # psycholinguistic properties
  541. ```{r}
  542. sentences <- df_clean_55 %>% select(condition, Sentence, target_word, cloze_probability, entropy) %>% distinct()
  543. sentences <- sentences %>% mutate(nwords = str_count(Sentence, "\\S+"))
  544. sentences_summary <- sentences %>%
  545. group_by(condition) %>%
  546. summarise(
  547. mean_cloze = mean(cloze_probability, na.rm = TRUE),
  548. sd_cloze = sd(cloze_probability, na.rm = TRUE),
  549. mean_entropy = mean(entropy, na.rm = TRUE),
  550. sd_entropy = sd(entropy, na.rm = TRUE),
  551. mean_nwords = mean(nwords, na.rm = TRUE),
  552. sd_nwords = sd(nwords, na.rm = TRUE)
  553. ) %>%
  554. mutate(across(where(is.numeric), round, 2))
  555. sentences_summary
  556. ```

behavioural_analyses_plots_osf.Rmd, no license · at the source

Overview

Authors: Elisabeth F Sterner1,2,3, Verena F Demler1,2, Rachel Lenz4, Lucy J MacGregor5, Christoph Mathys6, Franziska Knolle1,2
  1. School of Medicine and Health, Department of Diagnostic and Interventional Neuroradiology, Technical University of Munich, Munich, Germany
  2. School of Medicine and Health, TUM-NIC Neuroimaging Center, Technical University of Munich, Munich, Germany
  3. Department of Experimental Psychology, Ludwig-Maximilians University Munich, Munich, Germany
  4. School of Medicine and Health, Department of Anesthesiology and Intensive Care, Technical University of Munich, Munich, Germany
  5. MRC Cognition and Brain Sciences Unit, University of Cambridge, Cambridge, UK
  6. Interacting Minds Centre, Aarhus University, Aarhus, Denmark
Journal: Translational psychiatry, volume 16, issue 1, article 502
Dates: received 17 February 2026; accepted 11 September 2026; published online 30 September 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1038/s41398-026-04479-4 · PMID 42816505 · PMCID PMC13627722 · OpenAlex W7214992370
Open access: gold, a free copy (OpenAlex)
Status: code verified (how the code is found and verified)
Categories: EEG (modality), human (organism), autism (population), schizophrenia / psychosis (population), cognitive (subfield)
Methods: Preprocessing, Evoked potentials, Connectivity, Statistics
Keywords: Psychiatric disorders, Human behaviour
MeSH: Autism Spectrum Disorder*, Autistic Disorder*, Comprehension*, Schizophrenia*, Schizotypal Personality Disorder*, Semantics*, Adult, Bayes Theorem, Electroencephalography, Evoked Potentials, Female, Humans, Male, Young Adult (* major topic)
Topic: Autism Spectrum Disorder Research (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Funding: Deutsche Forschungsgemeinschaft (German Research Foundation) (529207886)
Citations: not cited yet (Europe PMC); 99 references in the paper

Abstract

Predictive processing has been proposed as a framework for symptom development in autism (ASD) and schizophrenia (SSD) spectrum disorders, with ASD being associated with an overweighting of (low-level) sensory evidence whereas SSD is characterized by an overweighting of (high-level) prior beliefs, both resulting in altered prediction error processing. This study investigated these hypotheses and their electrophysiological correlates in subclinical expressions of ASD and SSD during language processing. Participants completed an auditory comprehension task that manipulated the precision of high-level semantic prior beliefs and low-level sensory evidence. Hierarchical Bayesian belief-updating modeling and electroencephalography were used to examine whether imbalances in the weighting of prior beliefs and sensory evidence were reflected in altered processing of semantic prediction errors, characterized by mean N400 amplitudes. Computational modeling revealed that increasing schizotypal traits were associated with significant overweighting of prior beliefs, while autistic traits did not show a significant shift. Linear mixed-effect models of mean N400 amplitudes indicated that schizotypy-related overweighting of semantic prior beliefs was reflected in a reduced semantic prediction error signal, indexed by smaller N400 differences between high predictability sentences and both low predictability and high predictability mismatch sentences. A similar but weaker and less distinct pattern emerged for increasing autistic traits. These findings provide converging computational and electrophysiological support for overweighting of semantic prior beliefs with increasing subclinical schizotypy. In contrast, increasing autistic traits were not associated with overweighting of sensory evidence, with electrophysiological results instead suggesting subtle alterations in the weighting of semantic prior beliefs.

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

Repository

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

OSF 3rv4m

License: none: the authors keep all their rights
State: the link answers, verified on 3 October 2026
Evidence: files inventoried
Languages: R (3)
Size: 6 files, 3 scripts
Software Heritage: not checked
Found in: “Code availability”
Holds: 3 notebooks
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: easystats (3 files), emmeans (3 files), ggpubr (3 files), tidyverse (3 files), lme4 (2 files), lmerTest (2 files), afex (1 file), ggplot2 (1 file), psych (1 file)
Availability: 1 check, the latest on 3 October 2026: the link answers (HTTP 200)
  • 3 October 2026: the link answers (HTTP 200)
3 files
At the source: osf.io/3rv4m/overview

Code availability

Data and code may be accessed through: https://osf.io/3rv4m/overview.

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

Tracing map

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

What the map holds:

  • 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 3 scripts, each with its path and the digest of its content;
  • 1 match between paragraphs of the paper and lines of the code (method lexical-v1);
  • neither the text of the paper nor the code itself.

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

Data

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

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, 3 October 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 6 authors, 2 keywords, 14 MeSH terms, 1 funder, 91 references.

Cite

This paper

Sterner, E. F., Demler, V. F., Lenz, R., MacGregor, L. J., Mathys, C., & Knolle, F. (2026). Altered semantic prediction error processing with increasing schizotypal and autistic traits. Translational psychiatry, 16(1), 502. https://doi.org/10.1038/s41398-026-04479-4

BibTeX

@article{sterner2026altered,
author = {Sterner, Elisabeth F and Demler, Verena F and Lenz, Rachel and MacGregor, Lucy J and Mathys, Christoph and Knolle, Franziska},
title = {{Altered semantic prediction error processing with increasing schizotypal and autistic traits}},
journal = {Translational psychiatry},
year = {2026},
month = sep,
volume = {16},
number = {1},
pages = {502},
publisher = {Nature Publishing Group},
issn = {2158-3188},
doi = {10.1038/s41398-026-04479-4},
url = {https://doi.org/10.1038/s41398-026-04479-4},
pmid = {42816505},
pmcid = {PMC13627722}
}

RIS

TY - JOUR
AU - Sterner, Elisabeth F
AU - Demler, Verena F
AU - Lenz, Rachel
AU - MacGregor, Lucy J
AU - Mathys, Christoph
AU - Knolle, Franziska
TI - Altered semantic prediction error processing with increasing schizotypal and autistic traits
T2 - Translational psychiatry
J2 - Transl Psychiatry
PY - 2026
DA - 2026/09/30
VL - 16
IS - 1
SP - 502
SN - 2158-3188
PB - Nature Publishing Group
DO - 10.1038/s41398-026-04479-4
UR - https://doi.org/10.1038/s41398-026-04479-4
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41398-026-04479-4",
"type": "article-journal",
"title": "Altered semantic prediction error processing with increasing schizotypal and autistic traits",
"container-title": "Translational psychiatry",
"author": [
{
"family": "Sterner",
"given": "Elisabeth F"
},
{
"family": "Demler",
"given": "Verena F"
},
{
"family": "Lenz",
"given": "Rachel"
},
{
"family": "MacGregor",
"given": "Lucy J"
},
{
"family": "Mathys",
"given": "Christoph"
},
{
"family": "Knolle",
"given": "Franziska"
}
],
"container-title-short": "Transl Psychiatry",
"volume": "16",
"issue": "1",
"page": "502",
"DOI": "10.1038/s41398-026-04479-4",
"PMID": "42816505",
"PMCID": "PMC13627722",
"ISSN": "2158-3188",
"publisher": "Nature Publishing Group",
"URL": "https://doi.org/10.1038/s41398-026-04479-4",
"language": "en",
"issued": {
"date-parts": [
[
2026,
9,
30
]
]
}
}

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.1016/j.cub.2024.07.087 [code]
Dynamic predictive templates in perception.
Journal: Current biology : CB
In common: afex, lme4, ggpubr, 2 other tools, schizophrenia / psychosis, cognitive, 5 references
[2] doi:10.1038/s42003-024-05807-4 [code]
Sex modulation of faces prediction error in the autistic brain.
Journal: Communications biology
In common: afex, easystats, psych, 4 other tools, autism, EEG, cognitive, 3 references
[3] doi:10.1111/nyas.15407 [code]
Foreign cultural norms are better accepted in the second language.
Journal: Annals of the New York Academy of Sciences
In common: afex, easystats, psych, 5 other tools, EEG, cognitive, 2 references
[4] doi:10.1371/journal.pone.0353990 [code]
Positive mood enhances accessibility of unrelated concepts in the first language but not in the foreign language.
Journal: PloS one
In common: afex, psych, emmeans, 5 other tools, EEG, cognitive, 2 references
[5] doi:10.1038/s41398-025-03245-2 [code]
Exploring when to exploit: the cognitive underpinnings of foraging-type decisions in relation to psychopathy.
Journal: Translational psychiatry
In common: easystats, emmeans, lmerTest, 3 other tools, EEG, cognitive, 1 reference, author Christoph Mathys
[6] doi:10.1186/s13229-025-00678-w [code]
Locus coeruleus tonic upregulation increases selectivity to inconspicuous auditory information in autistic compared to non-autistic individuals: a combined pupillometry and electroencephalography study.
Journal: Molecular autism
In common: easystats, psych, emmeans, 4 other tools, autism, EEG, cognitive, 3 references
[7] doi:10.1016/j.dcn.2023.101251 [code]
Age and vocabulary knowledge differentially influence the N400 and theta responses during semantic retrieval.
Journal: Developmental cognitive neuroscience
In common: afex, easystats, psych, 6 other tools, EEG, 1 reference
[8] doi:10.1016/j.isci.2025.112645 [code]
Preparing to act follows Bayesian inference rules.
Journal: iScience
In common: 9 references
[9] 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: afex, easystats, psych, 5 other tools, autism, cognitive, 1 reference
[10] doi:10.1007/s42113-024-00210-y [code]
Mnemonic vs. Executive Contributions to the N400: A Connectionist Approach to False Memories.
Journal: Computational brain & behavior
In common: afex, easystats, psych, 5 other tools, EEG, cognitive, 1 reference

Contribute

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

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

Add the badge to the code's README

OSCR: the badge of this paper

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

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

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

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

If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.

Request its removal

To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).

Discussion, reproductions, activity

Discussion: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.

Report a mismatch between the code and the paper · Report a code error (signed in)

Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.

Report a reproduction failure (signed in)

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