Altered semantic prediction error processing with increasing schizotypal and autistic traits.
The 1 match
- [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
- ---
- title: "R Notebook"
- output:
- html_document:
- df_print: paged
- ---
- List of figures:
- 1. Mean confidence for entropy conditions split by number of channels
- 2. Mean clarity for entropy conditions split by number of channels
- 3. Proportion of words, correct words, no words for entropy conditions --> zoom in for nowords --> split by channels
- 4. Scatterplot for SPQ and number of nowords --> split by channels
- # load packages
- ```{r}
- library(ggplot2)
- library(svglite)
- library(ggcorrplot)
- library(dplyr)
- library(ggpubr)
- library(RColorBrewer)
- library(ggExtra)
- library(tidyr)
- library(psych)
- library(afex)
- library(report)
- library(apa)
- library(ggfortify)
- library(emmeans)
- library(flextable)
- library(stringr)
- ```
- # read data
- ```{r}
- df_clean_55 <- read.csv2(".../df_clean_55_allvariables_final_updated.csv", header=TRUE)
- ```
- # define factors
- ```{r}
- df_clean_55$participant_private_id<-factor(df_clean_55$participant_private_id)
- df_clean_55$condition<-factor(df_clean_55$condition, levels = c("el", "em", "eh", "elmm"))
- df_clean_55$channel_nr<-factor(df_clean_55$channel_nr, levels = c("12", "6", "3", "1"))
- df_clean_55$word_noword<-factor(df_clean_55$word_noword, levels = c("correctword", "word", "noword"))
- ```
- # select colours for channels and condition
- ```{r}
- colours_channels = c('#bfe6c3','#6fcf97','#2f9e44','#1b5e20')
- colours_clinicaltraits <- c("#a5a5a5", "#284b63", "#549DA0")
- colours_condition = c('#ffadbc', '#ff4769', '#b80022','#660013')
- ```
- # 1. Mean confidence for entropy conditions split by number of channels
- --> x: condition, y: confidence, group by: channel number -> without noword
- # 1.1 ANOVA
- ```{r}
- # Exlude nowords
- df_clean_55_wonowords <- df_clean_55 %>%
- filter(word_noword == "correctword" | word_noword =="word") %>%
- select(participant_private_id, condition, confidence, word_noword, channel_nr) %>%
- group_by(participant_private_id, condition, channel_nr, .drop = FALSE) %>%
- summarize(mean_confidence = mean(confidence)*100)
- # ANOVA
- anova_confidence <- aov_ez('participant_private_id', 'mean_confidence', df_clean_55_wonowords, within = c('condition', 'channel_nr'))
- anova_confidence
- anova_apa(anova_confidence)
- summary(anova_confidence)
- knitr::kable(nice(anova_confidence, correction = "GG"))
- ```
- ```{r}
- interaction.plot(df_clean_55_wonowords$condition, df_clean_55_wonowords$channel_nr, df_clean_55_wonowords$mean_confidence)
- ```
- ```{r}
- interaction_effect <- emmeans(anova_confidence, ~condition|channel_nr)
- interaction_effect
- ```
- ```{r}
- pairs(interaction_effect, adjust = "tukey")
- ```
- ```{r}
- results = as.data.frame(pairs(interaction_effect, adjust = "tukey"))
- results <- as.data.frame(lapply(results, function(x) if(is.numeric(x)) round(x, 2) else x))
- results_table = flextable(results)
- print(results_table, preview = "docx")
- ```
- # 1.2 Plot
- ```{r}
- ggplot(data = df_clean_55_wonowords, aes (x = condition, y = mean_confidence)) +
- labs(x = "Entropy Condition", y = "Mean Confidence in %") +
- #stat_boxplot(geom='errorbar', aes(fill = channel_nr)) +
- geom_boxplot(aes(fill = channel_nr)) +
- scale_fill_manual(values = colours_condition, name="Entropy Condition", breaks=c("el", "em", "eh", "elmm"), labels=c("low", "medium", "high", "low (mismatch)" )) +
- scale_fill_manual(values = colours_channels, name = "Channel Number") +
- scale_x_discrete(labels=c("el" = "low", "em" = "medium",
- "eh" = "high", "elmm" = "low (mismatch)")) +
- scale_y_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100)) +
- theme_minimal() +
- theme(axis.text = element_text(size = 21)) +
- theme(axis.title = element_text(size = 24)) +
- theme(legend.position="none")
- ggsave(".../55_confidence_entropy_bychannels_boxplots.svg", width=10, height=6, dpi = 600, device = "svg")
- ```
- ## Correlations
- # SPQ
- ```{r}
- df_clean_55_spq <- df_clean_55 %>%
- #filter(word_noword == "correctword") %>%
- select(participant_private_id, confidence, word_noword, condition, total_score_spq) %>%
- group_by(participant_private_id, condition, total_score_spq, .drop = FALSE) %>%
- summarize(mean_confidence = mean(confidence)*100)
- ggscatter(df_clean_55_spq, x = "mean_confidence", y = "total_score_spq",
- size = 1.5,
- add = "reg.line", # Add regression line
- conf.int = TRUE, # Add confidence interval
- color = "condition", palette = colours_condition
- )+
- #scale_y_continuous(limits = c(0, 60), breaks = c(0, 10, 20, 30, 40, 50, 60)) +
- scale_x_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100)) +
- stat_cor(method = "pearson", aes(color = condition), label.x = 0) +
- labs(x = "Mean Confidence Rating", y = "SPQ") +
- theme_minimal() + theme(legend.position = "none")
- ggsave(".../55_scatter_SPQ_confidence.svg", width=6, height=6, dpi = 600, device = "svg")
- ```
- # AQ
- ```{r}
- df_clean_55_spq <- df_clean_55 %>%
- #filter(word_noword == "correctword") %>%
- select(participant_private_id, confidence, word_noword, condition, total_score_aq) %>%
- group_by(participant_private_id, condition, total_score_aq, .drop = FALSE) %>%
- summarize(mean_confidence = mean(confidence)*100)
- ggscatter(df_clean_55_spq, x = "mean_confidence", y = "total_score_aq",
- size = 1.5,
- add = "reg.line", # Add regression line
- conf.int = TRUE, # Add confidence interval
- color = "condition", palette = colours_condition
- )+
- #scale_y_continuous(limits = c(0, 60), breaks = c(0, 10, 20, 30, 40, 50, 60)) +
- scale_x_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100)) +
- stat_cor(method = "pearson", aes(color = condition), label.x = 0) +
- labs(x = "Mean Confidence Rating", y = "AQ") +
- theme_minimal() + theme(legend.position = "none")
- ggsave(".../55_scatter_AQ_confidence.svg", width=6, height=6, dpi = 600, device = "svg")
- ```
- # VCI
- ```{r}
- df_clean_55_spq <- df_clean_55 %>%
- #filter(word_noword == "correctword") %>%
- select(participant_private_id, confidence, word_noword, condition, total_score_SV) %>%
- group_by(participant_private_id, condition, total_score_SV, .drop = FALSE) %>%
- summarize(mean_confidence = mean(confidence)*100)
- ggscatter(df_clean_55_spq, x = "mean_confidence", y = "total_score_SV",
- size = 1.5,
- add = "reg.line", # Add regression line
- conf.int = TRUE, # Add confidence interval
- color = "condition", palette = colours_condition
- )+
- #scale_y_continuous(limits = c(0, 60), breaks = c(0, 10, 20, 30, 40, 50, 60)) +
- scale_x_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100)) +
- stat_cor(method = "pearson", aes(color = condition), label.x = 0) +
- labs(x = "Mean Confidence Rating", y = "VCI") +
- theme_minimal() + theme(legend.position = "none")
- ggsave(".../55_scatter_VCI_confidence.svg", width=6, height=6, dpi = 600, device = "svg")
- ```
- # 2. Mean clarity for entropy conditions split by number of channels
- --> x: condition, y: confidence, group by: channel number -> including nowords
- ## 2.1 ANOVA
- ```{r}
- # data set
- df_clean_55_clarity <- df_clean_55 %>%
- select(participant_private_id, condition, clarity, word_noword, channel_nr) %>%
- group_by(participant_private_id, condition, channel_nr, .drop = FALSE) %>%
- summarize(mean_clarity = mean(clarity)*100)
- # ANOVA
- anova_clarity <- aov_ez('participant_private_id', 'mean_clarity', df_clean_55_clarity, within = c('condition', 'channel_nr'))
- anova_clarity
- anova_apa(anova_clarity)
- summary(anova_clarity)
- table_clarity <- nice(anova_clarity, correction = "GG")
- table_clarity
- knitr::kable(nice(anova_clarity, correction = "GG"))
- ```
- ```{r}
- interaction.plot(df_clean_55_clarity$condition, df_clean_55_clarity$channel_nr, df_clean_55_clarity$mean_clarity)
- ```
- ```{r}
- interaction_effect <- emmeans(anova_clarity, ~condition|channel_nr)
- interaction_effect
- ```
- ```{r}
- pairs(interaction_effect, adjust = "tukey")
- ```
- ```{r}
- results = as.data.frame(pairs(interaction_effect, adjust = "tukey"))
- results <- as.data.frame(lapply(results, function(x) if(is.numeric(x)) round(x, 2) else x))
- results_table = flextable(results)
- print(results_table, preview = "docx")
- ```
- ## 2.2 Plot
- ```{r}
- ggplot(df_clean_55_clarity, aes (x = condition, y = mean_clarity)) +
- labs(x = "Entropy Condition", y = "Mean Clarity in %") +
- geom_boxplot(aes(fill = channel_nr)) +
- scale_fill_manual(values = colours_condition, name="Entropy Condition", breaks=c("el", "em", "eh", "elmm"), labels=c("low", "medium", "high", "low (mismatch)" )) +
- scale_fill_manual(values = colours_channels, name = "Channel Number") +
- theme_minimal() +
- scale_x_discrete(labels=c("el" = "low", "em" = "medium",
- "eh" = "high", "elmm" = "low (mismatch)")) +
- scale_y_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100)) +
- theme(axis.text = element_text(size = 21)) +
- theme(axis.title = element_text(size = 24)) +
- theme(legend.position="none")
- ggsave(".../55_clarity_entropy_bychannels_boxplots.svg", width=10, height=6, dpi = 600, device = "svg")
- ```
- ## Correlations
- # SPQ
- ```{r}
- df_clean_55_spq <- df_clean_55 %>%
- #filter(word_noword == "correctword") %>%
- select(participant_private_id, clarity, word_noword, condition, total_score_spq) %>%
- group_by(participant_private_id, condition, total_score_spq, .drop = FALSE) %>%
- summarize(mean_clarity = mean(clarity)*100)
- ggscatter(df_clean_55_spq, x = "mean_clarity", y = "total_score_spq",
- size = 1.5,
- add = "reg.line", # Add regression line
- conf.int = TRUE, # Add confidence interval
- color = "condition", palette = colours_condition
- )+
- #scale_y_continuous(limits = c(0, 60), breaks = c(0, 10, 20, 30, 40, 50, 60)) +
- scale_x_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100)) +
- stat_cor(method = "pearson", aes(color = condition), label.x = 75) +
- labs(x = "Mean Clarity Rating", y = "SPQ") +
- theme_minimal() + theme(legend.position = "none")
- ggsave(".../55_scatter_SPQ_clarity.svg", width=6, height=6, dpi = 600, device = "svg")
- ```
- # AQ
- ```{r}
- df_clean_55_spq <- df_clean_55 %>%
- #filter(word_noword == "correctword") %>%
- select(participant_private_id, clarity, word_noword, condition, total_score_aq) %>%
- group_by(participant_private_id, condition, total_score_aq, .drop = FALSE) %>%
- summarize(mean_clarity = mean(clarity)*100)
- ggscatter(df_clean_55_spq, x = "mean_clarity", y = "total_score_aq",
- size = 1.5,
- add = "reg.line", # Add regression line
- conf.int = TRUE, # Add confidence interval
- color = "condition", palette = colours_condition
- )+
- #scale_y_continuous(limits = c(0, 60), breaks = c(0, 10, 20, 30, 40, 50, 60)) +
- scale_x_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100)) +
- stat_cor(method = "pearson", aes(color = condition), label.x = 75) +
- labs(x = "Mean Clarity Rating", y = "AQ")+
- theme_minimal() + theme(legend.position = "none")
- ggsave(".../55_scatter_AQ_clarity.svg", width=6, height=6, dpi = 600, device = "svg")
- ```
- # VCI
- ```{r}
- df_clean_55_spq <- df_clean_55 %>%
- #filter(word_noword == "correctword") %>%
- select(participant_private_id, clarity, word_noword, condition, total_score_SV) %>%
- group_by(participant_private_id, condition, total_score_SV, .drop = FALSE) %>%
- summarize(mean_clarity = mean(clarity)*100)
- ggscatter(df_clean_55_spq, x = "mean_clarity", y = "total_score_SV",
- size = 1.5,
- add = "reg.line", # Add regression line
- conf.int = TRUE, # Add confidence interval
- color = "condition", palette = colours_condition
- )+
- #scale_y_continuous(limits = c(0, 60), breaks = c(0, 10, 20, 30, 40, 50, 60)) +
- scale_x_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100)) +
- stat_cor(method = "pearson", aes(color = condition), label.x = 75) +
- labs(x = "Mean Clarity Rating", y = "VCI")+
- theme_minimal() + theme(legend.position = "none")
- ggsave(".../55_scatter_VCI_clarity.svg", width=6, height=6, dpi = 600, device = "svg")
- ```
- # 3. Facet Plot: Proportion of responses (correctword, word, noword) by entropy
- ## 3.1 ANOVA
- ```{r}
- # reshape df_clean
- df_clean_plots <- df_clean_55 %>%
- select(participant_private_id, channel_nr, condition, word_noword, clarity, confidence, total_score_spq, total_score_aq, total_score_SV) %>%
- group_by(participant_private_id,condition, word_noword, total_score_spq, total_score_aq, total_score_SV, .drop = FALSE) %>%
- summarize(
- word_noword_count = length(word_noword)
- )
- df_clean_plots$percent_perform <- NA
- 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 )
- #df_clean_plots$percent_perform <- df_clean_plots$word_noword_count/200*100
- df_clean_plots$word_noword <- factor(df_clean_plots$word_noword, levels = c("correctword", "word", "noword"))
- df_clean_plots$condition<-factor(df_clean_plots$condition, levels = c("el", "em", "eh", "elmm"))
- ```
- ## Correct responses
- ```{r}
- df_clean_plots_corr <- df_clean_plots %>% filter(word_noword == "correctword")
- # ANOVA
- anova_proportionofcorrectresponses <- aov_ez(id = 'participant_private_id', dv ='percent_perform', data = df_clean_plots_corr, within = c('condition'))
- #anova_proportionofresponses <- ezANOVA(data = df_clean_plots, dv = .(percent_perform), wid = .(participant_private_id), within = .(condition, word_noword), type = 3, detailed = TRUE)
- anova_proportionofcorrectresponses
- anova_apa(anova_proportionofcorrectresponses)
- summary(anova_proportionofcorrectresponses)
- table_proportionofresponses <- nice(anova_proportionofcorrectresponses, correction = "GG")
- table_proportionofresponses
- knitr::kable(nice(anova_proportionofcorrectresponses, correction = "GG"))
- ```
- ```{r}
- interaction_effect <- emmeans(anova_proportionofcorrectresponses, ~condition)
- interaction_effect
- ```
- ```{r}
- pairs(interaction_effect, adjust = "tukey")
- ```
- ```{r}
- results = as.data.frame(pairs(interaction_effect, adjust = "tukey"))
- results <- as.data.frame(lapply(results, function(x) if(is.numeric(x)) round(x, 2) else x))
- results_table = flextable(results)
- print(results_table, preview = "docx")
- ```
- ## No responses
- ```{r}
- df_clean_plots_noword <- df_clean_plots %>% filter(word_noword == "noword")
- # ANOVA
- anova_proportionofnoresponses <- aov_ez(id = 'participant_private_id', dv ='percent_perform', data = df_clean_plots_noword, within = c('condition'))
- #anova_proportionofresponses <- ezANOVA(data = df_clean_plots, dv = .(percent_perform), wid = .(participant_private_id), within = .(condition, word_noword), type = 3, detailed = TRUE)
- anova_proportionofnoresponses
- anova_apa(anova_proportionofnoresponses)
- summary(anova_proportionofnoresponses)
- table_proportionofresponses <- nice(anova_proportionofnoresponses, correction = "GG")
- table_proportionofresponses
- knitr::kable(nice(anova_proportionofnoresponses, correction = "GG"))
- ```
- ```{r}
- interaction_effect <- emmeans(anova_proportionofnoresponses, ~condition)
- interaction_effect
- ```
- ```{r}
- pairs(interaction_effect, adjust = "tukey")
- ```
- ```{r}
- results = as.data.frame(pairs(interaction_effect, adjust = "tukey"))
- results <- as.data.frame(lapply(results, function(x) if(is.numeric(x)) round(x, 2) else x))
- results_table = flextable(results)
- print(results_table, preview = "docx")
- ```
- ## Task-based hallucinations / words
- ```{r}
- df_clean_plots_word <- df_clean_plots %>% filter(word_noword == "word")
- # ANOVA
- anova_proportionoftbh <- aov_ez(id = 'participant_private_id', dv ='percent_perform', data = df_clean_plots_word, within = c('condition'))
- #anova_proportionofresponses <- ezANOVA(data = df_clean_plots, dv = .(percent_perform), wid = .(participant_private_id), within = .(condition, word_noword), type = 3, detailed = TRUE)
- anova_proportionoftbh
- anova_apa(anova_proportionoftbh)
- summary(anova_proportionoftbh)
- table_proportionofresponses <- nice(anova_proportionoftbh, correction = "GG")
- table_proportionofresponses
- knitr::kable(nice(anova_proportionoftbh, correction = "GG"))
- ```
- ```{r}
- interaction_effect <- emmeans(anova_proportionoftbh, ~condition)
- interaction_effect
- ```
- ```{r}
- pairs(interaction_effect, adjust = "tukey")
- ```
- ```{r}
- results = as.data.frame(pairs(interaction_effect, adjust = "tukey"))
- results <- as.data.frame(lapply(results, function(x) if(is.numeric(x)) round(x, 2) else x))
- results_table = flextable(results)
- print(results_table, preview = "docx")
- ```
- ## 3.2 Plot
- ```{r}
- df_clean_plots <- df_clean_plots %>%
- mutate(condition = recode(condition, "el" = "low entropy", "em" = "medium entropy", "eh" = "high entropy", "elmm" = "low entropy (mismatch)"))
- df_clean_plots$condition <- factor(df_clean_plots$condition, levels = c("low entropy", "medium entropy", "high entropy", "low entropy (mismatch)"))
- ggplot(df_clean_plots, aes (x = word_noword, y = percent_perform)) +
- geom_boxplot() +
- # scale_fill_manual(values = colours_channels, name = "Number of Channels",
- #guide = guide_legend(reverse = FALSE)) +
- facet_wrap (~condition, ncol = 2) +
- labs(x = "Response Type", y = "Proportion of Response Types in %") +
- #scale_y_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100)) +
- scale_x_discrete(labels=c("correctword" = "correct\nword", "noword" = "no\nword", "word" = "incorrect\nword")) +
- theme_bw() + theme( panel.grid.major = element_blank(),
- panel.grid.minor = element_blank()) +
- theme(panel.spacing=unit(1,"lines"))
- theme(axis.text = element_text(size = 40)) +
- theme(axis.title = element_text(size = 40)) +
- theme(strip.text = element_text(size = 40)) +
- theme(legend.position="none")
- ggsave(".../55_percentage_facet_entropy_boxplots.svg", width=9, height=8, dpi = 600, device = "svg")
- ```
- # 4. Correlations
- ## Correct words
- ### SPQ
- ```{r}
- # reshape df_clean
- df_clean_plots_corrwords <- df_clean_plots %>%
- filter(word_noword =="correctword")
- ggscatter(df_clean_plots_corrwords, x = "percent_perform", y = "total_score_spq",
- size = 1.5,
- add = "reg.line", # Add regression line
- conf.int = TRUE, # Add confidence interval
- color = "condition", palette = colours_condition,
- conf.int.fill = "#ccccccff"
- )+
- #scale_y_continuous(limits = c(0, 60), breaks = c(0, 10, 20, 30, 40, 50, 60)) +
- #scale_x_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100)) +
- stat_cor(aes(color = condition), label.x = 3) +
- labs(x = "Proportion of Correct Words in %", y = "SPQ") +
- theme_minimal() + theme(legend.position = "none")
- ggsave(".../55_scatter_SPQ_correctwords.svg", width=6, height=6, dpi = 600, device = "svg")
- ```
- ```{r}
- ggscatter(df_clean_plots_corrwords, x = "percent_perform", y = "total_score_aq",
- size = 1.5,
- add = "reg.line", # Add regression line
- conf.int = TRUE, # Add confidence interval
- color = "condition", palette = colours_condition,
- conf.int.fill = "#ccccccff"
- )+
- #scale_y_continuous(limits = c(0, 60), breaks = c(0, 10, 20, 30, 40, 50, 60)) +
- #scale_x_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100)) +
- stat_cor(aes(color = condition), label.x = 3) +
- labs(x = "Proportion of Correct Words in %", y = "AQ")+
- theme_minimal() + theme(legend.position = "none")
- ggsave(".../55_scatter_AQ_correctwords.svg", width=6, height=6, dpi = 600, device = "svg")
- ```
- ```{r}
- # reshape df_clean
- ggscatter(df_clean_plots_corrwords, x = "percent_perform", y = "total_score_SV",
- size = 1.5,
- add = "reg.line", # Add regression line
- conf.int = TRUE, # Add confidence interval
- color = "condition", palette = colours_condition,
- conf.int.fill = "#ccccccff"
- )+
- #scale_y_continuous(limits = c(0, 60), breaks = c(0, 10, 20, 30, 40, 50, 60)) +
- #scale_x_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100)) +
- stat_cor(aes(color = condition), label.x = 3) +
- labs(x = "Proportion of Correct Words in %", y = "VCI")+
- theme_minimal() + theme(legend.position = "none")
- ggsave(".../55_scatter_VCI_correctwords.svg", width=6, height=6, dpi = 600, device = "svg")
- ```
- ## No words
- ### SPQ
- ```{r}
- # reshape df_clean
- df_clean_plots_nowords <- df_clean_plots %>%
- filter(word_noword =="noword")
- ggscatter(df_clean_plots_nowords, x = "percent_perform", y = "total_score_spq",
- size = 1.5,
- add = "reg.line", # Add regression line
- conf.int = TRUE, # Add confidence interval
- color = "condition", palette = colours_condition,
- conf.int.fill = "#ccccccff"
- )+
- #scale_y_continuous(limits = c(0, 60), breaks = c(0, 10, 20, 30, 40, 50, 60)) +
- scale_x_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100)) +
- stat_cor(aes(color = condition), label.x = 60) +
- labs(x = "Proportion of No Words in %", y = "SPQ")+
- theme_minimal() + theme(legend.position = "none")
- ggsave(".../55_scatter_SPQ_nowords.svg", width=6, height=6, dpi = 600, device = "svg")
- ```
- ```{r}
- ggscatter(df_clean_plots_nowords, x = "percent_perform", y = "total_score_aq",
- size = 1.5,
- add = "reg.line", # Add regression line
- conf.int = TRUE, # Add confidence interval
- color = "condition", palette = colours_condition,
- conf.int.fill = "#ccccccff"
- )+
- #scale_y_continuous(limits = c(0, 60), breaks = c(0, 10, 20, 30, 40, 50, 60)) +
- scale_x_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100)) +
- stat_cor(aes(color = condition), label.x = 60) +
- labs(x = "Proportion of No Words in %", y = "AQ")+
- theme_minimal() + theme(legend.position = "none")
- ggsave(".../figures/55_scatter_AQ_nowords.svg", width=6, height=6, dpi = 600, device = "svg")
- ```
- ```{r}
- # reshape df_clean
- ggscatter(df_clean_plots_nowords, x = "percent_perform", y = "total_score_SV",
- size = 1.5,
- add = "reg.line", # Add regression line
- conf.int = TRUE, # Add confidence interval
- color = "condition", palette = colours_condition,
- conf.int.fill = "#ccccccff"
- )+
- #scale_y_continuous(limits = c(0, 60), breaks = c(0, 10, 20, 30, 40, 50, 60)) +
- scale_x_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100)) +
- stat_cor(aes(color = condition), label.x = 60) +
- labs(x = "Proportion of No Words in %", y = "VCI")+
- theme_minimal() + theme(legend.position = "none")
- ggsave(".../55_scatter_VCI_nowords.svg", width=6, height=6, dpi = 600, device = "svg")
- ```
- ## Task-based hallucinations
- ### SPQ
- ```{r}
- # reshape df_clean
- df_clean_plots_tbh <- df_clean_plots %>%
- filter(word_noword =="word")
- ggscatter(df_clean_plots_tbh, x = "percent_perform", y = "total_score_spq",
- size = 1.5,
- add = "reg.line", # Add regression line
- conf.int = TRUE, # Add confidence interval
- color = "condition", palette = colours_condition,
- conf.int.fill = "#ccccccff"
- )+
- #scale_y_continuous(limits = c(0, 60), breaks = c(0, 10, 20, 30, 40, 50, 60)) +
- scale_x_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100)) +
- stat_cor(aes(color = condition), label.x = 60) +
- labs(x = "Proportion of Task-Based Hallucinations in %", y = "SPQ")+
- theme_minimal() + theme(legend.position = "none")
- ggsave(".../55_scatter_SPQ_words.svg", width=6, height=6, dpi = 600, device = "svg")
- ```
- ```{r}
- ggscatter(df_clean_plots_tbh, x = "percent_perform", y = "total_score_aq",
- size = 1.5,
- add = "reg.line", # Add regression line
- conf.int = TRUE, # Add confidence interval
- color = "condition", palette = colours_condition,
- conf.int.fill = "#ccccccff"
- )+
- #scale_y_continuous(limits = c(0, 60), breaks = c(0, 10, 20, 30, 40, 50, 60)) +
- scale_x_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100)) +
- stat_cor(aes(color = condition), label.x = 60) +
- labs(x = "Proportion of Task-Based Hallucinations in %", y = "AQ")+
- theme_minimal() + theme(legend.position = "none")
- ggsave(".../55_scatter_AQ_words.svg", width=6, height=6, dpi = 600, device = "svg")
- ```
- ```{r}
- # reshape df_clean
- ggscatter(df_clean_plots_tbh, x = "percent_perform", y = "total_score_SV",
- size = 1.5,
- add = "reg.line", # Add regression line
- conf.int = TRUE, # Add confidence interval
- color = "condition", palette = colours_condition,
- conf.int.fill = "#ccccccff"
- )+
- #scale_y_continuous(limits = c(0, 60), breaks = c(0, 10, 20, 30, 40, 50, 60)) +
- scale_x_continuous(limits = c(0, 100), breaks = c(0, 25, 50, 75, 100)) +
- stat_cor(aes(color = condition), label.x = 60) +
- labs(x = "Proportion of Task-Based Hallucinations in %", y = "VCI")+
- theme_minimal() + theme(legend.position = "none")
- ggsave(".../55_scatter_VCI_words.svg", width=6, height=6, dpi = 600, device = "svg")
- ```
- # psycholinguistic properties
- ```{r}
- sentences <- df_clean_55 %>% select(condition, Sentence, target_word, cloze_probability, entropy) %>% distinct()
- sentences <- sentences %>% mutate(nwords = str_count(Sentence, "\\S+"))
- sentences_summary <- sentences %>%
- group_by(condition) %>%
- summarise(
- mean_cloze = mean(cloze_probability, na.rm = TRUE),
- sd_cloze = sd(cloze_probability, na.rm = TRUE),
- mean_entropy = mean(entropy, na.rm = TRUE),
- sd_entropy = sd(entropy, na.rm = TRUE),
- mean_nwords = mean(nwords, na.rm = TRUE),
- sd_nwords = sd(nwords, na.rm = TRUE)
- ) %>%
- mutate(across(where(is.numeric), round, 2))
- sentences_summary
- ```
behavioural_analyses_plots_osf.Rmd, no license · at the source
Overview
- School of Medicine and Health, Department of Diagnostic and Interventional Neuroradiology, Technical University of Munich, Munich, Germany
- School of Medicine and Health, TUM-NIC Neuroimaging Center, Technical University of Munich, Munich, Germany
- Department of Experimental Psychology, Ludwig-Maximilians University Munich, Munich, Germany
- School of Medicine and Health, Department of Anesthesiology and Intensive Care, Technical University of Munich, Munich, Germany
- MRC Cognition and Brain Sciences Unit, University of Cambridge, Cambridge, UK
- Interacting Minds Centre, Aarhus University, Aarhus, Denmark
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
Availability: 1 check, the latest on 3 October 2026: the link answers (HTTP 200)
- 3 October 2026: the link answers (HTTP 200)
3 files
- scripts/
N400_analyses_tables_plo , R, 210 linests_osf.Rmd - scripts/
P600_analyses_tables_plo , R, 183 linests_osf.Rmd - scripts/
behavioural_analyses_plo , R, 658 lines, 1 matchts_osf.Rmd
Code availability
Data and code may be accessed through: https://
Reproduced under the paper's license (CC BY), from the paper cited above.
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 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://
BibTeX
@article{sterner2026alte
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/
url = {https://
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/
VL - 16
IS - 1
SP - 502
SN - 2158-3188
PB - Nature Publishing Group
DO - 10.1038/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1038/
"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":
"volume": "16",
"issue": "1",
"page": "502",
"DOI": "10.1038/
"PMID": "42816505",
"PMCID": "PMC13627722",
"ISSN": "2158-3188",
"publisher": "Nature Publishing Group",
"URL": "https://
"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 : CBIn 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 biologyIn 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 SciencesIn 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 oneIn 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 psychiatryIn 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 autismIn 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 neuroscienceIn 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: iScienceIn 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 advancesIn 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 & behaviorIn 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.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 3 scripts, and 1 match between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:7b36f09a2e3ee3bb…
Add the badge to the code's README
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 -->
[](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:endHTML
<!-- 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.
