OSCR

Social Anxiety Predicts Enhanced Electrocortical Sensitivity to the Mental State Meanings Revealed by Gaze Patterns.

Code ↔ Paper

The paper beside its authors' code: matches between them have not been computed for this paper yet.

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 · 577 lines · 25 KB · no license

  1. #############################################################################################################
  2. ##### SOCIAL ANXIETY PREDICTS THE TIMELINESS OF GAZE MEANING DETECTION: AN ELECTROCORTICAL INVESTIGATION ####
  3. ################## IRENE MELANI, MARTHA K. BERG, JAMES GLAZER, AND SHINOBU KITAYAMA #########################
  4. #############################################################################################################
  5. #load packages
  6. library(psych)
  7. library(lme4)
  8. library(lmerTest)
  9. library(ggplot2)
  10. library(emmeans)
  11. library(tidyverse)
  12. library(dplyr)
  13. library(Hmisc)
  14. library(patchwork)
  15. #set path
  16. setwd('C:\\Users\\irene\\Documents\\Michigan\\RME\\Data\\R Script')
  17. #########################
  18. # Load and prepare data
  19. #########################
  20. #load data
  21. RME <- read.csv('Data_RME.csv')
  22. CTRL <- read.csv('Data_CTRL.csv')
  23. #combine data from RME and Control tasks
  24. all <- rbind(RME, CTRL)
  25. #########################
  26. # Descriptive Statistics
  27. #########################
  28. #Descriptive statistics for RME condition
  29. #Main variables
  30. RME %>% group_by(Subject) %>% summarise(sex_cont = mean(sex_cont)) %>% count(sex_cont)
  31. RME %>%
  32. group_by(Subject) %>%
  33. summarise(
  34. age = mean(age),
  35. socanx = mean(socanx),
  36. accuracy = mean(accuracy),
  37. rt = mean(rt)) %>%
  38. summarise(
  39. age_mean = mean(age), age_sd = sd(age),
  40. socanx_mean = mean(socanx), socanx_sd = sd(socanx),
  41. acc_mean = mean(accuracy), acc_sd = sd(accuracy),
  42. rt_mean = mean(rt), rt_sd = sd(rt))
  43. #Supplementary variables
  44. RME %>%
  45. group_by(Subject) %>%
  46. summarise(
  47. indep = mean(indep),
  48. interdep = mean(interdep),
  49. open = mean(open),
  50. conscient = mean(conscient),
  51. extro = mean(extro),
  52. agree = mean(agree),
  53. neurot = mean(neurot)) %>%
  54. summarise(
  55. indep_mean = mean(indep, na.rm = TRUE), indep_sd = sd(indep, na.rm = TRUE),
  56. interdep_mean = mean(interdep, na.rm = TRUE), interdep_sd = sd(interdep, na.rm = TRUE),
  57. open_mean = mean(open), open_sd = sd(open),
  58. conscient_mean = mean(conscient), conscient_sd = sd(conscient),
  59. extro_mean = mean(extro), extro_sd = sd(extro),
  60. agree_mean = mean(agree), agree_sd = sd(agree),
  61. neurot_mean = mean(neurot), neurot_sd = sd(neurot))
  62. #Descriptive statistics for Control condition
  63. #Main variables
  64. CTRL %>% group_by(Subject) %>% summarise(sex_cont = mean(sex_cont)) %>% count(sex_cont)
  65. CTRL %>%
  66. group_by(Subject) %>%
  67. summarise(
  68. age = mean(age),
  69. socanx = mean(socanx),
  70. accuracy = mean(accuracy),
  71. rt = mean(rt)) %>%
  72. summarise(
  73. age_mean = mean(age), age_sd = sd(age),
  74. socanx_mean = mean(socanx), socanx_sd = sd(socanx),
  75. acc_mean = mean(accuracy), acc_sd = sd(accuracy),
  76. rt_mean = mean(rt), rt_sd = sd(rt))
  77. #Supplementary variables
  78. CTRL %>%
  79. group_by(Subject) %>%
  80. summarise(
  81. indep = mean(indep),
  82. interdep = mean(interdep),
  83. open = mean(open),
  84. conscient = mean(conscient),
  85. extro = mean(extro),
  86. agree = mean(agree),
  87. neurot = mean(neurot)) %>%
  88. summarise(
  89. indep_mean = mean(indep, na.rm = TRUE), indep_sd = sd(indep, na.rm = TRUE),
  90. interdep_mean = mean(interdep, na.rm = TRUE), interdep_sd = sd(interdep, na.rm = TRUE),
  91. open_mean = mean(open), open_sd = sd(open),
  92. conscient_mean = mean(conscient), conscient_sd = sd(conscient),
  93. extro_mean = mean(extro), extro_sd = sd(extro),
  94. agree_mean = mean(agree), agree_sd = sd(agree),
  95. neurot_mean = mean(neurot), neurot_sd = sd(neurot))
  96. #Compare descriptive statistics across tasks
  97. #Main variables
  98. prop.test(x = c(43, 25), n = c(57, 50))
  99. all %>% group_by(Subject, task) %>% summarise(age = mean(age)) %>% t.test(age ~ task, data = .)
  100. all %>% group_by(Subject, task) %>% summarise(socanx = mean(socanx)) %>% t.test(socanx ~ task, data = .)
  101. all %>% group_by(Subject, task) %>% summarise(accuracy = mean(accuracy)) %>% t.test(accuracy ~ task, data = .)
  102. all %>% group_by(Subject, task) %>% summarise(rt = mean(rt)) %>% t.test(rt ~ task, data = .)
  103. #Supplementary variables
  104. all %>% group_by(Subject, task) %>% summarise(indep = mean(indep)) %>% t.test(indep ~ task, data = .)
  105. all %>% group_by(Subject, task) %>% summarise(interdep = mean(interdep)) %>% t.test(interdep ~ task, data = .)
  106. all %>% group_by(Subject, task) %>% summarise(open = mean(open)) %>% t.test(open ~ task, data = .)
  107. all %>% group_by(Subject, task) %>% summarise(conscient = mean(conscient)) %>% t.test(conscient ~ task, data = .)
  108. all %>% group_by(Subject, task) %>% summarise(extro = mean(extro)) %>% t.test(extro ~ task, data = .)
  109. all %>% group_by(Subject, task) %>% summarise(agree = mean(agree)) %>% t.test(agree ~ task, data = .)
  110. all %>% group_by(Subject, task) %>% summarise(neurot = mean(neurot)) %>% t.test(neurot ~ task, data = .)
  111. ################
  112. # Main Analyses
  113. ################
  114. #Task Performance
  115. #Predict accuracy from congruence * social anxiety
  116. RME.accmod <- glmer(accuracy ~ sex_cont + c_socanx * congruence_cont + (1 | Subject) + (1 | FaceNum),
  117. data = RME, family = binomial)
  118. summary(RME.accmod)
  119. confint(RME.accmod)
  120. CTRL.accmod <- glmer(accuracy ~ sex_cont + c_socanx * congruence_cont + (1 | Subject) + (1 | FaceNum),
  121. data = CTRL, family = binomial)
  122. summary(CTRL.accmod)
  123. confint(CTRL.accmod)
  124. #Predict accuracy from congruence * social anxiety * task
  125. all.accmod <- glmer(accuracy ~ sex_cont + c_socanx * congruence_cont * task + (1 | Subject) + (1 | FaceNum),
  126. data = all, family = binomial)
  127. summary(all.accmod)
  128. confint(all.accmod)
  129. #Drop incorrectly answered trials for neural and reaction time analyses
  130. RME.correct <- subset(RME, RME$acc==1) #dropped 1573 trials = 21.71% of eligible trials
  131. CTRL.correct <- subset(CTRL, CTRL$acc==1) #dropped 999 trials = 15.41% of eligible trials
  132. all.correct <- rbind(RME.correct, CTRL.correct)
  133. #Perform analyses on correctly answered trials
  134. #N400 (Cz, CPz, Pz)
  135. #Predict amplitude from congruence * social anxiety
  136. RME.erpmod <- lmer(c_erp_avg ~ sex_cont + c_socanx * congruence_cont + (1 | Subject) + (1 | FaceNum),
  137. data = RME.correct, REML = TRUE)
  138. summary(RME.erpmod)
  139. confint(RME.erpmod)
  140. CTRL.erpmod <- lmer(c_erp_avg ~ sex_cont + c_socanx * congruence_cont + (1 | Subject) + (1 | FaceNum),
  141. data = CTRL.correct, REML = TRUE)
  142. summary(CTRL.erpmod)
  143. confint(CTRL.erpmod)
  144. #Predict amplitude from congruence * social anxiety * task
  145. all.erpmod <- lmer(c_erp_avg ~ sex_cont + c_socanx * congruence_cont * task + (1 | Subject) + (1 | FaceNum),
  146. data = all.correct, REML = TRUE)
  147. summary(all.erpmod)
  148. confint(all.erpmod)
  149. #Response Time
  150. #Predict RT from congruence * social anxiety
  151. RME.rtmod <- lmer(rt ~ sex_cont + c_socanx * congruence_cont + (1 | Subject) + (1 | FaceNum),
  152. data = RME.correct, REML = TRUE)
  153. summary(RME.rtmod)
  154. confint(RME.rtmod)
  155. CTRL.rtmod <- lmer(rt ~ sex_cont + c_socanx * congruence_cont + (1 | Subject) + (1 | FaceNum),
  156. data = CTRL.correct, REML = TRUE)
  157. summary(CTRL.rtmod)
  158. confint(CTRL.rtmod)
  159. #Predict RT from congruence * social anxiety * task
  160. all.rtmod <- lmer(rt ~ sex_cont + c_socanx * congruence_cont * task + (1 | Subject) + (1 | FaceNum),
  161. data = all.correct, REML = TRUE)
  162. summary(all.rtmod)
  163. confint(all.rtmod)
  164. ##############
  165. # Plot Figure
  166. ##############
  167. #Increase computing power so that the subsequent command can be run
  168. emm_options(pbkrtest.limit = 11158, lmerTest.limit = 11158)
  169. #Compute estimated marginal means from the ERP model for plotting
  170. figure_pred <- emmeans(all.erpmod, ~c_socanx * congruence_cont * task,
  171. at = list(c_socanx = c(-1.5, -1, -0.5, 0, 0.5, 1, 1.5),
  172. congruence_cont = c(-0.5, 0.5),
  173. task = c(0.5, -0.5))) %>%
  174. as.data.frame() %>%
  175. mutate(Congruence = congruence_cont %>% recode(`-0.5` = "Incongruent", `0.5` = "Congruent")) %>%
  176. mutate(Condition = task %>% recode(`0.5` = "RME Task", `-0.5` = "Control Task"))
  177. #Create figure
  178. #RME Task plot
  179. figure_rme <- figure_pred %>%
  180. filter(Condition == "RME Task") %>%
  181. ggplot(aes(x = c_socanx, y = emmean, linetype = Congruence)) +
  182. geom_line(linewidth = 1.1) +
  183. geom_ribbon(aes(ymin = emmean - SE, ymax = emmean + SE, fill = Congruence), alpha = 0.25) +
  184. scale_fill_grey(start = 0.3, end = 0.7) +
  185. scale_color_grey(start = 0.3, end = 0.7) +
  186. scale_y_reverse(limits = c(4, -5)) +
  187. theme_classic() +
  188. labs(title = "RME Task",
  189. x = "Social anxiety (centered)",
  190. y = expression(atop("N400 amplitude (" * mu * "V)", "Midline centroparietal (Cz, CPz, Pz)"))) +
  191. theme(axis.title.x = element_text(size = 14),
  192. axis.title.y = element_text(size = 14),
  193. axis.text.x = element_text(size = 12),
  194. axis.text.y = element_text(size = 12),
  195. legend.position = "none")
  196. figure_rme
  197. #Control Task plot
  198. figure_control <- figure_pred %>%
  199. filter(Condition == "Control Task") %>%
  200. ggplot(aes(x = c_socanx, y = emmean, linetype = Congruence)) +
  201. geom_line(linewidth = 1.1) +
  202. geom_ribbon(aes(ymin = emmean - SE, ymax = emmean + SE, fill = Congruence), alpha = 0.25) +
  203. scale_fill_grey(start = 0.3, end = 0.7) +
  204. scale_color_grey(start = 0.3, end = 0.7) +
  205. scale_y_reverse(limits = c(4, -5)) +
  206. theme_classic() +
  207. labs(title = "Control Task",
  208. x = "Social anxiety (centered)",
  209. y = expression(atop("N400 amplitude (" * mu * "V)", "Midline centroparietal (Cz, CPz, Pz)"))) +
  210. theme(axis.title.x = element_text(size = 14),
  211. axis.title.y = element_text(size = 14),
  212. axis.text.x = element_text(size = 12),
  213. axis.text.y = element_text(size = 12),
  214. legend.position = "none")
  215. figure_control
  216. #Combine RME and Control plots
  217. figure_combined <- (figure_rme + figure_control) +
  218. plot_layout(ncol = 2, guides = "collect") &
  219. theme(legend.position = "bottom", legend.title = element_blank(),
  220. legend.text = element_text(size = 11.5))
  221. #Display
  222. figure_combined
  223. #Export figure
  224. ggsave('Figure_1C_251225.png', figure_rme, width = 5, height = 4)
  225. ggsave('Figure_1D_251225.png', figure_control, width = 5, height = 4)
  226. #########################
  227. # Supplementary analyses
  228. #########################
  229. #Test primary model with sex as a moderator
  230. sexmoderator <- lmer(c_erp_avg ~ sex_cont * c_socanx * congruence_cont + (1 | Subject) + (1 | FaceNum),
  231. data = RME.correct, REML = TRUE)
  232. summary(sexmoderator)
  233. confint(sexmoderator)
  234. #Test valence interaction in primary model
  235. valence.rme.erpmod <- lmer(c_erp_avg ~ sex_cont + c_socanx * congruence_cont * Valence_factor + (1 | Subject) + (1 | FaceNum),
  236. data = RME.correct, REML = TRUE)
  237. summary(valence.rme.erpmod)
  238. confint(valence.rme.erpmod)
  239. #Test primary model controlling for other measures
  240. #Independent self-construal
  241. indep <- lmer(c_erp_avg ~ sex_cont + c_socanx * congruence_cont +
  242. c_indep:congruence_cont + c_indep +
  243. (1 | Subject) + (1 | FaceNum),
  244. data = RME.correct, REML = TRUE)
  245. summary(indep)
  246. confint(indep)
  247. #Interdependent self-construal
  248. interdep <- lmer(c_erp_avg ~ sex_cont + c_socanx * congruence_cont +
  249. c_interdep:congruence_cont + c_interdep +
  250. (1 | Subject) + (1 | FaceNum),
  251. data = RME.correct, REML = TRUE)
  252. summary(interdep)
  253. confint(interdep)
  254. #Openness to experience
  255. open <- lmer(c_erp_avg ~ sex_cont + c_socanx * congruence_cont +
  256. c_open:congruence_cont + c_open +
  257. (1 | Subject) + (1 | FaceNum),
  258. data = RME.correct, REML = TRUE)
  259. summary(open)
  260. confint(open)
  261. #Conscientiousness
  262. conscient <- lmer(c_erp_avg ~ sex_cont + c_socanx * congruence_cont +
  263. c_conscient:congruence_cont + c_conscient +
  264. (1 | Subject) + (1 | FaceNum),
  265. data = RME.correct, REML = TRUE)
  266. summary(conscient)
  267. confint(conscient)
  268. #Extraversion
  269. extro <- lmer(c_erp_avg ~ sex_cont + c_socanx * congruence_cont +
  270. c_extro:congruence_cont + c_extro +
  271. (1 | Subject) + (1 | FaceNum),
  272. data = RME.correct, REML = TRUE)
  273. summary(extro)
  274. confint(extro)
  275. #Agreeableness
  276. agree <- lmer(c_erp_avg ~ sex_cont + c_socanx * congruence_cont +
  277. c_agree:congruence_cont + c_agree +
  278. (1 | Subject) + (1 | FaceNum),
  279. data = RME.correct, REML = TRUE)
  280. summary(agree)
  281. confint(agree)
  282. #Neuroticism
  283. neurot <- lmer(c_erp_avg ~ sex_cont + c_socanx * congruence_cont +
  284. c_neurot:congruence_cont + c_neurot +
  285. (1 | Subject) + (1 | FaceNum),
  286. data = RME.correct, REML = TRUE)
  287. summary(neurot)
  288. confint(neurot)
  289. #N400 (Centroparietal [including lateral and midline]: Cz, C3, C4, CPz, CP1, CP2, CP5, CP6, Pz, P3, P4, P7, P8)
  290. #Predict amplitude from congruence * social anxiety
  291. RME.erp.centroparietal.mod <- lmer(c_n400_centroparietal_avg ~ sex_cont + c_socanx * congruence_cont + (1 | Subject) + (1 | FaceNum),
  292. data = RME.correct, REML = TRUE)
  293. summary(RME.erp.centroparietal.mod)
  294. confint(RME.erp.centroparietal.mod)
  295. CTRL.erp.centroparietal.mod <- lmer(c_n400_centroparietal_avg ~ sex_cont + c_socanx * congruence_cont + (1 | Subject) + (1 | FaceNum),
  296. data = CTRL.correct, REML = TRUE)
  297. summary(CTRL.erp.centroparietal.mod)
  298. confint(CTRL.erp.centroparietal.mod)
  299. #Predict amplitude from congruence * social anxiety * task
  300. all.erp.centroparietal.mod <- lmer(c_n400_centroparietal_avg ~ sex_cont + c_socanx * congruence_cont * task + (1 | Subject) + (1 | FaceNum),
  301. data = all.correct, REML = TRUE)
  302. summary(all.erp.centroparietal.mod)
  303. confint(all.erp.centroparietal.mod)
  304. #LPP (Cz, CPz, Pz)
  305. #Predict amplitude from congruence * social anxiety
  306. RME.lpp.czcpzpz.mod <- lmer(c_lpp_cz_cpz_pz_avg ~ sex_cont + c_socanx * congruence_cont + (1 | Subject) + (1 | FaceNum),
  307. data = RME.correct, REML = TRUE)
  308. summary(RME.lpp.czcpzpz.mod)
  309. confint(RME.lpp.czcpzpz.mod)
  310. CTRL.lpp.czcpzpz.mod <- lmer(c_lpp_cz_cpz_pz_avg ~ sex_cont + c_socanx * congruence_cont + (1 | Subject) + (1 | FaceNum),
  311. data = CTRL.correct, REML = TRUE)
  312. summary(CTRL.lpp.czcpzpz.mod)
  313. confint(CTRL.lpp.czcpzpz.mod)
  314. #Predict amplitude from congruence * social anxiety * task
  315. all.lpp.czcpzpz.mod <- lmer(c_lpp_cz_cpz_pz_avg ~ sex_cont + c_socanx * congruence_cont * task + (1 | Subject) + (1 | FaceNum),
  316. data = all.correct, REML = TRUE)
  317. summary(all.lpp.czcpzpz.mod)
  318. confint(all.lpp.czcpzpz.mod)
  319. #LPP (Centroparietal [including lateral and midline]: Cz, C3, C4, CPz, CP1, CP2, CP5, CP6, Pz, P3, P4, P7, P8)
  320. #Predict amplitude from congruence * social anxiety
  321. RME.lpp.centroparietal.mod <- lmer(c_lpp_centroparietal_avg ~ sex_cont + c_socanx * congruence_cont + (1 | Subject) + (1 | FaceNum),
  322. data = RME.correct, REML = TRUE)
  323. summary(RME.lpp.centroparietal.mod)
  324. confint(RME.lpp.centroparietal.mod)
  325. CTRL.lpp.centroparietal.mod <- lmer(c_lpp_centroparietal_avg ~ sex_cont + c_socanx * congruence_cont + (1 | Subject) + (1 | FaceNum),
  326. data = CTRL.correct, REML = TRUE)
  327. summary(CTRL.lpp.centroparietal.mod)
  328. confint(CTRL.lpp.centroparietal.mod)
  329. #Predict amplitude from congruence * social anxiety * task
  330. all.lpp.centroparietal.mod <- lmer(c_lpp_centroparietal_avg ~ sex_cont + c_socanx * congruence_cont * task + (1 | Subject) + (1 | FaceNum),
  331. data = all.correct, REML = TRUE)
  332. summary(all.lpp.centroparietal.mod)
  333. confint(all.lpp.centroparietal.mod)
  334. ###########################
  335. # Plot Supplemental Figure
  336. ###########################
  337. #N400 (Centroparietal [including lateral and midline])
  338. #Increase computing power so that the subsequent command can be run
  339. #Compute estimated marginal means from the ERP model for plotting
  340. figure_pred_n400_centroparietal <- emmeans(all.erp.centroparietal.mod, ~c_socanx * congruence_cont * task,
  341. at = list(c_socanx = c(-1.5, -1, -0.5, 0, 0.5, 1, 1.5),
  342. congruence_cont = c(-0.5, 0.5),
  343. task = c(0.5, -0.5))) %>%
  344. as.data.frame() %>%
  345. mutate(Congruence = congruence_cont %>% recode(`-0.5` = "Incongruent", `0.5` = "Congruent")) %>%
  346. mutate(Condition = task %>% recode(`0.5` = "RME Task", `-0.5` = "Control Task"))
  347. #Create figure
  348. #RME Task plot
  349. figure_rme_n400_centroparietal <- figure_pred_n400_centroparietal %>%
  350. filter(Condition == "RME Task") %>%
  351. ggplot(aes(x = c_socanx, y = emmean, linetype = Congruence)) +
  352. geom_line(linewidth = 1.1) +
  353. geom_ribbon(aes(ymin = emmean - SE, ymax = emmean + SE, fill = Congruence), alpha = 0.25) +
  354. scale_fill_grey(start = 0.3, end = 0.7) +
  355. scale_color_grey(start = 0.3, end = 0.7) +
  356. scale_y_reverse(limits = c(4, -4)) +
  357. theme_classic() +
  358. labs(title = "RME Task",
  359. x = "Social anxiety (centered)",
  360. y = expression(atop("N400 amplitude (" * mu * "V)", "Midline and lateral centroparietal"))) +
  361. theme(axis.title.x = element_text(size = 14),
  362. axis.title.y = element_text(size = 14),
  363. axis.text.x = element_text(size = 12),
  364. axis.text.y = element_text(size = 12),
  365. legend.position = "none")
  366. figure_rme_n400_centroparietal
  367. #Control Task plot
  368. figure_control_n400_centroparietal <- figure_pred_n400_centroparietal %>%
  369. filter(Condition == "Control Task") %>%
  370. ggplot(aes(x = c_socanx, y = emmean, linetype = Congruence)) +
  371. geom_line(linewidth = 1.1) +
  372. geom_ribbon(aes(ymin = emmean - SE, ymax = emmean + SE, fill = Congruence), alpha = 0.25) +
  373. scale_fill_grey(start = 0.3, end = 0.7) +
  374. scale_color_grey(start = 0.3, end = 0.7) +
  375. scale_y_reverse(limits = c(4, -4)) +
  376. theme_classic() +
  377. labs(title = "Control Task",
  378. x = "Social anxiety (centered)",
  379. y = expression(atop("N400 amplitude (" * mu * "V)", "Midline and lateral centroparietal"))) +
  380. theme(axis.title.x = element_text(size = 14),
  381. axis.title.y = element_text(size = 14),
  382. axis.text.x = element_text(size = 12),
  383. axis.text.y = element_text(size = 12),
  384. legend.position = "none")
  385. figure_control_n400_centroparietal
  386. #Combine RME and Control plots
  387. figure_combined_n400_centroparietal <- (figure_rme_n400_centroparietal + figure_control_n400_centroparietal) +
  388. plot_layout(ncol = 2, guides = "collect") &
  389. theme(legend.position = "bottom", legend.title = element_blank(),
  390. legend.text = element_text(size = 11.5))
  391. #Display
  392. figure_combined_n400_centroparietal
  393. #Export figure
  394. ggsave('Figure_S1C_251225.png', figure_rme_n400_centroparietal, width = 5, height = 4)
  395. ggsave('Figure_S1D_251225.png', figure_control_n400_centroparietal, width = 5, height = 4)
  396. #LPP (Centroparietal midline: Cz, CPz, Pz)
  397. #Compute estimated marginal means from the ERP model for plotting
  398. figure_pred_lpp_czcpzpz <- emmeans(all.lpp.czcpzpz.mod, ~c_socanx * congruence_cont * task,
  399. at = list(c_socanx = c(-1.5, -1, -0.5, 0, 0.5, 1, 1.5),
  400. congruence_cont = c(-0.5, 0.5),
  401. task = c(0.5, -0.5))) %>%
  402. as.data.frame() %>%
  403. mutate(Congruence = congruence_cont %>% recode(`-0.5` = "Incongruent", `0.5` = "Congruent")) %>%
  404. mutate(Condition = task %>% recode(`0.5` = "RME Task", `-0.5` = "Control Task"))
  405. #Create figure
  406. #RME Task plot
  407. figure_rme_lpp_czcpzpz <- figure_pred_lpp_czcpzpz %>%
  408. filter(Condition == "RME Task") %>%
  409. ggplot(aes(x = c_socanx, y = emmean, linetype = Congruence)) +
  410. geom_line(linewidth = 1.1) +
  411. geom_ribbon(aes(ymin = emmean - SE, ymax = emmean + SE, fill = Congruence), alpha = 0.25) +
  412. scale_fill_grey(start = 0.3, end = 0.7) +
  413. scale_color_grey(start = 0.3, end = 0.7) +
  414. scale_y_continuous(limits = c(-3.7, 5.0)) +
  415. theme_classic() +
  416. labs(title = "",
  417. x = "Social anxiety (centered)",
  418. y = expression(atop("LPP amplitude (" * mu * "V)", "Midline centroparietal (Cz, CPz, Pz)"))) +
  419. theme(axis.title.x = element_text(size = 14),
  420. axis.title.y = element_text(size = 14),
  421. axis.text.x = element_text(size = 12),
  422. axis.text.y = element_text(size = 12),
  423. legend.position = "none")
  424. figure_rme_lpp_czcpzpz
  425. #Control Task plot
  426. figure_control_lpp_czcpzpz <- figure_pred_lpp_czcpzpz %>%
  427. filter(Condition == "Control Task") %>%
  428. ggplot(aes(x = c_socanx, y = emmean, linetype = Congruence)) +
  429. geom_line(linewidth = 1.1) +
  430. geom_ribbon(aes(ymin = emmean - SE, ymax = emmean + SE, fill = Congruence), alpha = 0.25) +
  431. scale_fill_grey(start = 0.3, end = 0.7) +
  432. scale_color_grey(start = 0.3, end = 0.7) +
  433. scale_y_continuous(limits = c(-3.7, 5.0)) +
  434. theme_classic() +
  435. labs(title = "",
  436. x = "Social anxiety (centered)",
  437. y = expression(atop("LPP amplitude (" * mu * "V)", "Midline centroparietal (Cz, CPz, Pz)"))) +
  438. theme(axis.title.x = element_text(size = 14),
  439. axis.title.y = element_text(size = 14),
  440. axis.text.x = element_text(size = 12),
  441. axis.text.y = element_text(size = 12),
  442. legend.position = "none")
  443. figure_control_lpp_czcpzpz
  444. #Combine RME and Control plots
  445. figure_combined_lpp_czcpzpz <- (figure_rme_lpp_czcpzpz + figure_control_lpp_czcpzpz) +
  446. plot_layout(ncol = 2, guides = "collect") &
  447. theme(legend.position = "bottom", legend.title = element_blank(),
  448. legend.text = element_text(size = 11.5))
  449. #Display
  450. figure_combined_lpp_czcpzpz
  451. #Export figure
  452. ggsave('Figure_S3AB_251228.png', figure_combined_lpp_czcpzpz, width = 8, height = 4)
  453. #LPP (Centroparietal [including lateral and midline])
  454. #Compute estimated marginal means from the ERP model for plotting
  455. figure_pred_lpp_centroparietal <- emmeans(all.lpp.centroparietal.mod, ~c_socanx * congruence_cont * task,
  456. at = list(c_socanx = c(-1.5, -1, -0.5, 0, 0.5, 1, 1.5),
  457. congruence_cont = c(-0.5, 0.5),
  458. task = c(0.5, -0.5))) %>%
  459. as.data.frame() %>%
  460. mutate(Congruence = congruence_cont %>% recode(`-0.5` = "Incongruent", `0.5` = "Congruent")) %>%
  461. mutate(Condition = task %>% recode(`0.5` = "RME Task", `-0.5` = "Control Task"))
  462. #Create figure
  463. #RME Task plot
  464. figure_rme_lpp_centroparietal <- figure_pred_lpp_centroparietal %>%
  465. filter(Condition == "RME Task") %>%
  466. ggplot(aes(x = c_socanx, y = emmean, linetype = Congruence)) +
  467. geom_line(linewidth = 1.1) +
  468. geom_ribbon(aes(ymin = emmean - SE, ymax = emmean + SE, fill = Congruence), alpha = 0.25) +
  469. scale_fill_grey(start = 0.3, end = 0.7) +
  470. scale_color_grey(start = 0.3, end = 0.7) +
  471. scale_y_continuous(limits = c(-3, 4.7)) +
  472. theme_classic() +
  473. labs(title = "A) RME Task",
  474. x = "Social anxiety (centered)",
  475. y = expression(atop("LPP amplitude (" * mu * "V)", "Midline and lateral centroparietal"))) +
  476. theme(axis.title.x = element_text(size = 14),
  477. axis.title.y = element_text(size = 14),
  478. axis.text.x = element_text(size = 12),
  479. axis.text.y = element_text(size = 12),
  480. legend.position = "none")
  481. figure_rme_lpp_centroparietal
  482. #Control Task plot
  483. figure_control_lpp_centroparietal <- figure_pred_lpp_centroparietal %>%
  484. filter(Condition == "Control Task") %>%
  485. ggplot(aes(x = c_socanx, y = emmean, linetype = Congruence)) +
  486. geom_line(linewidth = 1.1) +
  487. geom_ribbon(aes(ymin = emmean - SE, ymax = emmean + SE, fill = Congruence), alpha = 0.25) +
  488. scale_fill_grey(start = 0.3, end = 0.7) +
  489. scale_color_grey(start = 0.3, end = 0.7) +
  490. scale_y_continuous(limits = c(-3, 4.7)) +
  491. theme_classic() +
  492. labs(title = "B) Control Task",
  493. x = "Social anxiety (centered)",
  494. y = expression(atop("LPP amplitude (" * mu * "V)", "Midline and lateral centroparietal"))) +
  495. theme(axis.title.x = element_text(size = 14),
  496. axis.title.y = element_text(size = 14),
  497. axis.text.x = element_text(size = 12),
  498. axis.text.y = element_text(size = 12),
  499. legend.position = "none")
  500. figure_control_lpp_centroparietal
  501. #Combine RME and Control plots
  502. figure_combined_lpp_centroparietal <- (figure_rme_lpp_centroparietal + figure_control_lpp_centroparietal) +
  503. plot_layout(ncol = 2, guides = "collect") &
  504. theme(legend.position = "bottom", legend.title = element_blank(),
  505. legend.text = element_text(size = 11.5))
  506. #Display
  507. figure_combined_lpp_centroparietal
  508. #Export figure
  509. ggsave('Figure_S3CD_251225.png', figure_combined_lpp_centroparietal, width = 8, height = 4)

SocAnx_ERP_260119.R, no license · at the source

Overview

  1. Department of Psychology, University of Michigan, Ann Arbor, Michigan, USA
  2. Department of Psychology, Northwestern University, Evanston, Illinois, USA
Institutions: University of Michigan (United States); Northwestern University (United States)
Journal: Psychophysiology, volume 63, issue 10, article e70409
Dates: received 5 April 2025; accepted 17 September 2026; published online 28 September 2026; in print October 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1111/psyp.70409 · PMID 42806618 · PMCID PMC13620438 · OpenAlex W7214732656
Open access: hybrid, a free copy (OpenAlex)
Status: code verified (how the code is found and verified)
Categories: EEG (modality), human (organism), other condition (population)
Methods: Connectivity, Preprocessing, Evoked potentials, Statistics
Keywords: event‐related potential, mental state inference, N400, semantic integration, social anxiety
MeSH: Anxiety*, Cerebral Cortex*, Evoked Potentials*, Fixation, Ocular*, Social Perception*, Theory of Mind*, Adolescent, Adult, Electroencephalography, Female, Humans, Male, Semantics, Young Adult (* major topic)
Topic: Anxiety, Depression, Psychometrics, Treatment, Cognitive Processes (Experimental and Cognitive Psychology, Psychology), according to OpenAlex
Funding: National Science Foundation (BCS 0717982, SES 1325881)
Citations: not cited yet (Europe PMC); 32 references in the paper

Abstract

Social anxiety—a fear of social interaction and negative evaluation—may be accompanied by heightened vigilance toward others' mental states, particularly those conveyed through gaze, as they provide cues about how one is being evaluated. We thus investigated whether individual differences in social anxiety predict neural sensitivity to the mental‐state meanings conveyed by gaze patterns. Fifty‐seven European American young adults varying in social anxiety viewed different gaze patterns, immediately followed by a mental‐state word that was either congruent or incongruent with the culturally recognized meaning of the gaze, while their electroencephalogram (EEG) was monitored. Our focus was N400—an event‐related potential (ERP) component indexing semantic expectation violations. We found the N400 amplitude to be more negative for incongruent (vs. congruent) mental‐state words. Notably, this N400 incongruity effect increased significantly with social anxiety. Moreover, the social anxiety effect was specific to mental state inference and was not observed in a comparable N400 incongruity effect involving animal stereotypes (n = 50). These findings suggest that social anxiety may confer enhanced neural sensitivity during the inference of others' mental states from gaze, even in the absence of overt performance differences. We discuss the implications of these findings with respect to the potential functional benefits of social anxiety.

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

Repository

Its files are read in the Code ↔ Paper reader above.

OSF tw5rp

License: none: the authors keep all their rights
State: the link answers, verified on 1 October 2026
Evidence: files inventoried
Languages: R (1)
Size: 3 files, 1 script
Software Heritage: not checked
Found in: “Data Availability Statement”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: emmeans (1 file), ggplot2 (1 file), lme4 (1 file), lmerTest (1 file), patchwork (1 file), psych (1 file), tidyverse (1 file)
Availability: 1 check, the latest on 1 October 2026: the link answers (HTTP 200)
  • 1 October 2026: the link answers (HTTP 200)
1 file
At the source: osf.io/tw5rp/

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;
  • no match between paragraphs and code yet;
  • neither the text of the paper nor the code itself.

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

Data

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

Data Availability Statement

Deidentified data and R codes are available on Open Science Framework (https://osf.io/tw5rp/).

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

Versions

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

Version 1, 1 October 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 4 authors, 5 keywords, 14 MeSH terms, 1 funder, 28 references.

Cite

This paper

Melani, I., Berg, M. K., Glazer, J., & Kitayama, S. (2026). Social Anxiety Predicts Enhanced Electrocortical Sensitivity to the Mental State Meanings Revealed by Gaze Patterns. Psychophysiology, 63(10), e70409. https://doi.org/10.1111/psyp.70409

BibTeX

@article{melani2026social,
author = {Melani, Irene and Berg, Martha K and Glazer, James and Kitayama, Shinobu},
title = {{Social Anxiety Predicts Enhanced Electrocortical Sensitivity to the Mental State Meanings Revealed by Gaze Patterns}},
journal = {Psychophysiology},
year = {2026},
month = oct,
volume = {63},
number = {10},
pages = {e70409},
publisher = {Wiley},
issn = {0048-5772},
doi = {10.1111/psyp.70409},
url = {https://doi.org/10.1111/psyp.70409},
pmid = {42806618},
pmcid = {PMC13620438}
}

RIS

TY - JOUR
AU - Melani, Irene
AU - Berg, Martha K
AU - Glazer, James
AU - Kitayama, Shinobu
TI - Social Anxiety Predicts Enhanced Electrocortical Sensitivity to the Mental State Meanings Revealed by Gaze Patterns
T2 - Psychophysiology
J2 - Psychophysiology
PY - 2026
DA - 2026/10/01
VL - 63
IS - 10
SP - e70409
SN - 0048-5772
PB - Wiley
DO - 10.1111/psyp.70409
UR - https://doi.org/10.1111/psyp.70409
LA - en
ER -

CSL-JSON

{
"id": "10.1111/psyp.70409",
"type": "article-journal",
"title": "Social Anxiety Predicts Enhanced Electrocortical Sensitivity to the Mental State Meanings Revealed by Gaze Patterns",
"container-title": "Psychophysiology",
"author": [
{
"family": "Melani",
"given": "Irene"
},
{
"family": "Berg",
"given": "Martha K"
},
{
"family": "Glazer",
"given": "James"
},
{
"family": "Kitayama",
"given": "Shinobu"
}
],
"container-title-short": "Psychophysiology",
"volume": "63",
"issue": "10",
"page": "e70409",
"DOI": "10.1111/psyp.70409",
"PMID": "42806618",
"PMCID": "PMC13620438",
"ISSN": "0048-5772",
"publisher": "Wiley",
"URL": "https://doi.org/10.1111/psyp.70409",
"language": "en",
"issued": {
"date-parts": [
[
2026,
10,
1
]
]
}
}

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.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: psych, emmeans, lmerTest, 4 other tools, EEG, 3 references
[2] 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: psych, emmeans, lmerTest, 4 other tools, EEG, 2 references
[3] 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: psych, emmeans, lmerTest, 4 other tools, EEG, 1 reference
[4] doi:10.1093/scan/nsaf083
Genes, culture, and neural sensitivity to norm violations: a DRD4 × culture interaction study.
Journal: Social cognitive and affective neuroscience
In common: EEG, 2 references, author Shinobu Kitayama
[5] doi:10.3389/fnhum.2026.1820376 [code]
The neural dynamics of political socio-pragmatic violations: an ERP study.
Journal: Frontiers in human neuroscience
In common: emmeans, lmerTest, lme4, 2 other tools, EEG, 3 references
[6] doi:10.1038/s41398-026-04122-2 [code]
Multi-session CBM-I for social anxiety: examining psychopathology, cognitive, neural, and psychophysiological effects in a randomized controlled trial.
Journal: Translational psychiatry
In common: psych, emmeans, ggplot2, 1 other tool, other condition, 3 references
[7] doi:10.1038/s41398-026-04479-4 [code]
Altered semantic prediction error processing with increasing schizotypal and autistic traits.
Journal: Translational psychiatry
In common: psych, emmeans, lmerTest, 3 other tools, EEG, 1 reference
[8] doi:10.1371/journal.pone.0313854 [code]
Hearing and cognitive decline in aging differentially impact neural tracking of context-supported versus random speech across linguistic timescales.
Journal: PloS one
In common: emmeans, lmerTest, lme4, 2 other tools, EEG, other condition, 2 references
[9] doi:10.1038/s44271-025-00345-z [code]
Accented speech modulates multiple event-related potential components across multiple levels of language processing.
Journal: Communications psychology
In common: psych, emmeans, lmerTest, 2 other tools, EEG, 1 reference
[10] doi:10.1162/imag_a_00131 [code]
Can prediction error explain predictability effects on the N1 during picture-word verification?
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: lme4, patchwork, ggplot2, 1 other tool, 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.

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.1111/psyp.70409.svg)](https://openscicode.org/badge/doi/10.1111/psyp.70409)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.1111/psyp.70409.svg
   :target: https://openscicode.org/badge/doi/10.1111/psyp.70409
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1111/psyp.70409"><img src="https://openscicode.org/badge/doi/10.1111/psyp.70409.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.