Attentional processing in individual anxiety: Electrocortical correlates of threat- and safety-related declarative memory formation.
The 1 match
- [1] § Method › Statistical analysis ↔ EEG-SME OSF.R, lines 160–199 · score 0.68 · median split, Kenward Roger, inferential, variable, memory ratings, lme4
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
R · 697 lines · 30 KB · no license · 1 match
- library(tidyverse)
- library(stringr)
- library(afex)
- library(ez)
- library(apa)
- require(r2glmm)
- require(psych)
- options(warn = 1)
- # Describe demographics
- # Please note for ethical reasons we did not upload the diagnosis information to the OSF,
- #please reach out to "[email hidden]" for access to the full demographic data on request.
- sampledata <- read.csv("Sampledata_osf.csv")
- # Describe demographics
- sampledata %>% filter(include_final == 1) %>%
- select(ASI_sum_real,mA,Alter,Geschlecht) %>%
- describe()
- # Correlate things
- sampledata %>% filter(include_final == 1) %>%
- select(ASI_sum_labor,mA,Alter,Geschlecht,total_remembered,csp_remembered,csm_remembered) %>%
- cor() %>%
- corrplot::corrplot(method = "number",diag = F, type = "upper",col = 'black', cl.pos = 'n')
- # Histogram of ASI values
- sampledata %>% filter(include_final == 1) %>%
- ggplot(aes(ASI_sum_real)) +
- geom_histogram(bins = 10,color="black", fill = "darkgoldenrod3") +
- geom_vline(xintercept = mean(sampledata$ASI_sum_real), color= "black") +
- geom_vline(xintercept = mean(sampledata$ASI_sum_real)+sd(sampledata$ASI_sum_real), color= "black", linetype=2) +
- geom_vline(xintercept = mean(sampledata$ASI_sum_real)-sd(sampledata$ASI_sum_real), color= "black", linetype=2) +
- annotate("text", label ="µ = 23.3", x = 30, y = 12, color = "black")+
- annotate("text", label ="σ = 16.7", x = 46.5, y = 12, color = "black")+
- scale_y_continuous("Count", expand=c(0,0), breaks=c(0,2,4,6,8,10,12)) +
- scale_x_continuous("ASI levels", breaks=c(0,10,20,30,40,50,60)) +
- theme_classic()
- mean(sampledata$ASI_sum_real)
- sd(sampledata$ASI_sum_real)
- # Behavioral Analysis
- # Read Raw Rating Data
- ratings <- read.csv2("C:/Users/yas70ym/Documents/Experimente/Experiment JW - EEG SME/Logfiles/Rating/Rating.txt", skip = 4, header=F) %>%
- select(-V5) %>%
- rename(ID = V1, stim = V2, rating = V3, score = V4) %>% #rename columns
- filter(stim != "") %>% #remove empty cells
- mutate(ID = str_remove(ID,"_Rating")) %>% #clean up ID
- filter(ID != "Test") %>% #Just take the memory ratings
- filter(stim != "alle") %>%
- mutate(cue = factor(ifelse(str_sub(stim,1,3) == "CS+",2,1)), #recode CS+ -> 2, CS- -> 1
- score = as.numeric(score))
- # Now take the memory ratings and categorize (if they are correctly remembered)
- memory_ratings <- ratings %>% filter(rating == "Sch") %>%
- mutate(memorized = ifelse(cue == 2 & score > 2, 1,0), # CS+ was correctly remembered when score was > +2
- memorized = ifelse(cue == 1 & score < -2, 1, memorized)) # CS- was correctly remembered when score was < -2
- # Calculate number of correctly remembered items, total and per CS
- #total_rem <- memory_ratings %>% group_by(ID) %>%
- # summarize(total_remembered = sum(memorized))
- #cs_rem <- memory_ratings %>% group_by(ID,cue) %>%
- # mutate(cue = ifelse(cue == 1,"csm_remembered","csp_remembered")) %>%
- # summarize(remembered = sum(memorized)) %>%
- # pivot_wider(names_from = cue, values_from = remembered)
- # Tests
- memory_ratings %>%
- left_join(sampledata, by = "ID")%>%
- filter(include_final == 1) %>%
- group_by(ID,cue) %>%
- summarize(remembered = sum(memorized),
- mean_score = mean(score)) %>%
- group_by(cue) %>%
- summarize(remembered_m = mean(remembered)/40,
- remembered_sd = sd(remembered)/40,
- score_m = mean(mean_score),
- score_sd = sd(mean_score))
- lm <- memory_ratings %>%
- left_join(sampledata, by = "ID")%>%
- filter(include_final == 1) %>%
- group_by(ID,cue,ASI_sum_labor) %>%
- summarize(mean_score = mean(score)) %>%
- lmer(mean_score ~ cue * ASI_sum_labor + (1|ID), data = .) #cue, memory, as factors, asi as continuous, id as random
- anova(lm,ddf="Kenward-Roger")
- r2beta(lm,method="kr") #Effectsize and 95-CI estimation
- lm <- memory_ratings %>%
- left_join(sampledata, by = "ID")%>%
- filter(include_final == 1) %>%
- group_by(ID,cue,ASI_sum_labor) %>%
- summarize(remembered = sum(memorized),
- mean_score = mean(score)) %>%
- lmer(remembered ~ cue * ASI_sum_labor + (1|ID), data = .)
- anova(lm,ddf="Kenward-Roger")
- r2beta(lm,method="kr") #Effectsize and 95-CI estimation
- # Arousal & Valence
- # Plots
- aro_plot <- ratings %>%
- left_join(sampledata, by = "ID") %>%
- left_join(memory_ratings %>% select(ID,stim,memorized), by = c("ID","stim")) %>%
- filter(include_final == 1) %>%
- filter(rating == "Aro") %>%
- mutate(memorized = factor(memorized),
- ASI_median = factor(ASI_median)) %>%
- group_by(ID,cue, memorized, ASI_median) %>%
- summarize(mean_score = mean(score)) %>%
- group_by(cue,memorized,ASI_median) %>%
- summarize(score_m = mean(mean_score),
- score_se = sd(mean_score)/sqrt(n())) %>%
- ggplot(aes(x = cue, y = score_m, linetype = memorized, fill = ASI_median, group = interaction(ASI_median,memorized))) +
- geom_errorbar(aes(ymin = score_m-score_se, ymax=score_m+score_se), linetype = 1, width = 0.1,,position = position_dodge(width=0.2)) +
- geom_line(position = position_dodge(width=0.2)) +
- geom_point(size = 3, shape = 21,position = position_dodge(width=0.2)) +
- scale_fill_manual(labels = c("low ASI", "high ASI"), values=c("darkgoldenrod3","darkblue"))+
- scale_linetype_manual(labels = c("forgotten", "remembered"), values=c(2,1)) +
- scale_x_discrete("",labels=c("CS-","CS+")) +
- scale_y_continuous("Arousal [0 - 100]") +
- theme_classic() +
- theme(legend.position = "none")
- val_plot <-ratings %>%
- left_join(sampledata, by = "ID") %>%
- left_join(memory_ratings %>% select(ID,stim,memorized), by = c("ID","stim")) %>%
- filter(include_final == 1) %>%
- filter(rating == "Val") %>%
- mutate(score = 100-score) %>%
- mutate(memorized = factor(memorized),
- ASI_median = factor(ASI_median)) %>%
- group_by(ID,cue, memorized, ASI_median) %>%
- summarize(mean_score = mean(score)) %>%
- group_by(cue,memorized,ASI_median) %>%
- summarize(score_m = mean(mean_score),
- score_se = sd(mean_score)/sqrt(n())) %>%
- ggplot(aes(x = cue, y = score_m, linetype = memorized, fill = ASI_median, group = interaction(ASI_median,memorized))) +
- geom_errorbar(aes(ymin = score_m-score_se, ymax=score_m+score_se), linetype = 1, width = 0.1,,position = position_dodge(width=0.2)) +
- geom_line(position = position_dodge(width=0.2)) +
- geom_point(size = 3, shape = 21,position = position_dodge(width=0.2)) +
- scale_fill_manual(labels = c("low ASI", "high ASI"), values=c("darkgoldenrod3","darkblue"))+
- scale_linetype_manual(labels = c("forgotten", "remembered"), values=c(2,1)) +
- scale_x_discrete("",labels=c("CS-","CS+")) +
- scale_y_continuous("Unpleasantness [0 - 100]") +
- theme_classic() +
- theme(legend.title = element_blank())
- cowplot::plot_grid(aro_plot, val_plot, ncol=2, nrow=1, rel_widths=c(1, 1.3))
- # Inferential analysis
- # Valence
- lm <- ratings %>%
- left_join(sampledata, by = "ID")%>%
- left_join(memory_ratings %>% select(ID,stim,memorized), by = c("ID","stim")) %>%
- filter(include_final == 1) %>%
- filter(rating == "Val") %>%
- group_by(ID,cue, memorized,ASI_sum_labor) %>%
- summarize(mean_score = mean(score)) %>%
- lmer(mean_score ~ cue * memorized * ASI_sum_labor + (1|ID), data = .) #cue, memory, as factors, asi as continuous, id as random
- anova(lm,ddf="Kenward-Roger")
- r2beta(lm,method="kr") #Effectsize and 95-CI estimation
- # Arousal
- lm <- ratings %>%
- left_join(sampledata, by = "ID")%>%
- left_join(memory_ratings %>% select(ID,stim,memorized), by = c("ID","stim")) %>%
- filter(include_final == 1) %>%
- filter(rating == "Aro") %>%
- group_by(ID,cue, memorized,ASI_sum_labor) %>%
- summarize(mean_score = mean(score)) %>%
- lmer(mean_score ~ cue * memorized * ASI_sum_labor + (1|ID), data = .)#cue, memory, as factors, asi as continuous, id as random
- anova(lm,ddf="Kenward-Roger")
- r2beta(lm,method="kr") #Effectsize and 95-CI estimation
- # Pupil Analysis
- # Read preprocessed pupil data, there is memory and some other info already included
- ga_unified <- readRDS("C:/Users/yas70ym/Documents/Experimente/Experiment JW - EEG SME/ET_ga_unified.RData")
- pupil_df <- readRDS("C:/Users/yas70ym/Documents/Experimente/Experiment JW - EEG SME/ET_pupil_df.Rdata")
- # Combine with sampledata info
- ga_unified <- ga_unified %>% left_join(sampledata %>% select(-ASI_sum_labor, -Asi_sum_screening), by ="ID")
- pupil_df <- pupil_df %>% select(-ASI_sum_labor,-Gruppe) %>% left_join(sampledata %>% select(-Asi_sum_screening), by ="ID")
- # Insert ASI median split group in the trial variable for plotting ... this will load some minutes
- for (t in 1:nrow(ga_unified)) {
- ga_unified$diameter[[t]] = ga_unified$diameter[[t]] %>%
- mutate(ASI_median = ga_unified$ASI_median[[t]])}
- # Plot grand average
- pupil_wave_plot <- ga_unified %>%
- filter(include_final == 1) %>%
- .$diameter %>% bind_rows() %>%
- mutate(condition = as.factor(condition)) %>%
- mutate(condition = factor(condition,labels = c("CS-","CS+")),
- memorized = factor(memorized),
- ASI_median = factor(ASI_median)) %>%
- group_by(condition,memorized,samplepoint,ASI_median) %>%
- summarise(diameter = mean(diameter), time = mean(time)) %>%
- ggplot(., aes(x=time, y=diameter, color=ASI_median, group=interaction(ASI_median,memorized), linetype = memorized)) +
- facet_wrap(~condition)+
- geom_rect(xmin = 0.5, xmax = 3, ymin = -Inf, ymax = Inf, fill = "#EEEEEE", color = "transparent")+
- geom_path() +
- geom_hline(yintercept = 0) +
- scale_x_continuous("Time [s]")+ #,limits=c(-0.5, 6)) +
- scale_color_manual(labels=c("low ASI","high ASI"),
- values=c("darkgoldenrod3", "darkblue")) +
- scale_linetype_manual(values=c(2,1), labels = c("forgotten","remembered"))+
- scale_y_continuous("Pupil Diameter [mm]") +
- theme_classic() +
- theme(legend.position="bottom",
- legend.background = element_rect(fill = "transparent"),
- legend.title = element_blank(),
- strip.background.x = element_blank())
- pupil_plot <- pupil_df %>%
- filter(include_final == 1) %>% #take only included subjects
- select(ID,ASI_median,condition,memorized,dilation) %>% #this line is technically not necessary
- group_by(ID,condition,memorized,ASI_median) %>% # average over single trials
- summarise(dilation = mean(dilation)) %>% ungroup() %>%
- mutate(cue = factor(condition,labels = c("csm","csp")), #factorize factors
- memorized = factor(memorized),
- ASI_median = factor(ASI_median)) %>%
- group_by(cue,memorized,ASI_median) %>%
- summarize(dilation_m = mean(dilation),
- dilation_se = sd(dilation)/sqrt(n())) %>%
- ggplot(aes(x = cue, y = dilation_m, linetype = memorized, fill = ASI_median, group = interaction(ASI_median,memorized))) +
- geom_errorbar(aes(ymin = dilation_m-dilation_se, ymax=dilation_m+dilation_se), linetype = 1, width = 0.1,,position = position_dodge(width=0.2)) +
- geom_line(position = position_dodge(width=0.2)) +
- geom_point(size = 3, shape = 21,position = position_dodge(width=0.2)) +
- scale_fill_manual(labels = c("low ASI", "high ASI"), values=c("darkgoldenrod3","darkblue"))+
- scale_linetype_manual(labels = c("forgotten", "remembered"), values=c(2,1),guide = 'none') +
- scale_x_discrete("",labels=c("CS-","CS+")) +
- scale_y_continuous("Change in pupil dilation [mm]") +
- theme_classic() +
- theme(legend.title = element_blank(),
- legend.position = "bottom")
- cowplot::plot_grid(pupil_wave_plot,pupil_plot,ncol=2,rel_widths=c(2,1),labels=c("A","B"))
- # Calculate linear mixed model
- pupil_model <- pupil_df %>%
- filter(include_final == 1) %>% #take only included subjects
- select(ID,ASI_sum_labor,condition,memorized,dilation) %>% #this line is technically not necessary
- group_by(ID,condition,memorized,ASI_sum_labor) %>% # average over single trials
- summarise(dilation = mean(dilation)) %>% ungroup() %>%
- mutate(cue = factor(condition,labels = c("csm","csp")), #factorize factors
- memorized = factor(memorized)) %>%
- lmer(dilation ~ cue * memorized * ASI_sum_labor + (1|ID), data = .) #cue, memory, as factors, asi as continuous, id as random
- anova(pupil_model,ddf ="Kenward-Roger") # show results
- r2beta(pupil_model,method="kr") #Effectsize and 95-CI estimation
- # Follow up Tests:
- # Calculate linear mixed model
- lm <- pupil_df %>%
- filter(include_final == 1) %>% #take only included subjects
- select(ID,ASI_sum_labor,condition,memorized,dilation) %>% #this line is technically not necessary
- group_by(ID,condition,memorized,ASI_sum_labor) %>% # average over single trials
- summarise(dilation = mean(dilation)) %>% ungroup() %>%
- mutate(cue = factor(condition,labels = c("csm","csp")), #factorize factors
- memorized = factor(memorized)) %>%
- filter(cue == "csp") %>%
- lmer(dilation ~ memorized * ASI_sum_labor + (1|ID), data = .) #cue, memory, as factors, asi as continuous, id as random
- anova(lm,ddf ="Kenward-Roger") # show results
- r2beta(lm,method="kr") #Effectsize and 95-CI estimation
- # Calculate linear mixed model
- lm <- pupil_df %>%
- filter(include_final == 1) %>% #take only included subjects
- select(ID,ASI_sum_labor,condition,memorized,dilation) %>% #this line is technically not necessary
- group_by(ID,condition,memorized,ASI_sum_labor) %>% # average over single trials
- summarise(dilation = mean(dilation)) %>% ungroup() %>%
- mutate(cue = factor(condition,labels = c("csm","csp")), #factorize factors
- memorized = factor(memorized)) %>%
- filter(cue == "csm") %>%
- lmer(dilation ~ memorized * ASI_sum_labor + (1|ID), data = .)
- anova(lm,ddf ="Kenward-Roger") # show results
- r2beta(lm,method="kr") #Effectsize and 95-CI estimation
- # ERP Analysis
- p300Data = read.table("C:/Users/yas70ym/Documents/Experimente/Experiment JW - EEG SME/P300.txt",header=T) %>%
- mutate(ID = substr(ERPset,1,4),
- bini = factor(bini),
- condition = factor(bini,labels = c("CSp_re",
- "CSp_fo",
- "CSm_re",
- "CSm_fo",
- "US_re",
- "US_fo",
- "OM_re",
- "OM_fo",
- "CSp",
- "CSm",
- "US",
- "OM"))) %>%
- select(-ERPset,-bini) %>%
- separate(condition,into=c("condition","memory")) %>%
- mutate(memory = ifelse(is.na(memory),"all",memory)) %>%
- left_join(sampledata, by = "ID") %>%
- mutate(ID = factor(ID),
- condition = factor(condition),
- memory = factor(memory),
- ASI_median = factor(ASI_median, labels=c("low ASI", "high ASI")),
- chlabel = factor(chlabel))
- LPPData = read.table("C:/Users/yas70ym/Documents/Experimente/Experiment JW - EEG SME/LPP.txt",header=T) %>%
- mutate(ID = substr(ERPset,1,4),
- bini = factor(bini),
- condition = factor(bini,labels = c("CSp_re",
- "CSp_fo",
- "CSm_re",
- "CSm_fo",
- "US_re",
- "US_fo",
- "OM_re",
- "OM_fo",
- "CSp_all",
- "CSm_all",
- "US_all",
- "OM_all"))) %>%
- select(-ERPset,-bini) %>%
- separate(condition,into=c("condition","memory")) %>%
- mutate(memory = ifelse(is.na(memory),"all",memory)) %>%
- left_join(sampledata, by = "ID")%>%
- mutate(ID = factor(ID),
- condition = factor(condition),
- memory = factor(memory),
- ASI_median = factor(ASI_median, labels=c("low ASI", "high ASI")),
- chlabel = factor(chlabel))
- # Full analysis with Memory, ASI, and CS:
- # LPP
- # Pz biggest effects:
- # CS x Memory x ASI
- lm <- LPPData %>%
- filter(condition %in% c("CSp","CSm")) %>%
- filter(memory != "all") %>%
- filter(include_final == 1) %>%
- filter(chlabel == "Pz") %>%
- lmer(value ~ condition * memory * ASI_sum_labor + (1|ID), data = .)
- #cue, memory, as factors, asi as continuous, id as random
- anova(lm,ddf ="Kenward-Roger") # show results
- r2beta(lm,method="kr") #Effectsize and 95-CI estimation
- LPPData %>%
- filter(condition %in% c("CSp")) %>%
- filter(memory != "all") %>%
- filter(include_final == 1) %>%
- filter(chlabel == "Pz") %>%
- lmer(value ~ memory * ASI_sum_labor + (1|ID), data = .) %>%
- #cue, memory, as factors, asi as continuous, id as random
- anova() # show results
- LPPData %>%
- filter(condition %in% c("CSm")) %>%
- filter(memory != "all") %>%
- filter(include_final == 1) %>%
- filter(chlabel == "Pz") %>%
- lmer(value ~ memory * ASI_sum_labor + (1|ID), data = .) %>%
- #cue, memory, as factors, asi as continuous, id as random
- anova() # show results
- lpp_cue_plot <- LPPData %>%
- filter(condition %in% c("CSp","CSm")) %>%
- filter(memory != "all") %>%
- filter(chlabel == "Pz") %>%
- filter(include_final == 1) %>%
- group_by(condition,memory,ASI_median,chlabel) %>%
- summarise(mean = mean(value),
- se = sd(value)/sqrt(n())) %>%
- ggplot(aes(x = condition, y = mean, linetype = memory, fill = ASI_median, group = interaction(ASI_median,memory))) +
- geom_errorbar(aes(ymin = mean-se, ymax=mean+se), linetype = 1, width = 0.1,,position = position_dodge(width=0.2)) +
- geom_line(position = position_dodge(width=0.2)) +
- geom_point(size = 3, shape = 21,position = position_dodge(width=0.2)) +
- scale_fill_manual(labels = c("low ASI", "high ASI"), values=c("darkgoldenrod3","darkblue"))+
- scale_linetype_manual(labels = c("forgotten", "remembered"), values=c(2,1)) +##,guide = 'none') +
- scale_x_discrete("",labels=c("CS-","CS+")) +
- scale_y_continuous("LPP [µV]") +
- theme_classic() +
- theme(legend.title = element_blank(),
- legend.position = "none")
- # P300
- # Pz biggest effects:
- # CS x Memory x ASI
- lm <- p300Data %>%
- filter(condition %in% c("CSp","CSm")) %>%
- filter(memory != "all") %>%
- filter(include_final == 1) %>%
- filter(chlabel == "Pz") %>%
- lmer(value ~ condition * memory * ASI_sum_labor + (1|ID), data = .)
- anova(lm,ddf ="Kenward-Roger") # show results
- r2beta(lm,method="kr") #Effectsize and 95-CI estimation
- p300Data %>%
- filter(condition %in% c("CSp")) %>%
- filter(memory != "all") %>%
- filter(include_final == 1) %>%
- filter(chlabel == "Pz") %>%
- lmer(value ~ memory * ASI_sum_labor + (1|ID), data = .) %>%
- #cue, memory, as factors, asi as continuous, id as random
- anova() # show results
- p300Data %>%
- filter(condition %in% c("CSm")) %>%
- filter(memory != "all") %>%
- filter(include_final == 1) %>%
- filter(chlabel == "Pz") %>%
- lmer(value ~ memory * ASI_sum_labor + (1|ID), data = .) %>%
- #cue, memory, as factors, asi as continuous, id as random
- anova() # show results
- p300_cue_plot <- p300Data %>%
- filter(condition %in% c("CSp","CSm")) %>%
- filter(memory != "all") %>%
- filter(chlabel == "Pz") %>%
- filter(include_final == 1) %>%
- group_by(condition,memory,ASI_median,chlabel) %>%
- summarise(mean = mean(value),
- se = sd(value)/sqrt(n())) %>%
- ggplot(aes(x = condition, y = mean, linetype = memory, fill = ASI_median, group = interaction(ASI_median,memory))) +
- geom_errorbar(aes(ymin = mean-se, ymax=mean+se), linetype = 1, width = 0.1,,position = position_dodge(width=0.2)) +
- geom_line(position = position_dodge(width=0.2)) +
- geom_point(size = 3, shape = 21,position = position_dodge(width=0.2)) +
- scale_fill_manual(labels = c("low ASI", "high ASI"), values=c("darkgoldenrod3","darkblue"))+
- scale_linetype_manual(labels = c("forgotten", "remembered"), values=c(2,1)) +##,guide = 'none') +
- scale_x_discrete("",labels=c("CS-","CS+")) +
- scale_y_continuous("P300 [µV]") +
- theme_classic() +
- theme(legend.position = "none",
- legend.title = element_blank())
- plot_labels <- p300Data %>%
- filter(condition %in% c("CSp","CSm")) %>%
- filter(memory != "all") %>%
- filter(chlabel == "Pz") %>%
- filter(include_final == 1) %>%
- group_by(condition,memory,ASI_median,chlabel) %>%
- summarise(mean = mean(value),
- se = sd(value)/sqrt(n())) %>%
- ggplot(aes(x = condition, y = mean, linetype = memory, fill = ASI_median, group = interaction(ASI_median,memory))) +
- geom_errorbar(aes(ymin = mean-se, ymax=mean+se), linetype = 1, width = 0.1,,position = position_dodge(width=0.2)) +
- geom_line(position = position_dodge(width=0.2)) +
- geom_point(size = 3, shape = 21,position = position_dodge(width=0.2)) +
- scale_fill_manual(labels = c("low ASI", "high ASI"), values=c("darkgoldenrod3","darkblue"))+
- scale_linetype_manual(labels = c("forgotten", "remembered"), values=c(2,1)) +##,guide = 'none') +
- scale_x_discrete("",labels=c("CS-","CS+")) +
- scale_y_continuous("P300 [µV]") +
- theme_void() +
- theme(legend.position = "bottom",
- legend.title = element_blank())
- legend <- ggpubr::as_ggplot(ggpubr::get_legend(plot_labels))
- cowplot::plot_grid(cowplot::plot_grid(p300_cue_plot,lpp_cue_plot,ncol=2,labels=c("A","B"),rel_widths = c(1,1)),legend, nrow=2, rel_heights = c(1,0.1))
- # OM: Memory x Channel x Gruppe
- lm <- LPPData %>%
- filter(condition %in% c("OM")) %>%
- filter(memory != "all") %>%
- filter(include_final == 1) %>%
- filter(chlabel == "Cz") %>%
- lmer(value ~ memory * ASI_sum_labor + (1|ID), data = .)
- anova(lm,ddf ="Kenward-Roger") # show results
- r2beta(lm,method="kr") #Effectsize and 95-CI estimation
- lpp_om_plot <- LPPData %>%
- filter(condition %in% c("OM")) %>%
- filter(memory != "all") %>%
- filter(chlabel == "Cz") %>%
- filter(include_final == 1) %>%
- group_by(memory,ASI_median) %>%
- summarise(mean = mean(value),
- se = sd(value)/sqrt(n())) %>%
- ggplot(aes(x = memory, y = mean, fill = ASI_median, group = ASI_median)) +
- geom_errorbar(aes(ymin = mean-se, ymax=mean+se), linetype = 1, width = 0.1,,position = position_dodge(width=0.2)) +
- geom_line(position = position_dodge(width=0.2)) +
- geom_point(size = 3, shape = 21,position = position_dodge(width=0.2)) +
- scale_fill_manual(labels = c("low ASI", "high ASI"), values=c("darkgoldenrod3","darkblue"))+
- scale_x_discrete("",labels=c("forgotten","remembered")) +
- scale_y_continuous("LPP [µV]") +
- theme_classic() +
- theme(legend.position = "none",
- legend.title = element_blank())
- lm <- p300Data %>%
- filter(condition %in% c("OM")) %>%
- filter(memory != "all") %>%
- filter(include_final == 1) %>%
- filter(chlabel == "Cz") %>%
- #group_by(memory,ID,ASI_sum_labor) %>%
- #summarise(value = mean(value)) %>%
- lmer(value ~ memory * ASI_sum_labor + (1|ID), data = .)
- anova(lm,ddf ="Kenward-Roger") # show results
- r2beta(lm,method="kr") #Effectsize and 95-CI estimation
- p300_om_plot <- p300Data %>%
- filter(condition %in% c("OM")) %>%
- filter(memory != "all") %>%
- filter(chlabel == "Cz") %>%
- filter(include_final == 1) %>%
- group_by(memory,ASI_median) %>%
- summarise(mean = mean(value),
- se = sd(value)/sqrt(n())) %>%
- ggplot(aes(x = memory, y = mean, fill = ASI_median, group = ASI_median)) +
- geom_errorbar(aes(ymin = mean-se, ymax=mean+se), linetype = 1, width = 0.1,,position = position_dodge(width=0.2)) +
- geom_line(position = position_dodge(width=0.2)) +
- geom_point(size = 3, shape = 21,position = position_dodge(width=0.2)) +
- scale_fill_manual(labels = c("low ASI", "high ASI"), values=c("darkgoldenrod3","darkblue"))+
- scale_x_discrete("",labels=c("forgotten","remembered")) +
- scale_y_continuous("P300 [µV]") +
- theme_classic() +
- theme(legend.position = "none",
- legend.title = element_blank())
- legend_om_plot <- p300Data %>%
- filter(condition %in% c("OM")) %>%
- filter(memory != "all") %>%
- filter(chlabel == "Cz") %>%
- filter(include_final == 1) %>%
- group_by(memory,ASI_median) %>%
- summarise(mean = mean(value),
- se = sd(value)/sqrt(n())) %>%
- ggplot(aes(x = memory, y = mean, fill = ASI_median, group = ASI_median)) +
- geom_errorbar(aes(ymin = mean-se, ymax=mean+se), linetype = 1, width = 0.1,,position = position_dodge(width=0.2)) +
- geom_line(position = position_dodge(width=0.2)) +
- geom_point(size = 3, shape = 21,position = position_dodge(width=0.2)) +
- scale_fill_manual(labels = c("low ASI", "high ASI"), values=c("darkgoldenrod3","darkblue"))+
- scale_x_discrete("",labels=c("forgotten","remembered")) +
- scale_y_continuous("P300 [µV]") +
- theme_classic() +
- theme(legend.position = "bottom",
- legend.title = element_blank())
- legend_om <- ggpubr::as_ggplot(ggpubr::get_legend(legend_om_plot))
- cowplot::plot_grid(cowplot::plot_grid(p300_om_plot,lpp_om_plot,ncol=2,labels=c("A","B")),
- legend_om,
- nrow=2, rel_heights = c(1,0.1))
- # Plot Waveforms
- high_csmfo <- read.table("Plots/Topographies/High__csmfo .txt", header = T) %>%
- select(time,Pz) %>% mutate(ASI_group = "high",
- condition = "csm",
- memory = "fo")
- high_cspfo <- read.table("Plots/Topographies/High__cspfo .txt", header = T) %>%
- select(time,Pz) %>% mutate(ASI_group = "high",
- condition = "csp",
- memory = "fo")
- high_csmre <- read.table("Plots/Topographies/High__csmre .txt", header = T) %>%
- select(time,Pz) %>% mutate(ASI_group = "high",
- condition = "csm",
- memory = "re")
- high_cspre <- read.table("Plots/Topographies/High__cspre .txt", header = T) %>%
- select(time,Pz) %>% mutate(ASI_group = "high",
- condition = "csp",
- memory = "re")
- high_omfo<- read.table("Plots/Topographies/High__omfo.txt", header = T) %>%
- select(time,Cz) %>% mutate(ASI_group = "high",
- condition = "om",
- memory = "fo")
- high_omre <- read.table("Plots/Topographies/High__omre.txt", header = T) %>%
- select(time,Cz) %>% mutate(ASI_group = "high",
- condition = "om",
- memory = "re")
- low_csmfo <- read.table("Plots/Topographies/Low__csmfo .txt", header = T) %>%
- select(time,Pz) %>% mutate(ASI_group = "low",
- condition = "csm",
- memory = "fo")
- low_cspfo <- read.table("Plots/Topographies/Low__cspfo .txt", header = T) %>%
- select(time,Pz) %>% mutate(ASI_group = "low",
- condition = "csp",
- memory = "fo")
- low_csmre <- read.table("Plots/Topographies/Low__csmre .txt", header = T) %>%
- select(time,Pz) %>% mutate(ASI_group = "low",
- condition = "csm",
- memory = "re")
- low_cspre <- read.table("Plots/Topographies/Low__cspre .txt", header = T) %>%
- select(time,Pz) %>% mutate(ASI_group = "low",
- condition = "csp",
- memory = "re")
- low_omfo<- read.table("Plots/Topographies/Low__omfo.txt", header = T) %>%
- select(time,Cz) %>% mutate(ASI_group = "low",
- condition = "om",
- memory = "fo")
- low_omre <- read.table("Plots/Topographies/Low__omre.txt", header = T) %>%
- select(time,Cz) %>% mutate(ASI_group = "low",
- condition = "om",
- memory = "re")
- cs_erps <- high_csmfo %>%
- rbind(high_cspfo) %>%
- rbind(high_csmre) %>%
- rbind(high_cspre) %>%
- rbind(low_csmfo) %>%
- rbind(low_cspfo) %>%
- rbind(low_csmre) %>%
- rbind(low_cspre) %>%
- mutate(ASI_group = factor(ASI_group),
- condition = factor(condition),
- memory = factor(memory))
- om_erps <- high_omfo %>%
- rbind(high_omre) %>%
- rbind(low_omfo) %>%
- rbind(low_omre)
- # Plot Cue-related Waveforms
- csp_erp_plot <- cs_erps %>%
- filter(condition %in% c("csp")) %>%
- ggplot(aes(x = time, y = Pz, color = ASI_group, linetype = memory)) +
- geom_vline(xintercept = 0,linetype = 2) +
- geom_line() +
- scale_color_manual(labels = c("high ASI", "low ASI"), values=c("darkblue","darkgoldenrod3"))+
- scale_linetype_manual(labels = c("forgotten", "remembered"), values=c(2,1)) +##,guide = 'none') +
- scale_x_continuous("Time [ms]", expand = c(0.05,0.05), breaks=c(-200,0,200,400,600,800,1000)) +
- scale_y_continuous("CS+ ERP [µV]") +
- theme_classic() +
- theme(legend.title = element_blank(),
- legend.position = "none")
- csm_erp_plot <- cs_erps %>%
- filter(condition %in% c("csm")) %>%
- ggplot(aes(x = time, y = Pz, color = ASI_group, linetype = memory)) +
- geom_vline(xintercept = 0,linetype = 2) +
- geom_line() +
- scale_color_manual(labels = c("high ASI", "low ASI"), values=c("darkblue","darkgoldenrod3"))+
- scale_linetype_manual(labels = c("forgotten", "remembered"), values=c(2,1)) +##,guide = 'none') +
- scale_x_continuous("Time [ms]", expand = c(0.05,0.05), breaks=c(-200,0,200,400,600,800,1000)) +
- scale_y_continuous("CS- ERP [µV]") +
- theme_classic() +
- theme(legend.title = element_blank(),
- legend.position = "none")
- cowplot::plot_grid(csm_erp_plot,csp_erp_plot,ncol=2,labels=c("D","E"),rel_widths = c(1,1))
- # Plot Omission-related Waveforms
- om_erps %>%
- filter(condition %in% c("om")) %>%
- ggplot(aes(x = time, y = Cz, color = ASI_group, linetype = memory)) +
- geom_vline(xintercept = 0,linetype = 2) +
- geom_line() +
- scale_color_manual(labels = c("high ASI", "low ASI"), values=c("darkblue","darkgoldenrod3"))+
- scale_linetype_manual(labels = c("forgotten", "remembered"), values=c(2,1)) +##,guide = 'none') +
- scale_x_continuous("Time [ms]", expand = c(0.05,0.05), breaks=c(-200,0,200,400,600,800,1000)) +
- scale_y_continuous("CS- offset ERP [µV]") +
- theme_classic() +
- theme(legend.title = element_blank(),
- legend.position = "none")
EEG-SME OSF.R, no license · at the source
Overview
- Department of Psychology, University of Würzburg,Marcusstraße 9-11, 97070 Würzburg, Germany
- Department of General Psychiatry and Psychotherapy, University Hospital Tübingen,Tübingen, Germany
- Tübingen Center for Mental Health, University Hospital Tübingen,Tübingen, Germany
Abstract
The ability to accurately detect and remember threatening stimuli is essential for adaptive behavior in potentially dangerous environments. While threat-related defensive processes are increasingly well understood, recent research has begun to emphasize complementary safety-related attention and learning mechanisms, processes especially relevant to the development and maintenance of pathological anxiety. Prior fear conditioning studies have identified a key role for late positive event-related potentials, particularly the P300 and late positive potential (LPP) in the formation of declarative memories related to threat and safety. However, the influence of individual differences in anxiety on these mechanisms remains insufficiently explored. In the present study, we examined how anxiety sensitivity, a transdiagnostic risk factor for anxiety-related pathologies, modulates attention and memory processes during declarative threat and safety learning. Using a subsequent memory paradigm, we recorded event-related potentials as participants learned associations between neutral faces and either an aversive outcome or safety. Stronger P300 and LPP amplitudes were found for remembered compared with forgotten items. Crucially, elevated anxiety sensitivity was associated with increased P300 and LPP amplitudes at the onset of both threat and safety cues, indicating heightened attentional allocation to both types of stimuli. Despite these amplified neural responses during memory encoding, higher anxiety sensitivity did not correspond to enhanced memory performance. These results suggest that, while individuals at heightened risk for anxiety-related psychopathology exhibit generalized hypervigilance, this increased attentional engagement does not necessarily translate into enhanced memory formation during intentional learning.
Supplementary Information: The online version contains supplementary material available at https://
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 83zbx
Availability: 1 check, the latest on 28 September 2026: the link answers (HTTP 200)
- 28 September 2026: the link answers (HTTP 200)
1 file
- EEG-SME OSF.R, R, 697 lines, 1 match
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;
- 1 match between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Data availability
All data and code behind the analyses have been made publicly available at the Open Science Framework and can be accessed at https://
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 2, 28 September 2026
- Publisher: n/a → Springer Science+Business Media
Version 1, 28 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 4 authors, 5 keywords, 15 MeSH terms, 2 funders, 71 references.
Cite
This paper
Stegmann, Y., Glück, V., Andreatta, M., & Wiemer, J. (2026). Attentional processing in individual anxiety: Electrocortical correlates of threat- and safety-related declarative memory formation. Cognitive, affective & behavioral neuroscience, 26(5), 2297-2310. https://
BibTeX
@article{stegmann2026att
author = {Stegmann, Yannik and Glück, Valentina and Andreatta, Marta and Wiemer, Julian},
title = {{Attentional processing in individual anxiety: Electrocortical correlates of threat- and safety-related declarative memory formation}},
journal = {Cognitive, affective \& behavioral neuroscience},
year = {2026},
month = may,
volume = {26},
number = {5},
pages = {2297--2310},
publisher = {Springer Science+Business Media},
issn = {1530-7026},
doi = {10.3758/
url = {https://
pmid = {42120709},
pmcid = {PMC13615150}
}
RIS
TY - JOUR
AU - Stegmann, Yannik
AU - Glück, Valentina
AU - Andreatta, Marta
AU - Wiemer, Julian
TI - Attentional processing in individual anxiety: Electrocortical correlates of threat- and safety-related declarative memory formation
T2 - Cognitive, affective & behavioral neuroscience
J2 - Cogn Affect Behav Neurosci
PY - 2026
DA - 2026/
VL - 26
IS - 5
SP - 2297
EP - 2310
SN - 1530-7026
PB - Springer Science+Business Media
DO - 10.3758/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.3758/
"type": "article-journal",
"title": "Attentional processing in individual anxiety: Electrocortical correlates of threat- and safety-related declarative memory formation",
"container-title": "Cognitive, affective & behavioral neuroscience",
"author": [
{
"family": "Stegmann",
"given": "Yannik"
},
{
"family": "Glück",
"given": "Valentina"
},
{
"family": "Andreatta",
"given": "Marta"
},
{
"family": "Wiemer",
"given": "Julian"
}
],
"container-title-short":
"volume": "26",
"issue": "5",
"page": "2297-2310",
"DOI": "10.3758/
"PMID": "42120709",
"PMCID": "PMC13615150",
"ISSN": "1530-7026",
"publisher": "Springer Science+Business Media",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
5,
12
]
]
}
}
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.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, ggpubr, 1 other tool, EEG, cognitive, 3 references
- [2] doi:10.1038/s41467-026-74565-0 [code]
- The functional neurobiology of dispositions towards negative emotions.Journal: Nature communicationsIn common: afex, psych, cowplot, 1 other tool, cognitive, 1 reference
- [3] doi:10.1038/s41537-026-00761-y [code]
- The role of fear learning in the development of psychosis: an EEG study utilizing a differential fear conditioning paradigm in people with psychotic vulnerability.Journal: Schizophrenia (Heidelberg, Germany)In common: psych, tidyverse, EEG, 4 references
- [4] doi:10.1038/s41598-026-42906-0
- Social learning of emotion and its implication for memory: an ERP study.Journal: Scientific reportsIn common: EEG, cognitive, 5 references
- [5] doi:10.1016/j.neuroimage.2026.122115 [code]
- Midfrontal theta power relates to response speeding following frustrative nonreward.Journal: NeuroImageIn common: psych, ggpubr, tidyverse, EEG, cognitive, 3 references
- [6] doi:10.1371/journal.pbio.3003979 [code]
- Impaired midfrontal‑motor theta phase synchronization characterizes maladaptive motivational behavior in people with obsessive‑compulsive disorder.Journal: PLoS biologyIn common: afex, psych, tidyverse, EEG, other condition, 2 references
- [7] doi:10.1038/s44271-026-00431-w [code]
- Alpha power increases spontaneously during a neurofeedback session.Journal: Communications psychologyIn common: afex, cowplot, ggpubr, 1 other tool, EEG, cognitive, 1 reference
- [8] doi:10.1111/psyp.70265 [code]
- Neurocognitive Dynamics of Translating Information From a Spatial Map Into Action.Journal: PsychophysiologyIn common: cowplot, ggpubr, tidyverse, EEG, cognitive, 3 references
- [9] doi:10.1111/psyp.70285 [code]
- Spontaneous Modulation of Alpha Power During a Neurofeedback Session Without Instructions.Journal: PsychophysiologyIn common: afex, cowplot, ggpubr, 1 other tool, EEG, 1 reference
- [10] doi:10.7554/elife.103566 [code]
- Effort produces after-effects costly for others but valued for self.Journal: eLifeIn common: psych, ggpubr, tidyverse, EEG, 3 references
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
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, 1 script, 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:4a6646788e8ee8c8…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[.
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.
