OSCR

Positive mood enhances accessibility of unrelated concepts in the first language but not in the foreign language.

Code ↔ Paper

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

The 7 matches
  1. [1] § 2. Materials and methods › 2.6. Data analysis › 2.6.2. Electrophysiological measures. ↔ Matlab scripts/C_MoBSeR_ERPs.m, lines 70–82 · score 0.75 · Artifact rejection, pop_jointprob, SDs, EEGLAB, Matlab, rejected
  2. [2] § 2. Materials and methods › 2.6. Data analysis › 2.6.1. Self-report measures: Mood ratings. ↔ R scripts/MoBSeR_word_pairs.R, lines 52–122 · score 0.69 · linear mixed, principal component, lme4, justified, PCA, fit
  3. [3] § 3. Results › 3.1. Self-report data: Mood ratings ↔ R scripts/MoBSeR_mood.R, lines 292–350 · score 0.64 · physiological arousal, Mood induction phase, arousal ratings, valence
  4. [4] § 3. Results › 3.2. Electrophysiological data: N400 (300–500 ms) › 3.2.1. Polish (L1) prime–target pairs. ↔ R scripts/MoBSeR_ERP_R1.R, lines 574–634 · score 0.60 · Mood induction progression, positive mood induction, negative mood induction, Word pair, slopes, N400 amplitudes
  5. [5] § 2. Materials and methods › 2.6. Data analysis › 2.6.2. Electrophysiological measures. ↔ R scripts/MoBSeR_ERP_R1.R, lines 378–425 · score 0.59 · films watched, Mood induction progression, Weakly related, block, predictor, Negative mood
  6. [6] § 2. Materials and methods › 2.6. Data analysis › 2.6.1. Self-report measures: Mood ratings. ↔ R scripts/MoBSeR_ERP.R, lines 198–251 · score 0.57 · principal component, lme4, variance, PCA, fit, intercepts
  7. [7] § 2. Materials and methods › 2.6. Data analysis › 2.6.2. Electrophysiological measures. ↔ R scripts/MoBSeR_ERP.R, lines 198–251 · score 0.51 · smpsize_lmm, medium, ICC, power, correlation, model

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 · 1,719 lines · 85 KB · no license · 2 matches

  1. #################################
  2. ########## MoBSeR: ERPs ########
  3. #################################
  4. # positive = "#EB0030",negative = "#404A80"
  5. # Polish = "#353269",English = "#120BDE"
  6. # "UN" = "#ffc000", "WR" = "#ff2f92", "CR" = "#404A80"
  7. #### libraries ####
  8. library(tidyverse)
  9. library(patchwork)
  10. library(ggplot2)
  11. library(lmerTest)
  12. library(ggpubr)
  13. library(lme4)
  14. library(emmeans)
  15. library(survival)
  16. library(car)
  17. library(stats)
  18. library(lattice)
  19. library(dplyr)
  20. library(reshape2)
  21. library(ez)
  22. library(multcomp)
  23. library(lsmeans)
  24. library(tidyr)
  25. library(apaTables)
  26. library(RColorBrewer)
  27. library(afex)
  28. library(purrr)
  29. library(ggridges)
  30. library(MuMIn)
  31. library(devtools)
  32. library(Hmisc)
  33. library(corrplot)
  34. library(PerformanceAnalytics)
  35. library(vcd)
  36. library(psych)
  37. library(irr)
  38. library(datarium)
  39. library(tables)
  40. library(ggrepel)
  41. library(sjPlot)
  42. library(sjmisc)
  43. library(sjlabelled)
  44. library(ggprism)
  45. library(sjstats)
  46. #### data preparation ####
  47. # import data
  48. dir()
  49. setwd(dirname(rstudioapi::getSourceEditorContext()$path))
  50. dir()
  51. df <- read.csv(file = "MoBSeR_ERP_R1.csv", fileEncoding = "UTF-8-BOM", sep = ',')
  52. summary(df)
  53. # str(df)
  54. # View(df)
  55. # set factors
  56. df$mood <- as.factor(df$mood)
  57. df$language <- as.factor(df$language)
  58. df$type <- as.factor(df$type)
  59. df$type <- factor(df$type, levels=c("UN", "WR", "CR"))
  60. df$mood <- factor(df$mood, levels=c("positive", "negative"))
  61. df$language <- factor(df$language, levels=c("Polish", "English"))
  62. df$chan <- factor(df$chan, levels=c("F1", "Fz", "F2", "FC1", "FCz", "FC2", "C1", "Cz", "C2", "CP1", "CPz", "CP2", "P1", "Pz", "P2"))
  63. df$chan1 <- with(df, ifelse(chan %in% c("FC1", "FCz", "FC2"), "FC",ifelse(chan %in% c("C1", "Cz", "C2"), "C",ifelse(chan %in% c("CP1", "CPz", "CP2"), "CP",ifelse(chan %in% c("P1", "Pz", "P2"), "P",NA)))))
  64. df$chan1 <- factor(df$chan1, levels=c("FC", "C", "CP","P"))
  65. df$amp <- as.numeric(df$amp)
  66. names(df)[names(df) == "trgtrig"] <- "word"
  67. names(df)[names(df) == "cndtrig"] <- "cnd"
  68. df <- na.omit(df)
  69. FC_C_CP_3 <- c("FC1","FCz","FC2","C1","Cz","C2","CP1","CPz","CP2")
  70. FC_C_CP_P_3 <- c("FC1","FCz","FC2","C1","Cz","C2","CP1","CPz","CP2","P1","Pz","P2")
  71. FCs <- c("FC1","FCz","FC2")
  72. Cs <- c("C1","Cz","C2")
  73. CPs <- c("CP1","CPz","CP2")
  74. Ps <- c("P1", "Pz", "P2")
  75. #### _________________ N400 mood x type x mood induction progression (film1) _________________ ####
  76. #### LMMs: N400 Polish [L1] ####
  77. # df4 --- N400 Polish
  78. df4 <- df %>% subset(chan %in% FC_C_CP_P_3 & time >= 300 & time <=500 & language %in% "Polish") %>% droplevels() %>%
  79. dplyr::group_by(mood, type, ptp, word, chan, film1) %>%
  80. dplyr::summarise(mean_amp = mean(amp))
  81. # contrasts
  82. df4$mood <- factor(df4$mood, levels=c("positive", "negative"))
  83. df4$type <- factor(df4$type, levels=c("UN", "WR", "CR"))
  84. contrasts(df4$mood) <- contr.sum(levels(df4$mood))
  85. df4$type <- relevel(df4$type, ref = "UN")
  86. # lmer
  87. N4_L1_film_model0 <- lmer(mean_amp ~ mood*type*film1 + (1|ptp) + (1|word), data=df4)
  88. N4_L1_film_model1 <- lmer(mean_amp ~ mood*type*film1 + (1+type+mood|ptp) + (1+type+mood|word), data=df4)
  89. N4_L1_film_model2 <- lmer(mean_amp ~ mood*type*film1 + (1+type|ptp) + (1+type|word), data=df4)
  90. summary(N4_L1_film_model2)
  91. anova(N4_L1_film_model2)
  92. anova(m0, N4_L1_film_model2)
  93. ' Estimate Std. Error df t value Pr(>|t|)
  94. (Intercept) -1.509e+00 2.898e-01 4.327e+01 -5.207 5.04e-06 ***
  95. mood1 -2.505e-01 9.690e-02 5.910e+03 -2.585 0.009763 **
  96. typeWR 2.884e-01 1.814e-01 2.801e+02 1.590 0.113052
  97. typeCR 4.259e-01 2.266e-01 1.353e+02 1.879 0.062370 .
  98. mood1:typeWR 3.212e-01 1.368e-01 1.055e+04 2.348 0.018886 *
  99. mood1:typeCR 3.758e-01 1.297e-01 1.411e+04 2.898 0.003760 **
  100. mood1:typeWR:film1 -7.683e-02 2.734e-02 8.222e+03 -2.810 0.004970 **
  101. mood1:typeCR:film1 -8.381e-02 2.668e-02 1.170e+04 -3.141 0.001688 ** '
  102. summary(rePCA(N4_L1_film_model2)) # singular fit? ==> relative Principal Component Analysis
  103. relgrad <- with(N4_L1_film_model1@optinfo$derivs,solve(Hessian,gradient)) # convergence problem?
  104. max(abs(relgrad)) # <.001? ==> the model is close to convergence
  105. plot_model(N4_L1_chan1_model2) # plot the model
  106. plot(N4_L1_chan1_model2) # reasonably equal amount of spread?
  107. hist(residuals(N4_L1_chan1_model2)) # more or less normally distributed?
  108. qqnorm(residuals(N4_L1_chan1_model2)) # reasonably aligned? '/'
  109. #tab_model(N4_L1_chan1_model2,transform = NULL, show.est=TRUE, show.ci=TRUE, show.se=TRUE, show.df=TRUE, show.stat=TRUE, wrap.labels=2, df.method = "satterthwaite", title = "N400 Polish (L1)", file = "N400_L1_model_specs.html")
  110. # POST-HOCS
  111. # mood
  112. Polish_film_fixed_mood <- emmeans(N4_L1_film_model2, pairwise ~ mood,adjust = "bonferroni")
  113. print(Polish_film_fixed_mood)
  114. plot(Polish_film_fixed_mood)
  115. ' mood emmean SE df asymp.LCL asymp.UCL
  116. positive -1.05 0.27 Inf -1.58 -0.524
  117. negative -1.20 0.27 Inf -1.73 -0.675'
  118. ' contrast estimate SE df z.ratio p.value
  119. positive - negative 0.15 0.0407 Inf 3.693 0.0002'
  120. # type
  121. Polish_film_fixed_type <- emmeans(N4_L1_film_model2, pairwise ~ type,adjust = "bonferroni")
  122. print(Polish_film_fixed_type)
  123. plot(Polish_film_fixed_type)
  124. ' type emmean SE df asymp.LCL asymp.UCL
  125. UN -1.679 0.274 Inf -2.22 -1.143
  126. WR -1.235 0.282 Inf -1.79 -0.683
  127. CR -0.469 0.300 Inf -1.06 0.118'
  128. 'contrast estimate SE df z.ratio p.value
  129. UN - WR -0.444 0.128 Inf -3.459 0.0016
  130. UN - CR -1.210 0.189 Inf -6.412 <.0001
  131. WR - CR -0.766 0.173 Inf -4.420 <.0001'
  132. # mood x type
  133. Polish_film_int_mood_type1 <- emmeans(N4_L1_film_model2, pairwise ~ mood|type, adjust = "bonferroni")
  134. print(Polish_film_int_mood_type1)
  135. plot(Polish_film_int_mood_type1)
  136. 'type = UN:
  137. mood emmean SE df asymp.LCL asymp.UCL
  138. positive -1.595 0.276 Inf -2.136 -1.0541
  139. negative -1.764 0.276 Inf -2.305 -1.2226
  140. type = WR:
  141. mood emmean SE df asymp.LCL asymp.UCL
  142. positive -1.176 0.284 Inf -1.733 -0.6198
  143. negative -1.295 0.284 Inf -1.851 -0.7379
  144. type = CR:
  145. mood emmean SE df asymp.LCL asymp.UCL
  146. positive -0.387 0.302 Inf -0.979 0.2045
  147. negative -0.551 0.302 Inf -1.143 0.0404'
  148. 'type = UN:
  149. contrast estimate SE df z.ratio p.value
  150. positive - negative 0.169 0.0704 Inf 2.395 0.0166
  151. type = WR:
  152. contrast estimate SE df z.ratio p.value
  153. positive - negative 0.118 0.0701 Inf 1.686 0.0918
  154. type = CR:
  155. contrast estimate SE df z.ratio p.value
  156. positive - negative 0.164 0.0711 Inf 2.313 0.0207'
  157. Polish_film_int_mood_type2 <- emmeans(N4_L1_film_model2, pairwise ~ type|mood, adjust = "bonferroni")
  158. print(Polish_film_int_mood_type2)
  159. plot(Polish_film_int_mood_type2)
  160. 'mood = positive:
  161. type emmean SE df asymp.LCL asymp.UCL
  162. UN -1.595 0.276 Inf -2.136 -1.0541
  163. WR -1.176 0.284 Inf -1.733 -0.6198
  164. CR -0.387 0.302 Inf -0.979 0.2045
  165. mood = negative:
  166. type emmean SE df asymp.LCL asymp.UCLx
  167. UN -1.764 0.276 Inf -2.305 -1.2226
  168. WR -1.295 0.284 Inf -1.851 -0.7379
  169. CR -0.551 0.302 Inf -1.143 0.0404'
  170. 'mood = positive:
  171. contrast estimate SE df z.ratio p.value
  172. UN - WR -0.419 0.138 Inf -3.044 0.0070
  173. UN - CR -1.208 0.195 Inf -6.191 <.0001
  174. WR - CR -0.789 0.180 Inf -4.378 <.0001
  175. mood = negative:
  176. contrast estimate SE df z.ratio p.value
  177. UN - WR -0.469 0.138 Inf -3.407 0.0020
  178. UN - CR -1.212 0.195 Inf -6.205 <.0001
  179. WR - CR -0.743 0.181 Inf -4.117 0.0001'
  180. # mood x type x film1
  181. emm_trends <- emtrends(N4_L1_film_model2,specs = ~ mood * type,var = "film1")
  182. summary(emm_trends)
  183. 'mood type film1.trend SE df asymp.LCL asymp.UCL
  184. positive UN 0.036478 0.0279 Inf -0.0182 0.0912
  185. negative UN -0.112016 0.0276 Inf -0.1661 -0.0579
  186. positive WR -0.005858 0.0281 Inf -0.0610 0.0492
  187. negative WR -0.000689 0.0263 Inf -0.0522 0.0508
  188. positive CR 0.126571 0.0265 Inf 0.0746 0.1785
  189. negative CR 0.145692 0.0270 Inf 0.0928 0.1986'
  190. contrast(emm_trends,method = "pairwise",adjust = "holm", by ="mood")
  191. 'mood = positive:
  192. contrast estimate SE df z.ratio p.value
  193. UN - WR 0.0423 0.0396 Inf 1.070 0.2847
  194. UN - CR -0.0901 0.0385 Inf -2.339 0.0387
  195. WR - CR -0.1324 0.0387 Inf -3.426 0.0018
  196. mood = negative:
  197. contrast estimate SE df z.ratio p.value
  198. UN - WR -0.1113 0.0381 Inf -2.924 0.0035
  199. UN - CR -0.2577 0.0387 Inf -6.654 <.0001
  200. WR - CR -0.1464 0.0376 Inf -3.888 0.0002'
  201. contrast(emm_trends,method = "pairwise",adjust = "holm", by ="type")
  202. 'type = UN:
  203. contrast estimate SE df z.ratio p.value
  204. positive - negative 0.14849 0.0382 Inf 3.884 0.0001
  205. type = WR:
  206. contrast estimate SE df z.ratio p.value
  207. positive - negative -0.00517 0.0393 Inf -0.132 0.8953
  208. type = CR:
  209. contrast estimate SE df z.ratio p.value
  210. positive - negative -0.01912 0.0371 Inf -0.516 0.6060'
  211. # observed power
  212. vc <- as.data.frame(VarCorr(N4_L1_film_model2))
  213. sigma_ptp <- vc$vcov[vc$grp == "ptp" & vc$var1 == "(Intercept)"][1] # Participant intercept variance (scalar)
  214. sigma_resid <- vc$vcov[vc$grp == "Residual"][1] # Residual variance (scalar)
  215. print(icc_ptp <- sigma_ptp / (sigma_ptp + sigma_resid))
  216. smpsize_lmm(
  217. eff.size = 0.25, # medium effect size
  218. df.n = 2, # (3-1)*(2-1) -- 3x2 design [for a two-way interaction]
  219. power = .96, # observed power for 40 items per condition
  220. sig.level = 0.05,
  221. k = 32, # participants
  222. n = 240, # trials per participant (40*6)
  223. icc = 0.05837853)
  224. #### Polish [L1] - PLOTS ####
  225. #### Polish -- N400: type x mood [GAV] ####
  226. plotstats2c <- df %>% subset(chan %in% FC_C_CP_P_3 & time >= -200 & time <= 800 & language %in% "Polish") %>% droplevels() %>%
  227. dplyr::group_by(time, type, mood) %>%
  228. dplyr::summarise(mean_amp = mean(amp),CIlower = Rmisc::CI(amp, ci = 0.95)["lower"],CIupper = Rmisc::CI(amp, ci = 0.95)["upper"])
  229. plotstats2c <- plotstats2c %>% group_by(type, mood) %>% mutate(baseline = mean_amp[time == 0],mean_amp = mean_amp - baseline, CIlower = CIlower - baseline,CIupper = CIupper - baseline) %>% dplyr::select(-baseline)
  230. plotstats2c <- plotstats2c %>% arrange(time) %>% group_by(type, mood) %>% mutate(mean_amp = zoo::rollmean(mean_amp, k = 10, fill = NA, align = "center"), CIlower = zoo::rollmean(CIlower, k = 10, fill = NA, align = "center"), CIupper = zoo::rollmean(CIupper, k = 17, fill = NA, align = "center"))
  231. # by type
  232. ggplot(plotstats2c, aes(time, mean_amp, color = type, group = type)) +
  233. geom_ribbon(aes(ymin = CIlower, ymax = CIupper, fill = type),
  234. alpha = 0.2, linetype = 0) +
  235. facet_wrap(.~mood, ncol =2, labeller = as_labeller(c("positive" = "Positive mood", "negative" = "Negative mood"))) +
  236. geom_line(size = 0.75) +
  237. guides(fill = "none") +
  238. labs(x = "Time (ms)", y = expression(paste("Amplitude (", mu, "V)")), colour = "") +
  239. scale_shape_prism() +
  240. #theme_prism() +
  241. scale_y_reverse(breaks = c(1,0, -1, -2, -3), limits = c(1,-3), guide = "prism_offset") +
  242. scale_x_continuous(breaks = c(-100, 0, 100, 300, 500, 700), guide = "prism_offset") +
  243. theme_classic2()+
  244. geom_vline(xintercept = 0, linetype = "dotted", alpha = 0.5) +
  245. geom_hline(yintercept = 0, linetype = "dotted", alpha = 0.5) +
  246. geom_vline(xintercept = 300, linetype = "solid", alpha = 1, color = "black") +
  247. geom_vline(xintercept = 500, linetype = "solid", alpha = 1, color = "black") +
  248. theme(text = element_text(size = 20, color = "black", family = "Helvetica"),
  249. axis.line.x = element_line(colour = "black", size = .5),
  250. axis.line.y = element_line(colour = "black", size = .5),
  251. axis.text = element_text(size = 18, color = "black", family = "Helvetica"),
  252. strip.text.x.top = element_text(size = 20, color = "black", family = "Helvetica"),
  253. plot.title = element_text(hjust = 0, family = "Helvetica"),
  254. legend.position = "bottom",
  255. legend.title = element_text(size = 20),
  256. legend.text = element_text(size = 20)) +
  257. scale_fill_manual(values = c("#ffc000","#ff2f92","#404A80")) +
  258. scale_color_manual(name = "", values = c("#ffc000","#ff2f92","#404A80"), labels = c("Unrelated (UR) pairs", "Weakly related (WR) pairs", "Closely related (CR) pairs"))+
  259. guides(colour = guide_legend(override.aes = list(linetype = 1, shape = 16, size = 5)))
  260. ggsave(filename ="L1_mood_type_R1.png", plot = last_plot(), width = 30,height = 12, units = "cm", bg = "white", path="/Users/m/Desktop/MoBSeR/R /plots")
  261. # by mood
  262. ggplot(plotstats2c, aes(time, mean_amp, color = mood, group = mood)) +
  263. geom_ribbon(aes(ymin = CIlower, ymax = CIupper, fill = mood),
  264. alpha = 0.2, linetype = 0) +
  265. facet_wrap(.~type, ncol =3, labeller = as_labeller(c("UN" = "Unrelated pairs", "WR" = "Weakly related pairs", "CR" = "Closely related pairs"))) +
  266. geom_line(size = 0.75) +
  267. guides(fill = "none") +
  268. labs(x = "Time (ms)", y = expression(paste("Amplitude (", mu, "V)")), colour = "") +
  269. scale_shape_prism() +
  270. #theme_prism() +
  271. scale_y_reverse(breaks = c(0, -1, -2, -3), limits = c(0.75,-2.75), guide = "prism_offset") +
  272. scale_x_continuous(breaks = c(-100, 0, 100, 300, 500, 700), guide = "prism_offset") +
  273. theme_classic2()+
  274. geom_vline(xintercept = 0, linetype = "dotted", alpha = 0.5) +
  275. geom_hline(yintercept = 0, linetype = "dotted", alpha = 0.5) +
  276. geom_vline(xintercept = 300, linetype = "solid", alpha = 1, color = "black") +
  277. geom_vline(xintercept = 500, linetype = "solid", alpha = 1, color = "black") +
  278. theme(text = element_text(size = 20, color = "black", family = "Helvetica"),
  279. axis.line.x = element_line(colour = "black", size = .5),
  280. axis.line.y = element_line(colour = "black", size = .5),
  281. axis.text = element_text(size = 18, color = "black", family = "Helvetica"),
  282. strip.text.x.top = element_text(size = 20, color = "black", family = "Helvetica"),
  283. plot.title = element_text(hjust = 0, family = "Helvetica"),
  284. legend.position = "bottom",
  285. legend.title = element_text(size = 20),
  286. legend.text = element_text(size = 20)) +
  287. scale_fill_manual(values = c("red","blue")) +
  288. scale_color_manual(name = "", values = c("red","blue"), labels = c("Positive mood", "Negative mood"))+
  289. guides(colour = guide_legend(override.aes = list(linetype = 1, shape = 16, size = 5)))
  290. #### Polish -- N400: type x mood [distribution] ####
  291. plotstats2c <- df %>% subset(chan %in% FC_C_CP_P_3 & time >= 300 & time <= 500 & language %in% "Polish") %>% droplevels() %>%
  292. dplyr::group_by(type, mood, word) %>%
  293. dplyr::summarise(mean_amp = mean(amp),CIlower = Rmisc::CI(amp, ci = 0.95)["lower"],CIupper = Rmisc::CI(amp, ci = 0.95)["upper"])
  294. ggplot(plotstats2c, aes(x = type, y = mean_amp, colour = type, fill = type)) +
  295. facet_wrap(.~mood, labeller = as_labeller(c("positive" = "Positive mood", "negative" = "Negative mood", "Polish" = "Polish (L1)", "English" = "English (L2)"))) +
  296. # ggdist::stat_halfeye(aes(colour = type), width = 0.8, .width = 0, alpha = 0.75, justification = -0.3, point_colour = NA) +
  297. geom_point(aes(colour = type), size = 1.0, alpha = 0.2, position = position_jitter(seed = 1, width = 0.1)) +
  298. geom_boxplot(aes(colour = type), width = .25, alpha = 0.25, outlier.shape = NA) +
  299. scale_shape_prism() +
  300. #theme_prism() +
  301. scale_y_reverse(limits = c(3,-6), breaks = c(-6,-3, 0,3), guide = "prism_offset") +
  302. #coord_cartesian(ylim = c(-3, 0.5), clip = "off") +
  303. scale_x_discrete(labels = c("UN" = "Unrelated", "WR" = "Weakly related", "CR" = "Closely related"), guide = "prism_bracket") +
  304. labs(y = expression(paste("Amplitude (", mu, "V)")), x = "Word pair") +
  305. scale_fill_manual(values = c("#ffc000","#ff2f92","#404A80")) +
  306. scale_colour_manual(values = c("#ffc000","#ff2f92","#404A80")) +
  307. theme_classic2() +
  308. theme(legend.position="none") +
  309. theme(panel.background = element_rect(fill = "white"),
  310. strip.background = element_rect(fill = "white",color="black",size=1),
  311. legend.key = element_rect(fill = "white"),
  312. axis.line.x = element_line(colour = "black", size = .5),
  313. axis.line.y = element_line(colour = "black", size = .5),
  314. axis.title = element_text(size = 15, color= "black"),
  315. strip.text = element_text(size = 15, color= "black"),
  316. legend.text = element_text(size = 15, color= "black"),
  317. legend.title = element_text(size = 15, color= "black"),
  318. strip.text.x.top = element_text(size = 15, color= "black"),
  319. axis.text = element_text(size = 15, color= "black"))
  320. ggsave(filename ="L1_distribution.png", plot = last_plot(), width = 25,height = 8, units = "cm", bg = "white", path="/Users/m/Desktop/MoBSeR/R /plots")
  321. #### Polish -- N400: type x mood x mood induction progression [slopes] ####
  322. block_points1 <- quantile(df4$film1, probs = c(.05, .5, .95))
  323. emm_plot1 <- emmeans(N4_L1_film_model2,~ mood * type | film1,at = list(film1 = block_points1))
  324. plot_df1 <- as.data.frame(emm_plot1)
  325. plot_df1$type <- factor(plot_df1$type, levels=c("CR", "WR", "UN"))
  326. # by mood
  327. ggplot(plot_df1,aes(x = film1, y = emmean, color = type)) +
  328. geom_line(aes(group = type), linewidth = 1) +
  329. geom_point(size = 3) +
  330. geom_errorbar(aes(ymin = asymp.LCL, ymax = asymp.UCL),width = 0.1) +
  331. facet_wrap(~ mood,ncol = 2,labeller = as_labeller(c("positive" = "Positive mood","negative" = "Negative mood"))) +
  332. scale_color_manual(name = "",values = c("#ffc000", "#ff2f92", "#404A80"),labels = c("Unrelated (UR) pairs","Weakly related (WR) pairs","Closely related (CR) pairs")) +
  333. scale_x_continuous(name = "Block progression",breaks = c(1,2,3,4,5,6,7, 8),guide = "prism_offset") +
  334. scale_y_reverse(name = "Predicted mean N400 amplitude (µV)",breaks = c(1,0, -1, -2, -3),limits = c(1, -3),guide = "prism_offset") +
  335. theme_classic2() +
  336. scale_shape_prism() +
  337. theme(text = element_text(size = 20, family = "Helvetica", color = "black"),
  338. axis.text = element_text(size = 18),
  339. axis.line = element_line(size = 0.5),
  340. strip.text = element_text(size = 20),
  341. strip.background = element_blank(),
  342. legend.position = "bottom",
  343. legend.text = element_text(size = 20))
  344. # by type
  345. ggplot(plot_df1,aes(x = film1, y = emmean, color = mood)) +
  346. geom_line(aes(group = mood), linewidth = 1) +
  347. geom_point(size = 2) +
  348. geom_errorbar(aes(ymin = asymp.LCL, ymax = asymp.UCL),width = 0.1) +
  349. facet_wrap(.~type, ncol =3, labeller = as_labeller(c("UN" = "Unrelated \npairs", "WR" = "Weakly \nrelated pairs", "CR" = "Closely \nrelated pairs"))) +
  350. scale_color_manual(name = "",values = c("firebrick2","darkblue"),labels = c("Positive mood","Negative mood")) +
  351. scale_x_continuous(name = "Number of films watched",breaks = c(1,2,3,4,5,6,7, 8),guide = "prism_offset") +
  352. scale_y_reverse(name = "Predicted mean N400 amplitude (µV)",breaks = c(1,0, -1, -2, -3),limits = c(1, -3),guide = "prism_offset") +
  353. scale_shape_prism() +
  354. theme_classic2() +
  355. theme(text = element_text(size = 20, family = "Helvetica", color = "black"),
  356. axis.text = element_text(size = 18),
  357. axis.line = element_line(size = 0.5),
  358. strip.text = element_text(size = 20),
  359. strip.background = element_blank(),
  360. legend.position = "bottom",
  361. legend.text = element_text(size = 20))
  362. ggsave(filename ="L1_predicted_films.png", plot = last_plot(), width = 15,height = 14, units = "cm", bg = "white", path="/Users/m/Desktop/MoBSeR/R /plots")
  363. #### LMMs: N400 English [L2] ####
  364. # df5 --- N400 English
  365. df5 <- df %>% subset(chan %in% FC_C_CP_P_3 & time >= 300 & time <=500 & language %in% "English") %>% droplevels() %>%
  366. dplyr::group_by(mood, type, ptp, word, chan, film1) %>%
  367. dplyr::summarise(mean_amp = mean(amp))
  368. # contrasts
  369. df5$mood <- factor(df5$mood, levels=c("positive", "negative"))
  370. df5$type <- factor(df5$type, levels=c("UN", "WR", "CR"))
  371. contrasts(df5$mood) <- contr.sum(levels(df5$mood))
  372. df5$type <- relevel(df5$type, ref = "UN")
  373. # lmer
  374. N4_L2_film_model0 <- lmer(mean_amp ~ mood*type*film1 + (1|ptp) + (1|word), data=df5)
  375. N4_L2_film_model1 <- lmer(mean_amp ~ mood*type*film1 + (1+type+mood|ptp) + (1+type+mood|word), data=df5)
  376. N4_L2_film_model2 <- lmer(mean_amp ~ mood*type*film1 + (1+mood|ptp) + (1|word), data=df5)
  377. summary(N4_L2_film_model2)
  378. anova(N4_L2_film_model2)
  379. anova(m0, N4_L2_film_model2)
  380. ' Estimate Std. Error df t value Pr(>|t|)
  381. (Intercept) -1.372e+00 2.717e-01 4.011e+01 -5.050 1.00e-05 ***
  382. mood1 9.008e-02 9.191e-02 5.040e+02 0.980 0.327
  383. typeWR -5.580e-03 1.140e-01 6.683e+04 -0.049 0.961
  384. typeCR 7.777e-01 1.164e-01 6.483e+04 6.679 2.42e-11 ***
  385. mood1:typeWR -4.807e-02 1.135e-01 6.941e+04 -0.424 0.672
  386. mood1:typeCR 1.852e-01 1.150e-01 7.218e+04 1.611 0.107
  387. mood1:typeWR:film1 -4.171e-03 2.298e-02 6.224e+04 -0.181 0.856
  388. mood1:typeCR:film1 -1.565e-02 2.278e-02 6.709e+04 -0.687 0.492 '
  389. summary(rePCA(N4_L2_film_model2)) # singular fit? ==> relative Principal Component Analysis
  390. relgrad <- with(N4_L2_film_model2@optinfo$derivs,solve(Hessian,gradient)) # convergence problem?
  391. max(abs(relgrad)) # <.001? ==> the model is close to convergence
  392. plot_model(N4_L2_film_model2) # plot the model
  393. plot(N4_L2_film_model2) # reasonably equal amount of spread?
  394. hist(residuals(N4_L2_film_model2)) # more or less normally distributed?
  395. qqnorm(residuals(N4_L2_film_model2)) # reasonably aligned? '/'
  396. #tab_model(N4_L2_film_model2,transform = NULL, show.est=TRUE, show.ci=TRUE, show.se=TRUE, show.df=TRUE, show.stat=TRUE, wrap.labels=2, df.method = "satterthwaite", title = "N400 Polish (L1)", file = "N400_L1_model_specs.html")
  397. # POST-HOCS
  398. # type
  399. English_film_fixed_type <- emmeans(N4_L2_film_model2, pairwise ~ type,adjust = "bonferroni")
  400. print(English_film_fixed_type)
  401. plot(English_film_fixed_type)
  402. ' type emmean SE df asymp.LCL asymp.UCL
  403. UN -1.72 0.261 Inf -2.234 -1.211
  404. WR -1.13 0.261 Inf -1.639 -0.616
  405. CR -0.43 0.261 Inf -0.941 0.082'
  406. ' contrast estimate SE df z.ratio p.value
  407. UN - WR -0.595 0.0494 Inf -12.038 <.0001
  408. UN - CR -1.293 0.0493 Inf -26.222 <.0001
  409. WR - CR -0.698 0.0493 Inf -14.158 <.0001'
  410. # observed power
  411. vc <- as.data.frame(VarCorr(N4_L2_film_model2))
  412. sigma_ptp <- vc$vcov[vc$grp == "ptp" & vc$var1 == "(Intercept)"][1] # Participant intercept variance (scalar)
  413. sigma_resid <- vc$vcov[vc$grp == "Residual"][1] # Residual variance (scalar)
  414. print(icc_ptp <- sigma_ptp / (sigma_ptp + sigma_resid))
  415. smpsize_lmm(
  416. eff.size = 0.25, # medium effect size
  417. df.n = 2, # (3-1)*(2-1) -- 3x2 design [for a two-way interaction]
  418. power = .97, # observed power for 40 items per condition
  419. sig.level = 0.05,
  420. k = 32, # participants
  421. n = 240, # trials per participant (40*6)
  422. icc = 0.05552603)
  423. #### English [L2] - PLOTS ####
  424. #### English -- N400: type x mood [GAV] ####
  425. plotstats2f <- df %>% subset(chan %in% FC_C_CP_P_3 & time >= -200 & time <= 800 & language %in% "English") %>% droplevels() %>%
  426. dplyr::group_by(time, type, mood) %>%
  427. dplyr::summarise(mean_amp = mean(amp),CIlower = Rmisc::CI(amp, ci = 0.95)["lower"],CIupper = Rmisc::CI(amp, ci = 0.95)["upper"])
  428. plotstats2f <- plotstats2f %>% group_by(type, mood) %>% mutate(baseline = mean_amp[time == 0],mean_amp = mean_amp - baseline, CIlower = CIlower - baseline,CIupper = CIupper - baseline) %>% dplyr::select(-baseline)
  429. plotstats2f <- plotstats2f %>% arrange(time) %>% group_by(type, mood) %>% mutate(mean_amp = zoo::rollmean(mean_amp, k = 10, fill = NA, align = "center"), CIlower = zoo::rollmean(CIlower, k = 10, fill = NA, align = "center"), CIupper = zoo::rollmean(CIupper, k = 17, fill = NA, align = "center"))
  430. # by type
  431. ggplot(plotstats2f, aes(time, mean_amp, color = type, group = type)) +
  432. geom_ribbon(aes(ymin = CIlower, ymax = CIupper, fill = type),
  433. alpha = 0.2, linetype = 0) +
  434. facet_wrap(.~mood, ncol =2, labeller = as_labeller(c("positive" = "Positive mood", "negative" = "Negative mood"))) +
  435. geom_line(size = 0.75) +
  436. guides(fill = "none") +
  437. labs(x = "Time (ms)", y = expression(paste("Amplitude (", mu, "V)")), colour = "") +
  438. scale_shape_prism() +
  439. #theme_prism() +
  440. scale_y_reverse(breaks = c(1,0, -1, -2, -3), limits = c(1,-3), guide = "prism_offset") +
  441. scale_x_continuous(breaks = c(-100, 0, 100, 300, 500, 700), guide = "prism_offset") +
  442. theme_classic2()+
  443. geom_vline(xintercept = 0, linetype = "dotted", alpha = 0.5) +
  444. geom_hline(yintercept = 0, linetype = "dotted", alpha = 0.5) +
  445. geom_vline(xintercept = 300, linetype = "solid", alpha = 1, color = "black") +
  446. geom_vline(xintercept = 500, linetype = "solid", alpha = 1, color = "black") +
  447. theme(text = element_text(size = 20, color = "black", family = "Helvetica"),
  448. axis.line.x = element_line(colour = "black", size = .5),
  449. axis.line.y = element_line(colour = "black", size = .5),
  450. axis.text = element_text(size = 18, color = "black", family = "Helvetica"),
  451. strip.text.x.top = element_text(size = 20, color = "black", family = "Helvetica"),
  452. plot.title = element_text(hjust = 0, family = "Helvetica"),
  453. legend.position = "bottom",
  454. legend.title = element_text(size = 20),
  455. legend.text = element_text(size = 20)) +
  456. scale_fill_manual(values = c("#ffc000","#ff2f92","#404A80")) +
  457. scale_color_manual(name = "", values = c("#ffc000","#ff2f92","#404A80"), labels = c("Unrelated (UR) pairs", "Weakly related (WR) pairs", "Closely related (CR) pairs"))+
  458. guides(colour = guide_legend(override.aes = list(linetype = 1, shape = 16, size = 5)))
  459. ggsave(filename ="L2_mood_type_R1.png", plot = last_plot(), width = 30,height = 12, units = "cm", bg = "white", path="/Users/m/Desktop/MoBSeR/R /plots")
  460. # by mood
  461. ggplot(plotstats2f, aes(time, mean_amp, color = mood, group = mood)) +
  462. geom_ribbon(aes(ymin = CIlower, ymax = CIupper, fill = mood),
  463. alpha = 0.2, linetype = 0) +
  464. facet_wrap(.~type, ncol =3, labeller = as_labeller(c("UN" = "Unrelated pairs", "WR" = "Weakly related pairs", "CR" = "Closely related pairs"))) +
  465. geom_line(size = 0.75) +
  466. guides(fill = "none") +
  467. labs(x = "Time (ms)", y = expression(paste("Amplitude (", mu, "V)")), colour = "") +
  468. scale_shape_prism() +
  469. #theme_prism() +
  470. scale_y_reverse(breaks = c(0, -1, -2, -3), limits = c(0.75,-2.75), guide = "prism_offset") +
  471. scale_x_continuous(breaks = c(-100, 0, 100, 300, 500, 700), guide = "prism_offset") +
  472. theme_classic2()+
  473. geom_vline(xintercept = 0, linetype = "dotted", alpha = 0.5) +
  474. geom_hline(yintercept = 0, linetype = "dotted", alpha = 0.5) +
  475. geom_vline(xintercept = 300, linetype = "solid", alpha = 1, color = "black") +
  476. geom_vline(xintercept = 500, linetype = "solid", alpha = 1, color = "black") +
  477. theme(text = element_text(size = 20, color = "black", family = "Helvetica"),
  478. axis.line.x = element_line(colour = "black", size = .5),
  479. axis.line.y = element_line(colour = "black", size = .5),
  480. axis.text = element_text(size = 18, color = "black", family = "Helvetica"),
  481. strip.text.x.top = element_text(size = 20, color = "black", family = "Helvetica"),
  482. plot.title = element_text(hjust = 0, family = "Helvetica"),
  483. legend.position = "bottom",
  484. legend.title = element_text(size = 20),
  485. legend.text = element_text(size = 20)) +
  486. scale_fill_manual(values = c("red","blue")) +
  487. scale_color_manual(name = "", values = c("red","blue"), labels = c("Positive mood", "Negative mood"))+
  488. guides(colour = guide_legend(override.aes = list(linetype = 1, shape = 16, size = 5)))
  489. #### English -- N400: type x mood [distribution] ####
  490. plotstats2f <- df %>% subset(chan %in% FC_C_CP_3 & time >= 300 & time <= 500 & language %in% "English") %>% droplevels() %>%
  491. dplyr::group_by(type, mood, word) %>%
  492. dplyr::summarise(mean_amp = mean(amp),CIlower = Rmisc::CI(amp, ci = 0.95)["lower"],CIupper = Rmisc::CI(amp, ci = 0.95)["upper"])
  493. ggplot(plotstats2f, aes(x = type, y = mean_amp, colour = type, fill = type)) +
  494. facet_wrap(.~mood, labeller = as_labeller(c("positive" = "Positive mood", "negative" = "Negative mood", "Polish" = "Polish (L1)", "English" = "English (L2)"))) +
  495. # ggdist::stat_halfeye(aes(colour = type), width = 0.8, .width = 0, alpha = 0.75, justification = -0.3, point_colour = NA) +
  496. geom_point(aes(colour = type), size = 1.0, alpha = 0.2, position = position_jitter(seed = 1, width = 0.1)) +
  497. geom_boxplot(aes(colour = type), width = .25, alpha = 0.25, outlier.shape = NA) +
  498. scale_shape_prism() +
  499. #theme_prism() +
  500. scale_y_reverse(limits = c(3,-6), breaks = c(-6,-3, 0,3), guide = "prism_offset") +
  501. #coord_cartesian(ylim = c(-3, 0.5), clip = "off") +
  502. scale_x_discrete(labels = c("UN" = "Unrelated", "WR" = "Weakly related", "CR" = "Closely related"), guide = "prism_bracket") +
  503. labs(y = expression(paste("Amplitude (", mu, "V)")), x = "Word pair") +
  504. scale_fill_manual(values = c("#ffc000","#ff2f92","#404A80")) +
  505. scale_colour_manual(values = c("#ffc000","#ff2f92","#404A80")) +
  506. theme_classic2() +
  507. theme(legend.position="none") +
  508. theme(panel.background = element_rect(fill = "white"),
  509. strip.background = element_rect(fill = "white",color="black",size=1),
  510. legend.key = element_rect(fill = "white"),
  511. axis.line.x = element_line(colour = "black", size = .5),
  512. axis.line.y = element_line(colour = "black", size = .5),
  513. axis.title = element_text(size = 15, color= "black"),
  514. strip.text = element_text(size = 15, color= "black"),
  515. legend.text = element_text(size = 15, color= "black"),
  516. legend.title = element_text(size = 15, color= "black"),
  517. strip.text.x.top = element_text(size = 15, color= "black"),
  518. axis.text = element_text(size = 15, color= "black"))
  519. ggsave(filename ="L2_distribution.png", plot = last_plot(), width = 25,height = 8, units = "cm", bg = "white", path="/Users/m/Desktop/MoBSeR/R /plots")
  520. #### English -- N400: type x mood x mood induction progression [slopes] ####
  521. block_points2 <- quantile(df4$film1, probs = c(.05, .5, .95))
  522. emm_plot2 <- emmeans(N4_L2_film_model2,~ mood * type | film1,at = list(film1 = block_points2))
  523. emm_plot2 <- as.data.frame(emm_plot2)
  524. emm_plot2$type <- factor(emm_plot2$type, levels=c("CR", "WR", "UN"))
  525. ggplot(emm_plot2,aes(x = film1, y = emmean, color = type)) +
  526. geom_line(aes(group = type), linewidth = 1) +
  527. geom_point(size = 2) +
  528. geom_errorbar(aes(ymin = asymp.LCL, ymax = asymp.UCL),width = 0.1) +
  529. facet_wrap(~ mood,ncol = 2,labeller = as_labeller(c("positive" = "Positive mood","negative" = "Negative mood"))) +
  530. scale_color_manual(name = "",values = c("#ffc000", "#ff2f92", "#404A80"),labels = c("Unrelated (UR) pairs","Weakly related (WR) pairs","Closely related (CR) pairs")) +
  531. scale_x_continuous(name = "Block progression",breaks = c(1,2,3,4,5,6,7,8),guide = "prism_offset") +
  532. scale_y_reverse(name = "Predicted mean N400 amplitude (µV)",breaks = c(1,0, -1, -2, -3),limits = c(1, -3),guide = "prism_offset") +
  533. theme_classic2() +
  534. scale_shape_prism() +
  535. theme(text = element_text(size = 20, family = "Helvetica", color = "black"),
  536. axis.text = element_text(size = 18),
  537. axis.line = element_line(size = 0.5),
  538. strip.text = element_text(size = 20),
  539. strip.background = element_blank(),
  540. legend.position = "bottom",
  541. legend.text = element_text(size = 20))
  542. # by type
  543. ggplot(emm_plot2,aes(x = film1, y = emmean, color = mood)) +
  544. geom_line(aes(group = mood), linewidth = 1) +
  545. geom_point(size = 2) +
  546. geom_errorbar(aes(ymin = asymp.LCL, ymax = asymp.UCL),width = 0.1) +
  547. facet_wrap(.~type, ncol =3, labeller = as_labeller(c("UN" = "Unrelated \npairs", "WR" = "Weakly \nrelated pairs", "CR" = "Closely \nrelated pairs"))) +
  548. scale_color_manual(name = "",values = c("firebrick2","darkblue"),labels = c("Positive mood","Negative mood")) +
  549. scale_x_continuous(name = "Number of films watched",breaks = c(1,2,3,4,5,6,7, 8),guide = "prism_offset") +
  550. scale_y_reverse(name = "Predicted mean N400 amplitude (µV)",breaks = c(1,0, -1, -2, -3),limits = c(1, -3),guide = "prism_offset") +
  551. theme_classic2() +
  552. scale_shape_prism() +
  553. theme(text = element_text(size = 20, family = "Helvetica", color = "black"),
  554. axis.text = element_text(size = 18),
  555. axis.line = element_line(size = 0.5),
  556. strip.text = element_text(size = 20),
  557. strip.background = element_blank(),
  558. legend.position = "bottom",
  559. legend.text = element_text(size = 20))
  560. ggsave(filename ="L2_predicted_films.png", plot = last_plot(), width = 15,height = 14, units = "cm", bg = "white", path="/Users/m/Desktop/MoBSeR/R /plots")
  561. #### _________________ FCs+Cs+CPs+Ps _________________ ####
  562. #### LMMs: N400 Polish [L1] ####
  563. # df2 --- N400 Polish
  564. df2 <- df %>% subset(chan %in% FC_C_CP_P_3 & time >= 300 & time <=500 & language %in% "Polish") %>% droplevels() %>%
  565. dplyr::group_by(mood, type, ptp, word,chan1) %>%
  566. dplyr::summarise(mean_amp = mean(amp))
  567. # contrasts
  568. df2$mood <- factor(df2$mood, levels=c("positive", "negative"))
  569. df2$type <- factor(df2$type, levels=c("UN", "WR", "CR"))
  570. contrasts(df2$mood) <- contr.sum(levels(df2$mood))
  571. df2$type <- relevel(df2$type, ref = "UN")
  572. contrasts(df2$chan1) <- contr.sum(levels(df2$chan1))
  573. df2$chan1 <- relevel(df2$chan1, ref = "FC")
  574. summary(df2)
  575. # lmer
  576. N4_L1_chan1_model0 <- lmer(mean_amp ~ mood*type*chan1 + (1|ptp) + (1|word), data=df2)
  577. N4_L1_chan1_model1 <- lmer(mean_amp ~ mood*type*chan1 + (1+type+mood|ptp) + (1+type+mood|word), data=df2)
  578. N4_L1_chan1_model2 <- lmer(mean_amp ~ mood*type*chan1 + (1+type|ptp) + (1|word), data=df2)
  579. summary(N4_L1_chan1_model2)
  580. anova(N4_L1_chan1_model2)
  581. anova(N4_L1_chan1_model0, N4_L1_chan1_model2)
  582. ' Estimate Std. Error df t value Pr(>|t|)
  583. (Intercept) -2.496e+00 3.490e-01 7.934e+01 -7.151 3.77e-10 ***
  584. mood1 2.019e-01 9.365e-02 2.932e+04 2.156 0.03107 *
  585. typeWR 4.015e-01 1.490e-01 1.834e+02 2.695 0.00769 **
  586. typeCR 1.118e+00 1.888e-01 7.819e+01 5.920 8.12e-08 ***
  587. chan1C -2.048e-01 3.587e-01 1.126e+02 -0.571 0.56916
  588. chan1CP 8.099e-01 3.587e-01 1.126e+02 2.258 0.02587 *
  589. chan1P 2.582e+00 3.587e-01 1.126e+02 7.200 7.22e-11 ***
  590. mood1:typeWR -2.484e-01 1.322e-01 2.932e+04 -1.879 0.06027 .
  591. mood1:typeCR -1.087e-01 1.326e-01 2.933e+04 -0.819 0.41267
  592. mood1:chan1C -6.886e-02 1.324e-01 2.930e+04 -0.520 0.60303
  593. mood1:chan1CP -1.492e-01 1.324e-01 2.930e+04 -1.127 0.25968
  594. mood1:chan1P -1.581e-01 1.324e-01 2.930e+04 -1.194 0.23236
  595. typeWR:chan1C 8.896e-02 1.869e-01 2.930e+04 0.476 0.63414
  596. typeCR:chan1C 4.866e-02 1.875e-01 2.930e+04 0.259 0.79527
  597. typeWR:chan1CP -7.093e-02 1.869e-01 2.930e+04 -0.379 0.70436
  598. typeCR:chan1CP 1.340e-01 1.875e-01 2.930e+04 0.715 0.47486
  599. typeWR:chan1P 1.534e-01 1.869e-01 2.930e+04 0.821 0.41176
  600. typeCR:chan1P 9.579e-02 1.875e-01 2.930e+04 0.511 0.60950
  601. mood1:typeWR:chan1C 1.309e-01 1.869e-01 2.930e+04 0.700 0.48377
  602. mood1:typeCR:chan1C 1.319e-01 1.875e-01 2.930e+04 0.703 0.48180
  603. mood1:typeWR:chan1CP 3.135e-01 1.869e-01 2.930e+04 1.677 0.09351 .
  604. mood1:typeCR:chan1CP 1.788e-01 1.875e-01 2.930e+04 0.953 0.34045
  605. mood1:typeWR:chan1P 3.742e-01 1.869e-01 2.930e+04 2.002 0.04529 *
  606. mood1:typeCR:chan1P 1.226e-01 1.875e-01 2.930e+04 0.654 0.51322 '
  607. summary(rePCA(N4_L1_chan1_model2)) # singular fit? ==> relative Principal Component Analysis
  608. relgrad <- with(N4_L1_chan1_model2@optinfo$derivs,solve(Hessian,gradient)) # convergence problem?
  609. max(abs(relgrad)) # <.001? ==> the model is close to convergence
  610. plot_model(N4_L1_chan1_model2) # plot the model
  611. plot(N4_L1_chan1_model2) # reasonably equal amount of spread?
  612. hist(residuals(N4_L1_chan1_model2)) # more or less normally distributed?
  613. qqnorm(residuals(N4_L1_chan1_model2)) # reasonably aligned? '/'
  614. #tab_model(N4_L1_chan1_model2,transform = NULL, show.est=TRUE, show.ci=TRUE, show.se=TRUE, show.df=TRUE, show.stat=TRUE, wrap.labels=2, df.method = "satterthwaite", title = "N400 Polish (L1)", file = "N400_L1_model_specs.html")
  615. # POST-HOCS
  616. # mood
  617. Polish_chan1_fixed_mood <- emmeans(N4_L1_chan1_model2, pairwise ~ mood,adjust = "bonferroni")
  618. print(Polish_chan1_fixed_mood)
  619. plot(Polish_chan1_fixed_mood)
  620. ' mood emmean SE df asymp.LCL asymp.UCL
  621. positive -1.06 0.271 Inf -1.59 -0.531
  622. negative -1.25 0.271 Inf -1.78 -0.717'
  623. ' contrast estimate SE df z.ratio p.value
  624. positive - negative 0.186 0.0541 Inf 3.446 0.0006'
  625. # type
  626. Polish_chan1_fixed_type <- emmeans(N4_L1_chan1_model2, pairwise ~ type,adjust = "bonferroni")
  627. print(Polish_chan1_fixed_type)
  628. plot(Polish_chan1_fixed_type)
  629. ' type emmean SE df asymp.LCL asymp.UCL
  630. UN -1.699 0.271 Inf -2.23 -1.1671
  631. WR -1.254 0.276 Inf -1.79 -0.7142
  632. CR -0.511 0.291 Inf -1.08 0.0586'
  633. ' contrast estimate SE df z.ratio p.value
  634. UN - WR -0.444 0.0953 Inf -4.662 <.0001
  635. UN - CR -1.187 0.1500 Inf -7.923 <.0001
  636. WR - CR -0.743 0.1290 Inf -5.747 <.0001'
  637. # mood x type x chan1 [1]
  638. Polish_int_mood_chan1_type1 <- emmeans(N4_L1_chan1_model2, pairwise ~ mood|type,by="chan1",adjust = "bonferroni")
  639. print(Polish_int_mood_chan1_type1)
  640. plot(Polish_int_mood_chan1_type1)
  641. '
  642. # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> FC
  643. type = UN, chan1 = FC:
  644. contrast estimate SE df z.ratio p.value
  645. positive - negative 0.4039 0.187 Inf 2.156 0.0311
  646. type = WR, chan1 = FC:
  647. contrast estimate SE df z.ratio p.value
  648. positive - negative -0.0930 0.187 Inf -0.498 0.6184
  649. type = CR, chan1 = FC:
  650. contrast estimate SE df z.ratio p.value
  651. positive - negative 0.1865 0.188 Inf 0.993 0.3208
  652. # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> C
  653. type = UN, chan1 = C:
  654. contrast estimate SE df z.ratio p.value
  655. positive - negative 0.2662 0.187 Inf 1.421 0.1553
  656. type = WR, chan1 = C:
  657. contrast estimate SE df z.ratio p.value
  658. positive - negative 0.0311 0.187 Inf 0.167 0.8677
  659. type = CR, chan1 = C:
  660. contrast estimate SE df z.ratio p.value
  661. positive - negative 0.3126 0.188 Inf 1.664 0.0961
  662. # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> CP
  663. type = UN, chan1 = CP:
  664. contrast estimate SE df z.ratio p.value
  665. positive - negative 0.1054 0.187 Inf 0.563 0.5737
  666. type = WR, chan1 = CP:
  667. contrast estimate SE df z.ratio p.value
  668. positive - negative 0.2356 0.187 Inf 1.262 0.2069
  669. type = CR, chan1 = CP:
  670. contrast estimate SE df z.ratio p.value
  671. positive - negative 0.2456 0.188 Inf 1.307 0.1912
  672. # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> P
  673. type = UN, chan1 = P:
  674. contrast estimate SE df z.ratio p.value
  675. positive - negative 0.0876 0.187 Inf 0.468 0.6400
  676. type = WR, chan1 = P:
  677. contrast estimate SE df z.ratio p.value
  678. positive - negative 0.3392 0.187 Inf 1.817 0.0692
  679. type = CR, chan1 = P:
  680. contrast estimate SE df z.ratio p.value
  681. positive - negative 0.1155 0.188 Inf 0.615 0.5388'
  682. # mood x type x chan1 [2]
  683. Polish_int_mood_chan1_type2 <- emmeans(N4_L1_chan1_model2, pairwise ~ type|mood,by="chan1",adjust = "bonferroni")
  684. print(Polish_int_mood_chan1_type2)
  685. plot(Polish_int_mood_chan1_type2)
  686. '# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> FC
  687. mood = positive, chan1 = FC:
  688. contrast estimate SE df z.ratio p.value
  689. UN - WR -0.153 0.199 Inf -0.770 1.0000
  690. UN - CR -1.009 0.231 Inf -4.373 <.0001
  691. WR - CR -0.856 0.218 Inf -3.930 0.0003
  692. mood = negative, chan1 = FC:
  693. contrast estimate SE df z.ratio p.value
  694. UN - WR -0.650 0.200 Inf -3.256 0.0034
  695. UN - CR -1.226 0.231 Inf -5.315 <.0001
  696. WR - CR -0.577 0.218 Inf -2.650 0.0241'
  697. '# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> C
  698. mood = positive, chan1 = C:
  699. contrast estimate SE df z.ratio p.value
  700. UN - WR -0.373 0.199 Inf -1.876 0.1819
  701. UN - CR -1.190 0.231 Inf -5.155 <.0001
  702. WR - CR -0.817 0.218 Inf -3.750 0.0005
  703. mood = negative, chan1 = C:
  704. contrast estimate SE df z.ratio p.value
  705. UN - WR -0.608 0.200 Inf -3.046 0.0070
  706. UN - CR -1.143 0.231 Inf -4.955 <.0001
  707. WR - CR -0.535 0.218 Inf -2.460 0.0417'
  708. '# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> CP
  709. mood = positive, chan1 = CP:
  710. contrast estimate SE df z.ratio p.value
  711. UN - WR -0.396 0.199 Inf -1.991 0.1396
  712. UN - CR -1.322 0.231 Inf -5.728 <.0001
  713. WR - CR -0.926 0.218 Inf -4.252 0.0001
  714. mood = negative, chan1 = CP:
  715. contrast estimate SE df z.ratio p.value
  716. UN - WR -0.265 0.200 Inf -1.330 0.5507
  717. UN - CR -1.182 0.231 Inf -5.121 <.0001
  718. WR - CR -0.916 0.218 Inf -4.211 0.0001'
  719. '# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> P
  720. mood = positive, chan1 = P:
  721. contrast estimate SE df z.ratio p.value
  722. UN - WR -0.681 0.199 Inf -3.425 0.0018
  723. UN - CR -1.228 0.231 Inf -5.319 <.0001
  724. WR - CR -0.547 0.218 Inf -2.510 0.0362
  725. mood = negative, chan1 = P:
  726. contrast estimate SE df z.ratio p.value
  727. UN - WR -0.429 0.200 Inf -2.150 0.0947
  728. UN - CR -1.200 0.231 Inf -5.199 <.0001
  729. WR - CR -0.771 0.218 Inf -3.542 0.0012'
  730. # observed power
  731. vc <- as.data.frame(VarCorr(N4_L1_chan1_model2))
  732. sigma_ptp <- vc$vcov[vc$grp == "ptp" & vc$var1 == "(Intercept)"][1] # Participant intercept variance (scalar)
  733. sigma_resid <- vc$vcov[vc$grp == "Residual"][1] # Residual variance (scalar)
  734. print(icc_ptp <- sigma_ptp / (sigma_ptp + sigma_resid))
  735. smpsize_lmm(
  736. eff.size = 0.25, # medium effect size
  737. df.n = 6, # (3-1)*(2-1)*(4-1) -- 3x2x4 design
  738. power = .19, # observed power for 40 items per condition
  739. sig.level = 0.05,
  740. k = 32, # participants
  741. n = 960, # trials per participant (40*6*4)
  742. icc = 0.05919195)
  743. #### LMMs: N400 English [L2] ####
  744. # df3 --- N400 English
  745. df3 <- df %>% subset(chan %in% FC_C_CP_P_3 & time >= 300 & time <=500 & language %in% "English") %>% droplevels() %>%
  746. dplyr::group_by(mood, type, ptp, word,chan1) %>%
  747. dplyr::summarise(mean_amp = mean(amp))
  748. # contrasts
  749. df3$mood <- factor(df3$mood, levels=c("positive", "negative"))
  750. df3$type <- factor(df3$type, levels=c("UN", "WR", "CR"))
  751. contrasts(df3$mood) <- contr.sum(levels(df3$mood))
  752. df3$type <- relevel(df3$type, ref = "UN")
  753. contrasts(df3$chan1) <- contr.sum(levels(df3$chan1))
  754. df3$chan1 <- relevel(df3$chan1, ref = "FC")
  755. # lmer
  756. N4_L2_chan1_model0 <- lmer(mean_amp ~ mood*type*chan1 + (1|ptp) + (1|word) + (1|ptp:chan1), data=df3)
  757. N4_L2_chan1_model1 <- lmer(mean_amp ~ mood*type*chan1 + (1+type+mood|ptp) + (1+type+mood|word) + (1|ptp:chan1), data=df3)
  758. N4_L2_chan1_model2 <- lmer(mean_amp ~ mood*type*chan1 + (1+mood|ptp) + (1|word) + (1|ptp:chan1), data=df3)
  759. summary(N4_L2_chan1_model2)
  760. anova(N4_L1_chan1_model2)
  761. anova(N4_L1_chan1_model0, N4_L1_chan1_model2)
  762. ' Estimate Std. Error df t value Pr(>|t|)
  763. (Intercept) -2.281e+00 3.554e-01 9.589e+01 -6.418 5.25e-09 ***
  764. mood1 9.539e-02 9.961e-02 7.059e+02 0.958 0.338613
  765. typeWR 4.646e-01 1.308e-01 2.900e+04 3.552 0.000383 ***
  766. typeCR 1.250e+00 1.309e-01 2.900e+04 9.549 < 2e-16 ***
  767. chan1C -4.528e-01 3.932e-01 1.084e+02 -1.152 0.252023
  768. chan1CP 3.809e-01 3.932e-01 1.084e+02 0.969 0.334859
  769. chan1P 2.264e+00 3.932e-01 1.084e+02 5.757 8.08e-08 ***
  770. mood1:typeWR -1.318e-01 1.308e-01 2.899e+04 -1.008 0.313399
  771. mood1:typeCR 6.028e-02 1.309e-01 2.900e+04 0.461 0.645063
  772. mood1:chan1C -2.149e-02 1.309e-01 2.898e+04 -0.164 0.869553
  773. mood1:chan1CP 4.181e-02 1.309e-01 2.898e+04 0.319 0.749373
  774. mood1:chan1P 1.071e-01 1.309e-01 2.898e+04 0.818 0.413154
  775. typeWR:chan1C 1.100e-01 1.849e-01 2.898e+04 0.595 0.551902
  776. typeCR:chan1C 1.751e-01 1.850e-01 2.898e+04 0.946 0.344058
  777. typeWR:chan1CP 2.923e-01 1.849e-01 2.898e+04 1.581 0.113952
  778. typeCR:chan1CP 2.085e-01 1.850e-01 2.898e+04 1.127 0.259682
  779. typeWR:chan1P 1.327e-01 1.849e-01 2.898e+04 0.718 0.473061
  780. typeCR:chan1P -1.564e-01 1.850e-01 2.898e+04 -0.845 0.397996
  781. mood1:typeWR:chan1C 1.162e-01 1.849e-01 2.898e+04 0.629 0.529545
  782. mood1:typeCR:chan1C 8.101e-02 1.850e-01 2.898e+04 0.438 0.661499
  783. mood1:typeWR:chan1CP 1.231e-01 1.849e-01 2.898e+04 0.666 0.505468
  784. mood1:typeCR:chan1CP 7.412e-02 1.850e-01 2.898e+04 0.401 0.688675
  785. mood1:typeWR:chan1P 1.108e-03 1.849e-01 2.898e+04 0.006 0.995220
  786. mood1:typeCR:chan1P -2.562e-02 1.850e-01 2.898e+04 -0.138 0.889862 '
  787. #POST-HOCS
  788. # mood
  789. English_chan1_fixed_mood <- emmeans(N4_L2_chan1_model2, pairwise ~ mood,adjust = "bonferroni")
  790. print(English_chan1_fixed_mood)
  791. plot(English_chan1_fixed_mood)
  792. ' mood emmean SE df asymp.LCL asymp.UCL
  793. positive -0.964 0.250 Inf -1.45 -0.473
  794. negative -1.232 0.274 Inf -1.77 -0.694'
  795. ' contrast estimate SE df z.ratio p.value
  796. positive - negative 0.268 0.0909 Inf 2.952 0.0032'
  797. # type
  798. Polish_chan1_fixed_type <- emmeans(N4_L2_chan1_model2, pairwise ~ type,adjust = "bonferroni")
  799. print(Polish_chan1_fixed_type)
  800. plot(Polish_chan1_fixed_type)
  801. ' type emmean SE df asymp.LCL asymp.UCL
  802. UN -1.733 0.261 Inf -2.245 -1.221
  803. WR -1.135 0.261 Inf -1.647 -0.622
  804. CR -0.426 0.261 Inf -0.939 0.086'
  805. ' contrast estimate SE df z.ratio p.value
  806. UN - WR -0.598 0.0655 Inf -9.135 <.0001
  807. UN - CR -1.307 0.0655 Inf -19.937 <.0001
  808. WR - CR -0.708 0.0655 Inf -10.817 <.0001'
  809. #### PLOTS: N400 ####
  810. #### Polish -- N400: type x mood by chan1 [POSITIVE MOOD] ####
  811. plotstats2a <- df %>% subset(chan %in% FC_C_CP_P_3 & time >= -200 & time <= 800 & language %in% "Polish" & mood %in% "positive") %>% droplevels() %>%
  812. dplyr::group_by(time, type, chan1) %>%
  813. dplyr::summarise(mean_amp = mean(amp),CIlower = Rmisc::CI(amp, ci = 0.95)["lower"],CIupper = Rmisc::CI(amp, ci = 0.95)["upper"])
  814. plotstats2a <- plotstats2a %>% group_by(type, chan1) %>% mutate(baseline = mean_amp[time == 0],mean_amp = mean_amp - baseline, CIlower = CIlower - baseline,CIupper = CIupper - baseline) %>% dplyr::select(-baseline)
  815. plotstats2a <- plotstats2a %>% arrange(time) %>% group_by(type, chan1) %>% mutate(mean_amp = zoo::rollmean(mean_amp, k = 10, fill = NA, align = "center"), CIlower = zoo::rollmean(CIlower, k = 10, fill = NA, align = "center"), CIupper = zoo::rollmean(CIupper, k = 17, fill = NA, align = "center"))
  816. ggplot(plotstats2a, aes(time, mean_amp, color = type, group = type)) +
  817. geom_ribbon(aes(ymin = CIlower, ymax = CIupper, fill = type),
  818. alpha = 0.2, linetype = 0) +
  819. #facet_wrap(.~mood, ncol =2, labeller = as_labeller(c("positive" = "Positive mood", "negative" = "Negative mood"))) +
  820. facet_wrap(.~chan1, ncol=4)+
  821. geom_line(size = 0.75) +
  822. guides(fill = "none") +
  823. labs(x = "Time (ms)", y = expression(paste("Amplitude (", mu, "V)")), colour = "") +
  824. scale_shape_prism() +
  825. #theme_prism() +
  826. scale_y_reverse(breaks = c( 3,2,1,0, -1, -2, -3), limits = c(3,-3.7), guide = "prism_offset") +
  827. scale_x_continuous(breaks = c(-100, 0, 100, 300, 500, 700), guide = "prism_offset") +
  828. theme_classic2()+
  829. geom_vline(xintercept = 0, linetype = "dotted", alpha = 0.5) +
  830. geom_hline(yintercept = 0, linetype = "dotted", alpha = 0.5) +
  831. geom_vline(xintercept = 300, linetype = "solid", alpha = 1, color = "black") +
  832. geom_vline(xintercept = 500, linetype = "solid", alpha = 1, color = "black") +
  833. theme(text = element_text(size = 20, color = "black", family = "Helvetica"),
  834. axis.line.x = element_line(colour = "black", size = .5),
  835. axis.line.y = element_line(colour = "black", size = .5),
  836. axis.text = element_text(size = 18, color = "black", family = "Helvetica"),
  837. strip.text.x.top = element_text(size = 20, color = "black", family = "Helvetica"),
  838. plot.title = element_text(hjust = 0, family = "Helvetica"),
  839. legend.position = "bottom",
  840. legend.title = element_text(size = 20),
  841. legend.text = element_text(size = 20)) +
  842. scale_fill_manual(values = c("#ffc000","#ff2f92","#404A80")) +
  843. scale_color_manual(name = "", values = c("#ffc000","#ff2f92","#404A80"), labels = c("Unrelated (UR) pairs", "Weakly related (WR) pairs", "Closely related (CR) pairs"))+
  844. guides(colour = guide_legend(override.aes = list(linetype = 1, shape = 16, size = 5)))
  845. ggsave(filename ="L1_negative_chan1.png", plot = last_plot(), width = 30,height = 12, units = "cm", bg = "white", path="/Users/m/Desktop/MoBSeR/R /plots")
  846. #### Polish -- N400: type x mood by chan1 [NEGATIVE MOOD] ####
  847. plotstats2b <- df %>% subset(chan %in% FC_C_CP_P_3 & time >= -200 & time <= 800 & language %in% "Polish" & mood %in% "negative") %>% droplevels() %>%
  848. dplyr::group_by(time, type, chan1) %>%
  849. dplyr::summarise(mean_amp = mean(amp),CIlower = Rmisc::CI(amp, ci = 0.95)["lower"],CIupper = Rmisc::CI(amp, ci = 0.95)["upper"])
  850. plotstats2b <- plotstats2b %>% group_by(type, chan1) %>% mutate(baseline = mean_amp[time == 0],mean_amp = mean_amp - baseline, CIlower = CIlower - baseline,CIupper = CIupper - baseline) %>% dplyr::select(-baseline)
  851. plotstats2b <- plotstats2b %>% arrange(time) %>% group_by(type, chan1) %>% mutate(mean_amp = zoo::rollmean(mean_amp, k = 10, fill = NA, align = "center"), CIlower = zoo::rollmean(CIlower, k = 10, fill = NA, align = "center"), CIupper = zoo::rollmean(CIupper, k = 17, fill = NA, align = "center"))
  852. ggplot(plotstats2b, aes(time, mean_amp, color = type, group = type)) +
  853. geom_ribbon(aes(ymin = CIlower, ymax = CIupper, fill = type),
  854. alpha = 0.2, linetype = 0) +
  855. #facet_wrap(.~mood, ncol =2, labeller = as_labeller(c("positive" = "Positive mood", "negative" = "Negative mood"))) +
  856. facet_wrap(.~chan1, ncol=4)+
  857. geom_line(size = 0.75) +
  858. guides(fill = "none") +
  859. labs(x = "Time (ms)", y = expression(paste("Amplitude (", mu, "V)")), colour = "") +
  860. scale_shape_prism() +
  861. #theme_prism() +
  862. scale_y_reverse(breaks = c( 3,2,1,0, -1, -2, -3), limits = c(3,-3.7), guide = "prism_offset") +
  863. scale_x_continuous(breaks = c(-100, 0, 100, 300, 500, 700), guide = "prism_offset") +
  864. theme_classic2()+
  865. geom_vline(xintercept = 0, linetype = "dotted", alpha = 0.5) +
  866. geom_hline(yintercept = 0, linetype = "dotted", alpha = 0.5) +
  867. geom_vline(xintercept = 300, linetype = "solid", alpha = 1, color = "black") +
  868. geom_vline(xintercept = 500, linetype = "solid", alpha = 1, color = "black") +
  869. theme(text = element_text(size = 20, color = "black", family = "Helvetica"),
  870. axis.line.x = element_line(colour = "black", size = .5),
  871. axis.line.y = element_line(colour = "black", size = .5),
  872. axis.text = element_text(size = 18, color = "black", family = "Helvetica"),
  873. strip.text.x.top = element_text(size = 20, color = "black", family = "Helvetica"),
  874. plot.title = element_text(hjust = 0, family = "Helvetica"),
  875. legend.position = "bottom",
  876. legend.title = element_text(size = 20),
  877. legend.text = element_text(size = 20)) +
  878. scale_fill_manual(values = c("#ffc000","#ff2f92","#404A80")) +
  879. scale_color_manual(name = "", values = c("#ffc000","#ff2f92","#404A80"), labels = c("Unrelated (UR) pairs", "Weakly related (WR) pairs", "Closely related (CR) pairs"))+
  880. guides(colour = guide_legend(override.aes = list(linetype = 1, shape = 16, size = 5)))
  881. ggsave(filename ="L1_negative_chan1.png", plot = last_plot(), width = 30,height = 12, units = "cm", bg = "white", path="/Users/m/Desktop/MoBSeR/R /plots")
  882. #### English -- N400: type x mood by chan1 [POSITIVE MOOD] ####
  883. plotstats2d <- df %>% subset(chan %in% FC_C_CP_P_3 & time >= -200 & time <= 800 & language %in% "English" & mood %in% "positive") %>% droplevels() %>%
  884. dplyr::group_by(time, type, chan1) %>%
  885. dplyr::summarise(mean_amp = mean(amp),CIlower = Rmisc::CI(amp, ci = 0.95)["lower"],CIupper = Rmisc::CI(amp, ci = 0.95)["upper"])
  886. plotstats2d <- plotstats2d %>% group_by(type, chan1) %>% mutate(baseline = mean_amp[time == 0],mean_amp = mean_amp - baseline, CIlower = CIlower - baseline,CIupper = CIupper - baseline) %>% dplyr::select(-baseline)
  887. plotstats2d <- plotstats2d %>% arrange(time) %>% group_by(type, chan1) %>% mutate(mean_amp = zoo::rollmean(mean_amp, k = 10, fill = NA, align = "center"), CIlower = zoo::rollmean(CIlower, k = 10, fill = NA, align = "center"), CIupper = zoo::rollmean(CIupper, k = 17, fill = NA, align = "center"))
  888. ggplot(plotstats2d, aes(time, mean_amp, color = type, group = type)) +
  889. geom_ribbon(aes(ymin = CIlower, ymax = CIupper, fill = type),
  890. alpha = 0.2, linetype = 0) +
  891. #facet_wrap(.~mood, ncol =2, labeller = as_labeller(c("positive" = "Positive mood", "negative" = "Negative mood"))) +
  892. facet_wrap(.~chan1, ncol=4)+
  893. geom_line(size = 0.75) +
  894. guides(fill = "none") +
  895. labs(x = "Time (ms)", y = expression(paste("Amplitude (", mu, "V)")), colour = "") +
  896. scale_shape_prism() +
  897. #theme_prism() +
  898. scale_y_reverse(breaks = c( 3,2,1,0, -1, -2, -3), limits = c(3,-3.7), guide = "prism_offset") +
  899. scale_x_continuous(breaks = c(-100, 0, 100, 300, 500, 700), guide = "prism_offset") +
  900. theme_classic2()+
  901. geom_vline(xintercept = 0, linetype = "dotted", alpha = 0.5) +
  902. geom_hline(yintercept = 0, linetype = "dotted", alpha = 0.5) +
  903. geom_vline(xintercept = 300, linetype = "solid", alpha = 1, color = "black") +
  904. geom_vline(xintercept = 500, linetype = "solid", alpha = 1, color = "black") +
  905. theme(text = element_text(size = 20, color = "black", family = "Helvetica"),
  906. axis.line.x = element_line(colour = "black", size = .5),
  907. axis.line.y = element_line(colour = "black", size = .5),
  908. axis.text = element_text(size = 18, color = "black", family = "Helvetica"),
  909. strip.text.x.top = element_text(size = 20, color = "black", family = "Helvetica"),
  910. plot.title = element_text(hjust = 0, family = "Helvetica"),
  911. legend.position = "bottom",
  912. legend.title = element_text(size = 20),
  913. legend.text = element_text(size = 20)) +
  914. scale_fill_manual(values = c("#ffc000","#ff2f92","#404A80")) +
  915. scale_color_manual(name = "", values = c("#ffc000","#ff2f92","#404A80"), labels = c("Unrelated (UR) pairs", "Weakly related (WR) pairs", "Closely related (CR) pairs"))+
  916. guides(colour = guide_legend(override.aes = list(linetype = 1, shape = 16, size = 5)))
  917. ggsave(filename ="L2_positive_chan1.png", plot = last_plot(), width = 30,height = 12, units = "cm", bg = "white", path="/Users/m/Desktop/MoBSeR/R /plots")
  918. #### _________________ semantic vectors x language _________________ ####
  919. df8 <- df %>%
  920. dplyr::group_by(language, type, word) %>%
  921. dplyr::summarise(vector = mean(vector))
  922. # contrasts
  923. df8$type <- factor(df8$type, levels=c("UN", "WR", "CR"))
  924. df8$type <- relevel(df8$type, ref = "UN")
  925. # lmer
  926. vct_model0 <- lmer(vector ~ language*type + (1|word), data=df8)
  927. vct_model1 <- lmer(vector ~ language*type + (1|word), data=df8)
  928. ' Estimate Std. Error df t value Pr(>|t|)
  929. (Intercept) 0.143665 0.009863 702.880235 14.566 < 2e-16 ***
  930. languageEnglish -0.047342 0.013948 702.880235 -3.394 0.000727 ***
  931. typeCR 0.331080 0.013520 471.999996 24.487 < 2e-16 ***
  932. typeWR 0.215297 0.013520 471.999995 15.924 < 2e-16 ***
  933. languageEnglish:typeCR 0.086150 0.019121 471.999995 4.506 8.36e-06 ***
  934. languageEnglish:typeWR 0.019210 0.019121 471.999995 1.005 0.315573 '
  935. summary(vct_model1)
  936. anova(vct_model1)
  937. anova(vct_model0, vct_model1)
  938. summary(rePCA(vct_model1)) # singular fit? ==> relative Principal Component Analysis
  939. relgrad <- with(vct_model1@optinfo$derivs,solve(Hessian,gradient)) # convergence problem?
  940. max(abs(relgrad)) # <.001? ==> the model is close to convergence
  941. plot_model(vct_model1) # plot the model
  942. plot(vct_model1) # reasonably equal amount of spread?
  943. hist(residuals(vct_model1)) # more or less normally distributed?
  944. qqnorm(residuals(vct_model1)) # reasonably aligned? '/'
  945. #POST-HOCS
  946. # means
  947. summary_table <- df8 %>%
  948. dplyr::group_by(language, type) %>%
  949. dplyr::summarize(
  950. mean_vector = mean(vector, na.rm = TRUE),
  951. n = sum(!is.na(vector)),
  952. sd_vector = sd(vector, na.rm = TRUE),
  953. se_vector = sd_vector / sqrt(n),
  954. ci_lower = mean_vector - qt(0.975, df = n - 1) * se_vector,
  955. ci_upper = mean_vector + qt(0.975, df = n - 1) * se_vector,
  956. .groups = "drop"
  957. )
  958. print(summary_table)
  959. ' language type mean_vector n sd_vector se_vector ci_lower ci_upper
  960. <fct> <fct> <dbl> <int> <dbl> <dbl> <dbl> <dbl>
  961. 1 Polish UN 0.144 119 0.0832 0.00762 0.129 0.159
  962. 2 Polish WR 0.359 119 0.114 0.0104 0.338 0.380
  963. 3 Polish CR 0.475 119 0.115 0.0106 0.454 0.496
  964. 4 English UN 0.0963 119 0.0713 0.00654 0.0834 0.109
  965. 5 English WR 0.331 119 0.107 0.00980 0.311 0.350
  966. 6 English CR 0.514 119 0.141 0.0129 0.488 0.539'
  967. # language
  968. fixed_lng <- emmeans(vct_model1, pairwise ~ language, adjust = "bonferroni")
  969. print(fixed_lng)
  970. plot(fixed_lng)
  971. ' language emmean SE df lower.CL upper.CL
  972. Polish 0.326 0.00603 236 0.314 0.338
  973. English 0.314 0.00603 236 0.302 0.325'
  974. ' contrast estimate SE df t.ratio p.value
  975. Polish - English 0.0122 0.00852 236 1.434 0.1530'
  976. # type
  977. fixed_type <- emmeans(vct_model1, pairwise ~ type, adjust = "bonferroni")
  978. print(fixed_type)
  979. plot(fixed_type)
  980. ' contrast estimate SE df t.ratio p.value
  981. UN - WR -0.225 0.00956 472 -23.524 <.0001
  982. UN - CR -0.374 0.00956 472 -39.136 <.0001
  983. WR - CR -0.149 0.00956 472 -15.611 <.0001'
  984. ' type emmean SE df lower.CL upper.CL
  985. UN 0.120 0.00697 703 0.106 0.134
  986. WR 0.345 0.00697 703 0.331 0.359
  987. CR 0.494 0.00697 703 0.480 0.508'
  988. # # language x type
  989. # vct_lng_type1 <- emmeans(vct_model1, pairwise ~ language|type, adjust = "bonferroni")
  990. # print(vct_lng_type1)
  991. # plot(vct_lng_type1)
  992. #
  993. # 'type = UN:
  994. # contrast estimate SE df t.ratio p.value
  995. # Polish - English 0.0473 0.0139 703 3.394 0.0007
  996. #
  997. # type = WR:
  998. # contrast estimate SE df t.ratio p.value
  999. # Polish - English 0.0281 0.0139 703 2.017 0.0441
  1000. #
  1001. # type = CR:
  1002. # contrast estimate SE df t.ratio p.value
  1003. # Polish - English -0.0388 0.0139 703 -2.782 0.0055'
  1004. #
  1005. # 'type = UN:
  1006. # language emmean SE df lower.CL upper.CL
  1007. # Polish 0.1437 0.00986 703 0.124 0.163
  1008. # English 0.0963 0.00986 703 0.077 0.116
  1009. #
  1010. # type = WR:
  1011. # language emmean SE df lower.CL upper.CL
  1012. # Polish 0.3590 0.00986 703 0.340 0.378
  1013. # English 0.3308 0.00986 703 0.311 0.350
  1014. #
  1015. # type = CR:
  1016. # language emmean SE df lower.CL upper.CL
  1017. # Polish 0.4747 0.00986 703 0.455 0.494
  1018. # English 0.5136 0.00986 703 0.494 0.533'
  1019. #
  1020. # vct_lng_type2 <- emmeans(vct_model1, pairwise ~ type|language, adjust = "bonferroni")
  1021. # print(vct_lng_type2)
  1022. # plot(vct_lng_type2)
  1023. #
  1024. # 'language = Polish:
  1025. # contrast estimate SE df t.ratio p.value
  1026. # UN - WR -0.215 0.0135 472 -15.924 <.0001
  1027. # UN - CR -0.331 0.0135 472 -24.487 <.0001
  1028. # WR - CR -0.116 0.0135 472 -8.563 <.0001
  1029. #
  1030. # language = English:
  1031. # contrast estimate SE df t.ratio p.value
  1032. # UN - WR -0.235 0.0135 472 -17.345 <.0001
  1033. # UN - CR -0.417 0.0135 472 -30.859 <.0001
  1034. # WR - CR -0.183 0.0135 472 -13.514 <.0001'
  1035. #
  1036. # 'language = Polish:
  1037. # type emmean SE df lower.CL upper.CL
  1038. # UN 0.1437 0.00986 703 0.124 0.163
  1039. # WR 0.3590 0.00986 703 0.340 0.378
  1040. # CR 0.4747 0.00986 703 0.455 0.494
  1041. #
  1042. # language = English:
  1043. # type emmean SE df lower.CL upper.CL
  1044. # UN 0.0963 0.00986 703 0.077 0.116
  1045. # WR 0.3308 0.00986 703 0.311 0.350
  1046. # CR 0.5136 0.00986 703 0.494 0.533'
  1047. #### _________________ N400 x semantic vectors _________________ ####
  1048. #### N400 Polish [L1] ####
  1049. df6 <- df %>% subset(chan %in% FC_C_CP_P_3 & time >= 300 & time <=500 & language %in% "Polish") %>% droplevels() %>%
  1050. dplyr::group_by(mood, type, ptp, word,vector) %>%
  1051. dplyr::summarise(mean_amp = mean(amp))
  1052. # contrasts
  1053. df6$mood <- factor(df6$mood, levels=c("positive", "negative"))
  1054. df6$type <- factor(df6$type, levels=c("UN", "WR", "CR"))
  1055. contrasts(df6$mood) <- contr.sum(levels(df6$mood))
  1056. df6$type <- relevel(df6$type, ref = "UN")
  1057. # lmer
  1058. N4_L1_vct_model0 <- lmer(mean_amp ~ mood*type*vector + (1|ptp) + (1|word), data=df6)
  1059. N4_L1_vct_model1 <- lmer(mean_amp ~ mood*type*vector + (1+type+mood|ptp) + (1+type+mood|word), data=df6)
  1060. N4_L1_vct_model2 <- lmer(mean_amp ~ mood*type*vector + (1+type|ptp) + (1+mood|word), data=df6)
  1061. '(Intercept) -1.71230 0.29660 45.98929 -5.773 6.33e-07 ***
  1062. mood1 0.23508 0.13275 1101.16563 1.771 0.0769 .
  1063. typeWR 0.34981 0.26492 1153.40508 1.320 0.1869
  1064. typeCR 0.53566 0.34596 693.27999 1.548 0.1220
  1065. vector 0.09186 0.84098 2190.51093 0.109 0.9130
  1066. mood1:typeWR -0.17480 0.25189 1688.42684 -0.694 0.4878
  1067. mood1:typeCR -0.72402 0.30938 1450.31427 -2.340 0.0194 *
  1068. mood1:vector -0.86860 0.80161 1264.54526 -1.084 0.2788
  1069. typeWR:vector 0.20325 1.03078 2393.92563 0.197 0.8437
  1070. typeCR:vector 1.31299 1.03798 2120.10267 1.265 0.2060
  1071. mood1:typeWR:vector 0.88584 0.98317 1380.95736 0.901 0.3677
  1072. mood1:typeCR:vector 2.12366 0.98697 1222.05738 2.152 0.0316 * '
  1073. summary(N4_L1_vct_model2)
  1074. anova(N4_L1_vct_model2)
  1075. anova(N4_L1_vct_model0, N4_L1_vct_model2)
  1076. summary(rePCA(N4_L1_vct_model2)) # singular fit? ==> relative Principal Component Analysis
  1077. relgrad <- with(N4_L1_vct_model2@optinfo$derivs,solve(Hessian,gradient)) # convergence problem?
  1078. max(abs(relgrad)) # <.001? ==> the model is close to convergence
  1079. plot_model(N4_L1_vct_model2) # plot the model
  1080. plot(N4_L1_vct_model2) # reasonably equal amount of spread?
  1081. hist(residuals(N4_L1_vct_model2)) # more or less normally distributed?
  1082. qqnorm(residuals(N4_L1_vct_model2)) # reasonably aligned? '/'
  1083. #POST-HOCS
  1084. # mood x type
  1085. Polish_vct_int_mood_type1 <- emmeans(N4_L1_vct_model2, pairwise ~ mood|type, adjust = "bonferroni")
  1086. print(Polish_vct_int_mood_type1)
  1087. plot(Polish_vct_int_mood_type1)
  1088. 'type = UN:
  1089. contrast estimate SE df z.ratio p.value
  1090. positive - negative -0.0952 0.320 Inf -0.298 0.7659
  1091. type = WR:
  1092. contrast estimate SE df z.ratio p.value
  1093. positive - negative 0.1318 0.137 Inf 0.963 0.3356
  1094. type = CR:
  1095. contrast estimate SE df z.ratio p.value
  1096. positive - negative -0.1610 0.216 Inf -0.744 0.4567'
  1097. Polish_vct_int_mood_type2 <- emmeans(N4_L1_vct_model2, pairwise ~ type|mood, adjust = "bonferroni")
  1098. print(Polish_vct_int_mood_type2)
  1099. plot(Polish_vct_int_mood_type2)
  1100. 'mood = positive:
  1101. contrast estimate SE df z.ratio p.value
  1102. UN - WR -0.529 0.250 Inf -2.118 0.1024
  1103. UN - CR -0.930 0.302 Inf -3.081 0.0062
  1104. WR - CR -0.401 0.204 Inf -1.964 0.1485
  1105. mood = negative:
  1106. contrast estimate SE df z.ratio p.value
  1107. UN - WR -0.302 0.249 Inf -1.214 0.6740
  1108. UN - CR -0.996 0.300 Inf -3.321 0.0027
  1109. WR - CR -0.693 0.202 Inf -3.431 0.0018'
  1110. # mood x type x vector
  1111. emm_trends <- emtrends(N4_L1_vct_model2,specs = ~ mood * type,var = "vector")
  1112. summary(emm_trends)
  1113. ' mood type vector.trend SE df asymp.LCL asymp.UCL
  1114. positive UN -0.777 1.160 Inf -3.06 1.50
  1115. negative UN 0.960 1.160 Inf -1.31 3.23
  1116. positive WR 0.312 0.848 Inf -1.35 1.97
  1117. negative WR 0.278 0.824 Inf -1.34 1.89
  1118. positive CR 2.660 0.841 Inf 1.01 4.31 <- significant (does not include 0)
  1119. negative CR 0.150 0.826 Inf -1.47 1.77'
  1120. contrast(emm_trends,method = "pairwise",adjust = "holm", by ="mood")
  1121. 'mood = positive:
  1122. contrast estimate SE df z.ratio p.value
  1123. UN - WR -1.089 1.43 Inf -0.760 0.4471
  1124. UN - CR -3.437 1.44 Inf -2.388 0.0508
  1125. WR - CR -2.348 1.19 Inf -1.969 0.0980
  1126. mood = negative:
  1127. contrast estimate SE df z.ratio p.value
  1128. UN - WR 0.683 1.42 Inf 0.482 1.0000
  1129. UN - CR 0.811 1.43 Inf 0.569 1.0000
  1130. WR - CR 0.128 1.17 Inf 0.110 1.0000'
  1131. block_points2 <- quantile(df6$vector, probs = c(.05, .5, .95))
  1132. emm_plot2 <- emmeans(N4_L1_vct_model2,~ mood * type | vector,at = list(vector = block_points2))
  1133. emm_plot2 <- as.data.frame(emm_plot2)
  1134. emm_plot2$type <- factor(emm_plot2$type, levels=c("CR", "WR", "UN"))
  1135. ggplot(emm_plot2,aes(x = vector, y = emmean, color = type)) +
  1136. geom_line(aes(group = type), linewidth = 1) +
  1137. geom_point(size = 2) +
  1138. geom_errorbar(aes(ymin = asymp.LCL, ymax = asymp.UCL),width = 0.1) +
  1139. facet_wrap(~ mood,ncol = 2,labeller = as_labeller(c("positive" = "Positive mood","negative" = "Negative mood"))) +
  1140. scale_color_manual(name = "",values = c("#ffc000", "#ff2f92", "#404A80"),labels = c("Unrelated (UR) pairs","Weakly related (WR) pairs","Closely related (CR) pairs")) +
  1141. #scale_x_continuous(name = "Block progression",breaks = c(1,2,3,4,5,6,7,8),guide = "prism_offset") +
  1142. scale_y_reverse(name = "Predicted mean N400 amplitude (µV)",breaks = c(1,0, -1, -2, -3, -4),limits = c(1, -4),guide = "prism_offset") +
  1143. theme_classic2() +
  1144. scale_shape_prism() +
  1145. theme(text = element_text(size = 20, family = "Helvetica", color = "black"),
  1146. axis.text = element_text(size = 18),
  1147. axis.line = element_line(size = 0.5),
  1148. strip.text = element_text(size = 20),
  1149. strip.background = element_blank(),
  1150. legend.position = "bottom",
  1151. legend.text = element_text(size = 20))
  1152. # by type
  1153. ggplot(emm_plot2,aes(x = vector, y = emmean, color = mood)) +
  1154. geom_line(aes(group = mood), linewidth = 1) +
  1155. geom_point(size = 2) +
  1156. geom_errorbar(aes(ymin = asymp.LCL, ymax = asymp.UCL),width = 0.1) +
  1157. facet_wrap(.~type, ncol =3, labeller = as_labeller(c("UN" = "Unrelated \npairs", "WR" = "Weakly \nrelated pairs", "CR" = "Closely \nrelated pairs"))) +
  1158. scale_color_manual(name = "",values = c("firebrick2","darkblue"),labels = c("Positive mood","Negative mood")) +
  1159. scale_x_continuous(name = "Semantic similarity",breaks = c(0.0, 0.2, 0.4,0.6),guide = "prism_offset") +
  1160. scale_y_reverse(name = "Predicted mean N400 amplitude (µV)",breaks = c(1, 0, -1, -2, -3),limits = c(1, -3),guide = "prism_offset") +
  1161. theme_classic2() +
  1162. scale_shape_prism() +
  1163. theme(text = element_text(size = 20, family = "Helvetica", color = "black"),
  1164. axis.text = element_text(size = 18),
  1165. axis.line = element_line(size = 0.5),
  1166. strip.text = element_text(size = 20),
  1167. strip.background = element_blank(),
  1168. legend.position = "bottom",
  1169. legend.text = element_text(size = 20))
  1170. ggsave(filename ="L1_predicted_similarity.png", plot = last_plot(), width = 20,height = 14, units = "cm", bg = "white", path="/Users/m/Desktop/MoBSeR/R /plots")
  1171. #### N400 English [L2] ####
  1172. df7 <- df %>% subset(chan %in% FC_C_CP_P_3 & time >= 300 & time <=500 & language %in% "English") %>% droplevels() %>%
  1173. dplyr::group_by(mood, type, ptp, word,vector) %>%
  1174. dplyr::summarise(mean_amp = mean(amp))
  1175. # contrasts
  1176. df7$mood <- factor(df7$mood, levels=c("positive", "negative"))
  1177. df7$type <- factor(df7$type, levels=c("UN", "WR", "CR"))
  1178. contrasts(df7$mood) <- contr.sum(levels(df7$mood))
  1179. df7$type <- relevel(df7$type, ref = "UN")
  1180. # lmer
  1181. N4_L2_vct_model0 <- lmer(mean_amp ~ mood*type*vector + (1|ptp) + (1|word), data=df7)
  1182. N4_L2_vct_model1 <- lmer(mean_amp ~ mood*type*vector + (1+type+mood|ptp) + (1+type+mood|word), data=df7)
  1183. N4_L2_vct_model2 <- lmer(mean_amp ~ mood*type*vector + (1+type|ptp) + (1+mood|word), data=df7)
  1184. summary(N4_L1_vct_model2)
  1185. anova(N4_L1_vct_model2)
  1186. anova(N4_L1_vct_model0, N4_L1_vct_model2)
  1187. ' Estimate Std. Error df t value Pr(>|t|)
  1188. (Intercept) -1.8010 0.2970 39.4702 -6.063 4.05e-07 ***
  1189. mood1 0.1056 0.1118 1053.5220 0.945 0.3449
  1190. typeWR 0.1565 0.2552 869.4058 0.613 0.5401
  1191. typeCR 0.7242 0.3014 609.7491 2.402 0.0166 *
  1192. vector 0.6812 0.9718 2277.0085 0.701 0.4834
  1193. mood1:typeWR -0.3553 0.2382 1891.8090 -1.491 0.1361
  1194. mood1:typeCR 0.3406 0.2729 1702.8740 1.248 0.2122
  1195. mood1:vector 0.2537 0.9304 1396.8918 0.273 0.7852
  1196. typeWR:vector 0.8672 1.1558 2590.3667 0.750 0.4531
  1197. typeCR:vector 0.5884 1.0876 2330.1993 0.541 0.5885
  1198. mood1:typeWR:vector 0.6686 1.1107 1597.5895 0.602 0.5473
  1199. mood1:typeCR:vector -0.6980 1.0416 1451.2130 -0.670 0.5029 '
  1200. summary(rePCA(N4_L1_vct_model2)) # singular fit? ==> relative Principal Component Analysis
  1201. relgrad <- with(N4_L1_vct_model2@optinfo$derivs,solve(Hessian,gradient)) # convergence problem?
  1202. max(abs(relgrad)) # <.001? ==> the model is close to convergence
  1203. plot_model(N4_L1_vct_model2) # plot the model
  1204. plot(N4_L1_vct_model2) # reasonably equal amount of spread?
  1205. hist(residuals(N4_L1_vct_model2)) # more or less normally distributed?
  1206. qqnorm(residuals(N4_L1_vct_model2)) # reasonably aligned? '/'
  1207. #POST-HOCS
  1208. # type
  1209. English_vct_fixed_type <- emmeans(N4_L1_vct_model2, pairwise ~ type,adjust = "bonferroni")
  1210. print(English_vct_fixed_type)
  1211. plot(English_vct_fixed_type)
  1212. 'contrast estimate SE df z.ratio p.value
  1213. UN - WR -0.416 0.181 Inf -2.301 0.0642
  1214. UN - CR -0.963 0.232 Inf -4.145 0.0001
  1215. WR - CR -0.547 0.160 Inf -3.423 0.0019'
  1216. ' type emmean SE df asymp.LCL asymp.UCL
  1217. UN -1.682 0.311 Inf -2.29 -1.073
  1218. WR -1.266 0.276 Inf -1.81 -0.726
  1219. CR -0.719 0.303 Inf -1.31 -0.127'
  1220. block_points2 <- quantile(df7$vector, probs = c(.05, .5, .95))
  1221. emm_plot2 <- emmeans(N4_L2_vct_model2,~ mood * type | vector,at = list(vector = block_points2))
  1222. emm_plot2 <- as.data.frame(emm_plot2)
  1223. emm_plot2$type <- factor(emm_plot2$type, levels=c("CR", "WR", "UN"))
  1224. ggplot(emm_plot2,aes(x = vector, y = emmean, color = type)) +
  1225. geom_line(aes(group = type), linewidth = 1) +
  1226. geom_point(size = 2) +
  1227. geom_errorbar(aes(ymin = asymp.LCL, ymax = asymp.UCL),width = 0.1) +
  1228. facet_wrap(~ mood,ncol = 2,labeller = as_labeller(c("positive" = "Positive mood","negative" = "Negative mood"))) +
  1229. scale_color_manual(name = "",values = c("#ffc000", "#ff2f92", "#404A80"),labels = c("Unrelated (UR) pairs","Weakly related (WR) pairs","Closely related (CR) pairs")) +
  1230. #scale_x_continuous(name = "Block progression",breaks = c(1,2,3,4,5,6,7,8),guide = "prism_offset") +
  1231. scale_y_reverse(name = "Predicted mean N400 amplitude (µV)",breaks = c(1,0, -1, -2, -3, -4),limits = c(1, -4),guide = "prism_offset") +
  1232. theme_classic2() +
  1233. scale_shape_prism() +
  1234. theme(text = element_text(size = 20, family = "Helvetica", color = "black"),
  1235. axis.text = element_text(size = 18),
  1236. axis.line = element_line(size = 0.5),
  1237. strip.text = element_text(size = 20),
  1238. strip.background = element_blank(),
  1239. legend.position = "bottom",
  1240. legend.text = element_text(size = 20))
  1241. # by type
  1242. ggplot(emm_plot2,aes(x = vector, y = emmean, color = mood)) +
  1243. geom_line(aes(group = mood), linewidth = 1) +
  1244. geom_point(size = 2) +
  1245. geom_errorbar(aes(ymin = asymp.LCL, ymax = asymp.UCL),width = 0.1) +
  1246. facet_wrap(.~type, ncol =3, labeller = as_labeller(c("UN" = "Unrelated \npairs", "WR" = "Weakly \nrelated pairs", "CR" = "Closely \nrelated pairs"))) +
  1247. scale_color_manual(name = "",values = c("firebrick2","darkblue"),labels = c("Positive mood","Negative mood")) +
  1248. scale_x_continuous(name = "Semantic similarity",breaks = c(0.0, 0.2, 0.4,0.6),guide = "prism_offset") +
  1249. scale_y_reverse(name = "Predicted mean N400 amplitude (µV)",breaks = c(1, 0, -1, -2, -3),limits = c(1, -3),guide = "prism_offset") +
  1250. theme_classic2() +
  1251. scale_shape_prism() +
  1252. theme(text = element_text(size = 20, family = "Helvetica", color = "black"),
  1253. axis.text = element_text(size = 18),
  1254. axis.line = element_line(size = 0.5),
  1255. strip.text = element_text(size = 20),
  1256. strip.background = element_blank(),
  1257. legend.position = "bottom",
  1258. legend.text = element_text(size = 20))
  1259. ggsave(filename ="L2_predicted_similarity.png", plot = last_plot(), width = 20,height = 14, units = "cm", bg = "white", path="/Users/m/Desktop/MoBSeR/R /plots")
  1260. #### _________________ correlations _________________ ####
  1261. df7 <- df %>% subset(chan %in% FC_C_CP_P_3 & time >= 300 & time <=500) %>% droplevels() %>%
  1262. dplyr::group_by(mood, type, language, word, relatedness, vector) %>%
  1263. dplyr::summarise(mean_amp = mean(amp))
  1264. df7$type <- factor(df7$type, levels=c("UN", "WR", "CR"))
  1265. df7$mood <- factor(df7$mood, levels=c("positive", "negative"))
  1266. df7$language <- factor(df7$language, levels=c("Polish", "English"))
  1267. df7Pl <- df7[df7$language=="Polish",]
  1268. df7En <- df7[df7$language=="English",]
  1269. df7PlPos <- df7Pl[df7Pl$mood=="positive",]
  1270. df7PlNeg <- df7Pl[df7Pl$mood=="negative",]
  1271. df7EnPos <- df7En[df7En$mood=="positive",]
  1272. df7EnNeg <- df7En[df7En$mood=="negative",]
  1273. cor.test(df7$mean_amp, df7$relatedness,method = "pearson")
  1274. cor.test(df7PlPos$mean_amp, df7PlPos$relatedness,method = "pearson")
  1275. cor.test(df7PlNeg$mean_amp, df7PlNeg$relatedness,method = "pearson")
  1276. cor.test(df7EnPos$mean_amp, df7EnPos$relatedness,method = "pearson")
  1277. cor.test(df7EnNeg$mean_amp, df7EnNeg$relatedness,method = "pearson")
  1278. cor.test(df7$mean_amp, df7$vector,method = "pearson")
  1279. cor.test(df7PlPos$mean_amp, df7PlPos$vector,method = "pearson")
  1280. cor.test(df7PlNeg$mean_amp, df7PlNeg$vector,method = "pearson")
  1281. cor.test(df7EnPos$mean_amp, df7EnPos$vector,method = "pearson")
  1282. cor.test(df7EnNeg$mean_amp, df7EnNeg$vector,method = "pearson")
  1283. cor.test(df7$vector, df7$relatedness,method = "pearson")
  1284. # N400 x semantic relatedness ratings
  1285. ggplot(df7, aes(x = mean_amp, y = relatedness)) +
  1286. geom_point(aes(color = type)) + # color by type for points only
  1287. facet_grid(language~mood, labeller = as_labeller(c("positive" = "Positive mood", "negative" = "Negative mood", "Polish" = "Polish (L1)", "English" = "English (L2)"))) +
  1288. geom_smooth(method = "lm", se = TRUE, color = "black") + # overall regression line
  1289. scale_color_manual(values = c("#ffc000","#ff2f92","#404A80"), labels = c("UN" = "Unrelated pairs", "WR" = "Weakly related pairs", "CR" = "Closely related pairs"), name = "") +
  1290. geom_rug(aes(color = type)) + # keep rug lines color-coded too
  1291. scale_shape_prism() +
  1292. #theme_prism() +
  1293. scale_y_continuous(limits = c(1,7), breaks = c(1, 2, 3, 4, 5, 6, 7), guide = "prism_offset") +
  1294. scale_x_continuous(limits = c(-5,4), breaks = c(-7,-6,-5, -4, -3, -2, -1, 0, 1, 2,3), guide = "prism_offset") +
  1295. #scale_y_reverse(limits = c(7,0), breaks = c(1, 2,3,4,5,6,7), guide = "prism_offset") +
  1296. xlab(expression(paste("Mean N400 amplitude (", mu, "V)"))) +
  1297. ylab("Mean semantic relatedness rating") +
  1298. theme_classic2() +
  1299. theme(legend.position="bottom") +
  1300. theme(plot.title = element_text(hjust = 0.5))+
  1301. theme(panel.background = element_rect(fill = "white"),
  1302. strip.background = element_rect(fill = "white",color="black",size=1),
  1303. legend.key = element_rect(fill = "white"),
  1304. axis.line.x = element_line(colour = "black", size = .5),
  1305. axis.line.y = element_line(colour = "black", size = .5),
  1306. axis.title = element_text(size = 15, color= "black"),
  1307. strip.text = element_text(size = 15, color= "black"),
  1308. legend.text = element_text(size = 15, color= "black"),
  1309. legend.title = element_text(size = 15, color= "black"),
  1310. strip.text.x.top = element_text(size = 15, color= "black"),
  1311. axis.text = element_text(size = 15, color= "black"))
  1312. ggsave(filename ="Correlation_plot_relatedness.png", plot = last_plot(), width = 20,height = 15, units = "cm", bg = "white", path="/Users/m/Desktop/MoBSeR/R /plots")
  1313. # ggplot(df7, aes(x = mean_amp, y = relatedness)) +
  1314. # geom_point(aes(color = type)) + # color by type for points only
  1315. # #facet_grid(language~mood, labeller = as_labeller(c("positive" = "Positive mood", "negative" = "Negative mood", "Polish" = "Polish (L1)", "English" = "English (L2)"))) +
  1316. # geom_smooth(method = "lm", se = TRUE, color = "black") + # overall regression line
  1317. # scale_color_manual(values = c("#ffc000","#ff2f92","#404A80"), labels = c("UN" = "Unrelated pairs", "WR" = "Weakly related pairs", "CR" = "Closely related pairs"), name = "") +
  1318. # geom_rug(aes(color = type)) + # keep rug lines color-coded too
  1319. # scale_shape_prism() +
  1320. # #theme_prism() +
  1321. # #scale_y_continuous(limits = c(1,7), breaks = c(1, 2, 3, 4, 5, 6, 7), guide = "prism_offset") +
  1322. # #scale_x_continuous(limits = c(-5,2), breaks = c(-5, -4, -3, -2, -1, 0, 1, 2), guide = "prism_offset") +
  1323. # #scale_y_reverse(limits = c(2,-5), breaks = c(-5, -4, -3, -2, -1, 0, 1, 2), guide = "prism_offset") +
  1324. # xlab(expression(paste("Mean N400 amplitudes (", mu, "V)"))) +
  1325. # ylab("Mean semantic relatedness relatednesss") +
  1326. # theme_classic2() +
  1327. # theme(legend.position="bottom") +
  1328. # theme(plot.title = element_text(hjust = 0.5))+
  1329. # theme(panel.background = element_rect(fill = "white"),
  1330. # strip.background = element_rect(fill = "white",color="black",size=1),
  1331. # legend.key = element_rect(fill = "white"),
  1332. # axis.line.x = element_line(colour = "black", size = .5),
  1333. # axis.line.y = element_line(colour = "black", size = .5),
  1334. # axis.title = element_text(size = 15, color= "black"),
  1335. # strip.text = element_text(size = 15, color= "black"),
  1336. # legend.text = element_text(size = 15, color= "black"),
  1337. # legend.title = element_text(size = 15, color= "black"),
  1338. # strip.text.x.top = element_text(size = 15, color= "black"),
  1339. # axis.text = element_text(size = 15, color= "black"))
  1340. #
  1341. # ggsave(filename ="Correlation_plot_relatedness_all.png", plot = last_plot(), width = 20,height = 15, units = "cm", bg = "white", path="/Users/m/Desktop/MoBSeR/R /plots")
  1342. # N400 x vectors
  1343. ggplot(df7, aes(x = mean_amp, y = vector)) +
  1344. geom_point(aes(color = type)) + # color by type for points only
  1345. facet_grid(language~mood, labeller = as_labeller(c("positive" = "Positive mood", "negative" = "Negative mood", "Polish" = "Polish (L1)", "English" = "English (L2)"))) +
  1346. geom_smooth(method = "lm", se = TRUE, color = "black") + # overall regression line
  1347. scale_color_manual(values = c("#ffc000","#ff2f92","#404A80"), labels = c("UN" = "Unrelated pairs", "WR" = "Weakly related pairs", "CR" = "Closely related pairs"), name = "") +
  1348. geom_rug(aes(color = type)) + # keep rug lines color-coded too
  1349. scale_shape_prism() +
  1350. scale_y_continuous(limits = c(-0.1,0.8), breaks = c(0, 0.2, 0.4, 0.6, 0.8), guide = "prism_offset") +
  1351. scale_x_continuous(limits = c(-5,4), breaks = c(-7,-6,-5, -4, -3, -2, -1, 0, 1, 2,3), guide = "prism_offset") +
  1352. xlab(expression(paste("Mean N400 amplitude (", mu, "V)"))) +
  1353. ylab("Mean semantic similarity") +
  1354. theme_classic2() +
  1355. theme(legend.position="bottom") +
  1356. theme(plot.title = element_text(hjust = 0.5))+
  1357. theme(panel.background = element_rect(fill = "white"),
  1358. strip.background = element_rect(fill = "white",color="black",size=1),
  1359. legend.key = element_rect(fill = "white"),
  1360. axis.line.x = element_line(colour = "black", size = .5),
  1361. axis.line.y = element_line(colour = "black", size = .5),
  1362. axis.title = element_text(size = 15, color= "black"),
  1363. strip.text = element_text(size = 15, color= "black"),
  1364. legend.text = element_text(size = 15, color= "black"),
  1365. legend.title = element_text(size = 15, color= "black"),
  1366. strip.text.x.top = element_text(size = 15, color= "black"),
  1367. axis.text = element_text(size = 15, color= "black"))
  1368. ggsave(filename ="Correlation_plot_vector.png", plot = last_plot(), width = 20,height = 15, units = "cm", bg = "white", path="/Users/m/Desktop/MoBSeR/R /plots")
  1369. #
  1370. # ggplot(df7, aes(x = mean_amp, y = vector)) +
  1371. # geom_point(aes(color = type)) + # color by type for points only
  1372. # #facet_grid(language~mood, labeller = as_labeller(c("positive" = "Positive mood", "negative" = "Negative mood", "Polish" = "Polish (L1)", "English" = "English (L2)"))) +
  1373. # geom_smooth(method = "lm", se = TRUE, color = "black") + # overall regression line
  1374. # scale_color_manual(values = c("#ffc000","#ff2f92","#404A80"), labels = c("UN" = "Unrelated pairs", "WR" = "Weakly related pairs", "CR" = "Closely related pairs"), name = "") +
  1375. # geom_rug(aes(color = type)) + # keep rug lines color-coded too
  1376. # scale_shape_prism() +
  1377. # #theme_prism() +
  1378. # #scale_y_continuous(limits = c(1,7), breaks = c(1, 2, 3, 4, 5, 6, 7), guide = "prism_offset") +
  1379. # #scale_x_continuous(limits = c(-5,2), breaks = c(-5, -4, -3, -2, -1, 0, 1, 2), guide = "prism_offset") +
  1380. # #scale_y_reverse(limits = c(2,-5), breaks = c(-5, -4, -3, -2, -1, 0, 1, 2), guide = "prism_offset") +
  1381. # xlab(expression(paste("Mean ERP amplitudes (", mu, "V)"))) +
  1382. # ylab("Mean semantic vector") +
  1383. # theme_classic2() +
  1384. # theme(legend.position="bottom") +
  1385. # theme(plot.title = element_text(hjust = 0.5))+
  1386. # theme(panel.background = element_rect(fill = "white"),
  1387. # strip.background = element_rect(fill = "white",color="black",size=1),
  1388. # legend.key = element_rect(fill = "white"),
  1389. # axis.line.x = element_line(colour = "black", size = .5),
  1390. # axis.line.y = element_line(colour = "black", size = .5),
  1391. # axis.title = element_text(size = 15, color= "black"),
  1392. # strip.text = element_text(size = 15, color= "black"),
  1393. # legend.text = element_text(size = 15, color= "black"),
  1394. # legend.title = element_text(size = 15, color= "black"),
  1395. # strip.text.x.top = element_text(size = 15, color= "black"),
  1396. # axis.text = element_text(size = 15, color= "black"))
  1397. #
  1398. # ggsave(filename ="Correlation_plot_vector_all.png", plot = last_plot(), width = 20,height = 15, units = "cm", bg = "white", path="/Users/m/Desktop/MoBSeR/R /plots")
  1399. # semantic relatedness ratings - distribution
  1400. ggplot(df7, aes(x = language, y = relatedness, colour = type, fill = type)) +
  1401. facet_wrap(~type, labeller = as_labeller(c("UN" = "Unrelated pairs", "WR" = "Weakly related pairs", "CR" = "Closely related pairs"))) +
  1402. # ggdist::stat_halfeye(aes(colour = type), width = 0.8, .width = 0, alpha = 0.75, justification = -0.3, point_colour = NA) +
  1403. geom_point(aes(colour = type), size = 1.0, alpha = 0.2, position = position_jitter(seed = 1, width = 0.1)) +
  1404. geom_boxplot(aes(colour = type), width = .25, alpha = 0.25, outlier.shape = NA) +
  1405. scale_shape_prism() +
  1406. #theme_prism() +
  1407. scale_y_continuous(limits = c(1,7), breaks = c(1, 2, 3, 4, 5, 6, 7), guide = "prism_offset") +
  1408. #coord_cartesian(ylim = c(1, 7), clip = "off") +
  1409. scale_x_discrete(labels = c("Polish" = "Polish (L1)", "English" = "English (L2)"), guide = "prism_bracket") +
  1410. labs(y = "Mean semantic relatedness rating", x = "Language of operation") +
  1411. scale_fill_manual(values = c("#ffc000","#ff2f92","#404A80")) +
  1412. scale_colour_manual(values = c("#ffc000","#ff2f92","#404A80")) +
  1413. #scale_y_continuous(breaks = c(1, 2, 3, 4, 5, 6, 7))+
  1414. theme_classic() +
  1415. theme(legend.position="none") +
  1416. theme(panel.background = element_rect(fill = "white"),
  1417. strip.background = element_rect(fill = "white",color="black",size=1),
  1418. legend.key = element_rect(fill = "white"),
  1419. axis.line.x = element_line(colour = "black", size = .5),
  1420. axis.line.y = element_line(colour = "black", size = .5),
  1421. axis.title = element_text(size = 15, color= "black"),
  1422. strip.text = element_text(size = 15, color= "black"),
  1423. legend.text = element_text(size = 15, color= "black"),
  1424. legend.title = element_text(size = 15, color= "black"),
  1425. strip.text.x.top = element_text(size = 15, color= "black"),
  1426. axis.text = element_text(size = 15, color= "black"))
  1427. ggsave(filename ="Mean semantic relatedness rating.png", plot = last_plot(), width = 21,height = 9, units = "cm", bg = "white", path="/Users/m/Desktop/MoBSeR/R /plots")
  1428. # vectors - distribution
  1429. ggplot(df7, aes(x = language, y = vector, colour = type, fill = type)) +
  1430. facet_wrap(~type, labeller = as_labeller(c("UN" = "Unrelated pairs", "WR" = "Weakly related pairs", "CR" = "Closely related pairs"))) +
  1431. # ggdist::stat_halfeye(aes(colour = type), width = 0.8, .width = 0, alpha = 0.75, justification = -0.3, point_colour = NA) +
  1432. geom_point(aes(colour = type), size = 1.0, alpha = 0.2, position = position_jitter(seed = 1, width = 0.1)) +
  1433. geom_boxplot(aes(colour = type), width = .25, alpha = 0.25, outlier.shape = NA) +
  1434. scale_shape_prism() +
  1435. #theme_prism() +
  1436. scale_y_continuous(limits = c(-0.1,0.8), breaks = c(0, 0.2, 0.4, 0.6, 0.8), guide = "prism_offset") +
  1437. #coord_cartesian(ylim = c(1, 7), clip = "off") +
  1438. scale_x_discrete(labels = c("Polish" = "Polish (L1)", "English" = "English (L2)"), guide = "prism_bracket") +
  1439. labs(y = "Mean semantic similarity", x = "Language of operation") +
  1440. scale_fill_manual(values = c("#ffc000","#ff2f92","#404A80")) +
  1441. scale_colour_manual(values = c("#ffc000","#ff2f92","#404A80")) +
  1442. #scale_y_continuous(breaks = c(1, 2, 3, 4, 5, 6, 7))+
  1443. theme_classic() +
  1444. theme(legend.position="none") +
  1445. theme(panel.background = element_rect(fill = "white"),
  1446. strip.background = element_rect(fill = "white",color="black",size=1),
  1447. legend.key = element_rect(fill = "white"),
  1448. axis.line.x = element_line(colour = "black", size = .5),
  1449. axis.line.y = element_line(colour = "black", size = .5),
  1450. axis.title = element_text(size = 15, color= "black"),
  1451. strip.text = element_text(size = 15, color= "black"),
  1452. legend.text = element_text(size = 15, color= "black"),
  1453. legend.title = element_text(size = 15, color= "black"),
  1454. strip.text.x.top = element_text(size = 15, color= "black"),
  1455. axis.text = element_text(size = 15, color= "black"))
  1456. ggsave(filename ="Mean semantic vector.png", plot = last_plot(), width = 21,height = 9, units = "cm", bg = "white", path="/Users/m/Desktop/MoBSeR/R /plots")

MoBSeR_ERP_R1.R, no license · at the source

Overview

  1. Laboratory for Social Neuroscience, Faculty of English, Adam Mickiewicz University, Poznań, Poland
  2. Cognitive Neuroscience Center, Adam Mickiewicz University, Poznań, Poland
Journal: PloS one, volume 21, issue 8, article e0353990
Dates: received 21 February 2026; accepted 1 July 2026; published online 12 August 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1371/journal.pone.0353990 · PMID 42585154 · PMCID PMC13465833 · OpenAlex W7106226611
Open access: gold, a free copy (OpenAlex)
Preprint: osf.io/nq4vz
Status: code verified
Categories: EEG (modality), human (organism), cognitive (subfield)
Methods: Spectral & time-frequency, Statistics, Smoothing, state filtering, decompositions, Preprocessing, Evoked potentials, Connectivity, Physiology & signal measures
MeSH: Affect*, Language*, Multilingualism*, Adult, Electroencephalography, Evoked Potentials, Female, Humans, Memory, Semantics, Young Adult (* major topic)
Topic: Neurobiology of Language and Bilingualism (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Funding: Uniwersytet im. Adama Mickiewicza w Poznaniu (140/04/POB5/00, 140/04/POB5/0010)
Citations: not cited yet (Europe PMC); 83 references in the paper

Abstract

Prior research has shown that, compared to a negative mood, a positive mood facilitates spreading activation within semantic memory in the first language. Yet, little is still known about neurocognitive mechanisms underlying mood effects on semantic processes in the foreign language. Here, we show that a positive mood enhances accessibility of unrelated concepts within semantic memory in the first but not the foreign language. Highly proficient Polish–English bilingual women were induced into positive and negative mood states with animated films and made semantic relatedness judgements about closely related, weakly related, and unrelated prime–target pairs in their first and foreign languages. Mean N400 responses were analysed as neural markers of spreading activation within semantic memory. Our results revealed reduced N400 responses to unrelated word pairs under a positive compared to a negative mood only in the first language. Critically, no mood-driven effects emerged for the foreign language. These findings provide novel evidence that a positive mood broadens spreading activation within semantic memory only in the first language context, making distant concepts more accessible. Critically, they also highlight mood-independent responding when bilinguals operate in their foreign language.

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

OSF nq4vz

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Languages: R (6), MATLAB (3)
Size: 25 files, 9 scripts
Software Heritage: not checked
Found in: “Data Availability”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: afex (6 files), emmeans (6 files), ggplot2 (6 files), lme4 (6 files), lmerTest (6 files), psych (6 files), tidyverse (6 files), car (5 files), ggpubr (5 files), multcomp (5 files), patchwork (5 files), reshape2 (5 files), survival (5 files), EEGLAB (2 files), ERPLAB (1 file), ICLabel (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
  • 27 September 2026: the link answers (HTTP 200)
9 files

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;
  • 9 scripts, each with its path and the digest of its content;
  • 7 matches between paragraphs of the paper and lines of the code (method lexical-v1);
  • neither the text of the paper nor the code itself.

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

Data

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

Data Availability

Pre-processed data, experimental stimuli, model specifications, as well as R and Matlab scripts are publicly available on the Open Science Framework at https://doi.org/10.17605/OSF.IO/NQ4VZ.

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 3, 28 September 2026

  • Funding: added Uniwersytet im. Adama Mickiewicza w Poznaniu: 140/04/POB5/00, 140/04/POB5/0010

Version 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 2 authors, 11 MeSH terms, 72 references.

Cite

This paper

Żukowski, P., & Naranowicz, M. (2026). Positive mood enhances accessibility of unrelated concepts in the first language but not in the foreign language. PloS one, 21(8), e0353990. https://doi.org/10.1371/journal.pone.0353990

BibTeX

@article{zukowski2026positive,
author = {Żukowski, Piotr and Naranowicz, Marcin},
title = {{Positive mood enhances accessibility of unrelated concepts in the first language but not in the foreign language}},
journal = {PloS one},
year = {2026},
month = aug,
volume = {21},
number = {8},
pages = {e0353990},
publisher = {PLOS},
issn = {1932-6203},
doi = {10.1371/journal.pone.0353990},
url = {https://doi.org/10.1371/journal.pone.0353990},
pmid = {42585154},
pmcid = {PMC13465833}
}

RIS

TY - JOUR
AU - Żukowski, Piotr
AU - Naranowicz, Marcin
TI - Positive mood enhances accessibility of unrelated concepts in the first language but not in the foreign language
T2 - PloS one
J2 - PLoS One
PY - 2026
DA - 2026/08/12
VL - 21
IS - 8
SP - e0353990
SN - 1932-6203
PB - PLOS
DO - 10.1371/journal.pone.0353990
UR - https://doi.org/10.1371/journal.pone.0353990
LA - en
ER -

CSL-JSON

{
"id": "10.1371/journal.pone.0353990",
"type": "article-journal",
"title": "Positive mood enhances accessibility of unrelated concepts in the first language but not in the foreign language",
"container-title": "PloS one",
"author": [
{
"family": "Żukowski",
"given": "Piotr"
},
{
"family": "Naranowicz",
"given": "Marcin"
}
],
"container-title-short": "PLoS One",
"volume": "21",
"issue": "8",
"page": "e0353990",
"DOI": "10.1371/journal.pone.0353990",
"PMID": "42585154",
"PMCID": "PMC13465833",
"ISSN": "1932-6203",
"publisher": "PLOS",
"URL": "https://doi.org/10.1371/journal.pone.0353990",
"language": "en",
"issued": {
"date-parts": [
[
2026,
8,
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.1016/j.neuroimage.2026.122115 [code]
Midfrontal theta power relates to response speeding following frustrative nonreward.
Journal: NeuroImage
In common: ICLabel, psych, car, 9 other tools, EEG, cognitive, 3 references
[2] 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 biology
In common: afex, psych, car, 6 other tools, EEG, 3 references
[3] 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: ERPLAB, ICLabel, psych, 5 other tools, 2 references
[4] doi:10.3390/brainsci16080809 [code]
The Influence of Shared Attention and Friendship on Emotional Processing: A Behavioral and EEG Hyperscanning Study.
Journal: Brain sciences
In common: afex, ICLabel, EEGLAB, 4 other tools, EEG, cognitive, 3 references
[5] doi:10.1093/cercor/bhag077 [code]
The longitudinal development of intrinsic timescales in infancy and their relation to alpha brain rhythm.
Journal: Cerebral cortex (New York, N.Y. : 1991)
In common: multcomp, psych, EEGLAB, 6 other tools, EEG, 2 references
[6] doi:10.1016/j.nicl.2026.104012 [code]
Structural-functional multilayer brain network properties and outcome of combined repetitive transcranial magnetic stimulation and psychotherapy for obsessive-compulsive disorder.
Journal: NeuroImage. Clinical
In common: afex, survival, psych, 7 other tools
[7] doi:10.1093/bioinformatics/btag592 [code]
Network-based stratification of allele-specific expression reveals patient subgroups in Huntington's disease.
Journal: Bioinformatics (Oxford, England)
In common: multcomp, survival, car, 7 other tools
[8] doi:10.1126/sciadv.aec9291 [code]
Computational mechanisms of perception in autism revealed using games inspired by rodent operant tasks.
Journal: Science advances
In common: afex, psych, car, 7 other tools, cognitive
[9] doi:10.1371/journal.pbio.3003767 [code]
Ultrasound neuromodulation reveals distinct roles of the dorsal anterior cingulate cortex and anterior insula in learning.
Journal: PLoS biology
In common: afex, psych, car, 6 other tools, cognitive, 1 reference
[10] doi:10.1162/imag.a.105 [code]
Right posterior theta reflects human parahippocampal phase resetting by salient cues during goal-directed navigation
Journal: n/a
In common: psych, car, EEGLAB, 5 other tools, EEG, cognitive, 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.

Request its removal

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

Discussion, reproductions, activity

Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.

Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.

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