OSCR

A neurocognitive interactive activation model of semantic priming in lexical decisions.

Code ↔ Paper

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

Paper

Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

R Markdown · 778 lines · 25 KB · no license

  1. ---
  2. title: "Analyses"
  3. author: "LeoSokolovic"
  4. date: "`r Sys.Date()`"
  5. output: html_document
  6. editor_options:
  7. chunk_output_type: console
  8. ---
  9. # Load Libraries
  10. ```{r}
  11. rm(list = ls())
  12. library(correlation)
  13. library(reshape2)
  14. library(readr)
  15. library(ggplot2)
  16. library(patchwork)
  17. library(lme4)
  18. library(lmerTest)
  19. library(emmeans)
  20. library(performance)
  21. library(dplyr)
  22. library(xtable)
  23. library(gvlma)
  24. my_colors <- c("#D95319", "#EDB120", "#0072BD", "#4DBEEE")
  25. ```
  26. # Read in the Data
  27. ```{r}
  28. # dataW <- read_csv2("dataW.csv")
  29. #
  30. #
  31. # data <- data.frame()
  32. #
  33. # for(p in 6:68){
  34. # sd <-dataW[c(1:5,p)]
  35. # sd$ID <- rep(p-5,200)
  36. # colnames(sd)[6] <- "RT"
  37. # data <- rbind(data,sd)
  38. # }
  39. # data$DirectAssociates <- NA
  40. # data$DirectAssociates[grep("HA",data$Condition)] <- "Strong"
  41. # data$DirectAssociates[grep("NA",data$Condition)] <- "No"
  42. # data$IndirectAssociates <- NA
  43. # data$IndirectAssociates[grep("H2",data$Condition)] <- "Many"
  44. # data$IndirectAssociates[grep("N2",data$Condition)] <- "No"
  45. # data$Experiment <- ifelse(data$ID<33,1,2)
  46. # data$ID <- factor(data$ID)
  47. # data$DirectAssociates <- factor(data$DirectAssociates, levels=c("Strong","No"))
  48. # data$IndirectAssociates <- factor(data$IndirectAssociates, levels = c("Many","No"))
  49. # data$SOA <- stringr::str_to_title(data$SOA)
  50. # data$SOA <- factor(data$SOA, levels = c("Long", "Short"))
  51. # data$Experiment <- factor(data$Experiment)
  52. # save(data,file = 'observed_data.RData')
  53. ```
  54. ```{r}
  55. # Load observed data
  56. load('observed_data.RData')
  57. # Load SAROM simulated data
  58. load('model_simulated_data.RData')
  59. # Load combined data
  60. load('combined_data.RData')
  61. # Load SAROM parameter estimates
  62. load('parameters_long_format.RData')
  63. levels(comb_data$IndirectAssociates) <- c("Many","Few")
  64. levels(data$IndirectAssociates) <- c("Many","Few")
  65. levels(dataM$IndirectAssociates) <- c("Many","Few")
  66. ```
  67. ## Plots
  68. ### Response Times
  69. ```{r echo=FALSE}
  70. meanRT <- data %>% group_by(Experiment,SOA, DirectAssociates, IndirectAssociates) %>% summarise(meanRT = mean(RT,na.rm = T), se = sd(RT,na.rm = T))
  71. meanRT
  72. ```
  73. ### Number of Errors
  74. ```{r echo=FALSE}
  75. errors <- data %>% group_by(Experiment,ID,SOA, DirectAssociates, IndirectAssociates) %>% summarise(nErrors = sum(is.na(RT))/length(RT))
  76. mean_errors <- errors %>% group_by(Experiment, SOA, DirectAssociates, IndirectAssociates) %>% summarise(meanErrors = mean(nErrors), se = sd(nErrors))
  77. mean_errors
  78. ```
  79. ```{r echo=FALSE}
  80. errors <- data %>% group_by(Experiment,ID,SOA, DirectAssociates, IndirectAssociates) %>% summarise(nErrors = sum(is.na(RT))/length(RT))
  81. mean_errors <- errors %>% group_by(Experiment, SOA, DirectAssociates, IndirectAssociates) %>% summarise(meanErrors = mean(nErrors), se = sd(nErrors)/sqrt(length(nErrors)))
  82. mean_errors
  83. ```
  84. # Model Simulated Data
  85. ```{r}
  86. # dataM <- read_delim("simdata.csv",
  87. # delim = ";", escape_double = FALSE, locale = locale(decimal_mark = ",",
  88. # grouping_mark = "."),na = "NaN", trim_ws = TRUE)
  89. # dataM$PairNumber <- 1:200
  90. # dataM$PairNumber <- factor(dataM$PairNumber)
  91. # dataM$Prime <- NULL
  92. # dataM$Target <- NULL
  93. # dataM$DirectAssociates <- NA
  94. # dataM$DirectAssociates[grep("HA",dataM$Condition)] <- "Strong"
  95. # dataM$DirectAssociates[grep("NA",dataM$Condition)] <- "No"
  96. # dataM$IndirectAssociates <- NA
  97. # dataM$IndirectAssociates[grep("H2",dataM$Condition)] <- "Many"
  98. # dataM$IndirectAssociates[grep("N2",dataM$Condition)] <- "No"
  99. #
  100. #
  101. # dataM$DirectAssociates <- factor(dataM$DirectAssociates, levels=c("Strong","No"))
  102. # dataM$IndirectAssociates <- factor(dataM$IndirectAssociates, levels = c("Many","No"))
  103. # dataM$SOA <- stringr::str_to_title(dataM$SOA)
  104. # dataM$SOA <- factor(dataM$SOA, levels = c("Long", "Short"))
  105. # # dataM$Simulation <- NA
  106. # # dataM$Simulation <- rep(c(1:100),each = 200)
  107. # # dataM$Simulation <- factor(dataM$Simulation)
  108. #
  109. # dataM <- melt(dataM,id.vars = c("PairNumber","Condition","SOA","DirectAssociates","IndirectAssociates"),variable.name = "ID",value.name = "RT")
  110. # dataM$Experiment <- ifelse(as.numeric(dataM$ID)<33,1,2)
  111. # dataM$ID <- factor(dataM$ID)
  112. # dataM$Experiment <- factor(dataM$Experiment)
  113. # save(dataM, file = 'model_simulated_data_new.RData')
  114. ```
  115. ### Simulated response Times
  116. ```{r echo=FALSE}
  117. meanRTSim <- dataM %>% group_by(Experiment, SOA, DirectAssociates, IndirectAssociates) %>% summarise(meanRT = mean(RT,na.rm = T), sd = sd(RT,na.rm = T))
  118. meanRTSim
  119. ```
  120. ```{r echo=FALSE}
  121. meanRTSim <- dataM %>% group_by(Experiment, SOA, DirectAssociates, IndirectAssociates) %>% summarise(meanRT = mean(RT,na.rm = T), se = sd(RT,na.rm = T)/sqrt(length(RT)))
  122. meanRTSim
  123. ```
  124. ### Simulated number of Errors
  125. ```{r echo=FALSE}
  126. errorsSim <- dataM %>% group_by(Experiment, ID,SOA, DirectAssociates, IndirectAssociates) %>% summarise(nErrors = sum(is.na(RT)/length(RT)))
  127. mean_errorsSim <- errorsSim %>% group_by(Experiment, SOA, DirectAssociates, IndirectAssociates) %>% summarise(meanErrors = mean(nErrors), sd = sd(nErrors))
  128. mean_errorsSim
  129. ```
  130. ```{r echo=FALSE}
  131. errorsSim <- dataM %>% group_by(Experiment, ID,SOA, DirectAssociates, IndirectAssociates) %>% summarise(nErrors = sum(is.na(RT)/length(RT)))
  132. mean_errorsSim <- errorsSim %>% group_by(Experiment, SOA, DirectAssociates, IndirectAssociates) %>% summarise(meanErrors = mean(nErrors), se = sd(nErrors)/sqrt(length(nErrors)))
  133. mean_errorsSim
  134. ```
  135. ```{r}
  136. # data$Source <- "Observed"
  137. # data$Prime <- NULL
  138. # data$Target <- NULL
  139. # dataM$Source <- "Simulated"
  140. #
  141. # comb_data <- rbind(data,dataM)
  142. # comb_data$Source <- factor(comb_data$Source, levels = c("Observed","Simulated"))
  143. # comb_data$Error <- as.numeric(is.na(comb_data$RT))
  144. #
  145. # save(comb_data, file = 'combined_data_new.RData')
  146. ```
  147. ## Compare directly
  148. ### Response Times
  149. Empirical response times
  150. ```{r echo=FALSE}
  151. meanRT <- data %>% group_by(Experiment, SOA, DirectAssociates, IndirectAssociates) %>% summarise(
  152. meanRT = mean(RT,na.rm = T),
  153. se = sd(RT,na.rm = T)/sqrt(length(RT)))
  154. meanRT
  155. ```
  156. Simulated response times
  157. ```{r echo=FALSE}
  158. meanRTSim <- dataM %>% group_by(Experiment, SOA, DirectAssociates, IndirectAssociates) %>% summarise(
  159. meanRT = mean(RT,na.rm = T),
  160. se = sd(RT,na.rm = T)/sqrt(length(RT)))
  161. meanRTSim
  162. ```
  163. ```{r}
  164. meanRT$Source <- "Observed"
  165. meanRTSim$Source <- "Simulated"
  166. mean_errors$Source <- "Observed"
  167. mean_errorsSim$Source <- "Simulated"
  168. dataPlotRT <- rbind(meanRT, meanRTSim)
  169. dataPlotRT$Source <- factor(dataPlotRT$Source)
  170. dataPlotErrors <- rbind(mean_errors,mean_errorsSim)
  171. dataPlotErrors$Source <- factor(dataPlotErrors$Source)
  172. ```
  173. ```{r}
  174. RTplot <- ggplot(data = dataPlotRT,mapping = aes(x = Source,y = meanRT, ymin = meanRT-1.96*se, ymax = meanRT+1.96*se, fill = DirectAssociates:IndirectAssociates)) +
  175. scale_fill_manual(values = my_colors) + facet_grid(SOA~Experiment, labeller = label_both) +
  176. geom_bar(stat = "identity", position = position_dodge(.5), width = .5) +
  177. geom_errorbar(stat = "identity", position = position_dodge(.5),width = .2) +
  178. xlab(NULL)+
  179. ylab("Mean response time in seconds")+
  180. coord_cartesian(ylim = c(0.5,.75))+
  181. labs(tag = "A") +
  182. theme_classic() +
  183. theme(legend.position = "none",text = element_text(size = 14),
  184. line = element_line(linewidth = 1),
  185. axis.text = element_text(size = 14),
  186. axis.title.x = element_blank())
  187. ```
  188. ### Number of Errors
  189. ```{r}
  190. errorPlot <- ggplot(data = dataPlotErrors,mapping = aes(x = Source,y = meanErrors, ymin = meanErrors-1.96*se, ymax = meanErrors+1.96*se, fill = DirectAssociates:IndirectAssociates)) +
  191. scale_fill_manual(values = my_colors) +
  192. facet_grid(SOA~Experiment, labeller = label_both) +
  193. geom_bar(stat = "identity", position = position_dodge(.5), width = .5) +
  194. geom_errorbar(stat = "identity", position = position_dodge(.5),width = .2) +
  195. ylim(c(0,.125))+
  196. xlab("Data source")+
  197. ylab("Proportion of errors")+
  198. labs(tag = "B",fill = "Direct association \nx common associates") +
  199. theme_classic() +
  200. theme(legend.position = "bottom",
  201. legend.direction = "horizontal",
  202. line = element_line(linewidth = 1),
  203. text = element_text(size = 14),
  204. axis.text = element_text(size = 14))
  205. ```
  206. ## Correlations between observed and simulated data
  207. #### Response times
  208. ```{r}
  209. mean_data <- comb_data %>% group_by(Experiment,ID,SOA, DirectAssociates, IndirectAssociates,Source) %>% summarize(mean = mean(RT,na.rm = T))
  210. mean_data <- reshape2::dcast(mean_data, Experiment+ID+SOA+DirectAssociates+IndirectAssociates~Source)
  211. mean_data %>% group_by(Experiment, SOA, DirectAssociates, IndirectAssociates) %>% summarize(cor = cor.test(Observed, Simulated, method = "spearman",exact = F)$estimate, p = round(p.adjust(cor.test(Observed, Simulated, method = "spearman",exact = F)$p.value,method = "bonferroni"),4))
  212. ```
  213. ```{r}
  214. RT_cors_plot <- ggplot(data = mean_data, mapping = aes(x = Observed, y = Simulated, color = DirectAssociates:IndirectAssociates)) + scale_color_manual(values = my_colors)+
  215. facet_grid(SOA~Experiment, labeller = label_both) + geom_point() + geom_smooth(method = lm) + theme_classic()+
  216. labs(tag = "B",
  217. x = "Observed response times in seconds",
  218. y = "Simulated response times in seconds",
  219. color = "Direct association \nx common associates") + ylim(c(.4,1)) + xlim(c(.4,1))+
  220. theme_classic() +
  221. theme(legend.position = "none", line = element_line(linewidth = 1),text = element_text(size = 12), axis.text = element_text(size = 12))
  222. ```
  223. #### Errors
  224. ```{r}
  225. mean_data <- comb_data %>% group_by(Experiment, ID,SOA, DirectAssociates, IndirectAssociates,Source) %>% summarize(mean = mean(Error,na.rm = T))
  226. mean_data <- reshape2::dcast(mean_data, Experiment + ID+SOA+DirectAssociates+IndirectAssociates~Source)
  227. mean_data %>% group_by(Experiment, SOA, DirectAssociates, IndirectAssociates) %>% summarize(cor = cor.test(Observed, Simulated, method = "spearman",exact = F)$estimate, p = round(p.adjust(cor.test(Observed, Simulated, method = "spearman",exact = F)$p.value,method = "bonferroni"),4))
  228. ```
  229. ```{r}
  230. Error_cor_plot <- ggplot(data = mean_data, mapping = aes(x = Observed, y = Simulated, color = DirectAssociates:IndirectAssociates)) + facet_grid(SOA~Experiment, labeller = label_both) +
  231. scale_color_manual(values = my_colors)+
  232. geom_point() + geom_smooth(method = lm) + theme_classic()+
  233. labs(tag = "D",color = NULL,
  234. x = "Observed error proportion",
  235. y = "Simulated error proportion") + ylim(c(0,.4)) + xlim(c(0,.4))+
  236. theme_classic() +
  237. theme(legend.position = "bottom", line = element_line(linewidth = 1),text = element_text(size = 12), axis.text = element_text(size = 12))
  238. ```
  239. #Overall correlation
  240. ```{r}
  241. mean_RT_ID <- aggregate(.~ID, data[,c("ID","RT")], function(x) c(RT = mean(x, na.rm = T), errors = 200 - length(x)))
  242. mean_RT_sim_ID <- aggregate(.~ID, dataM[,c("ID","RT")], function(x) c(RT = mean(x, na.rm = T), errors = 200 - length(x)))
  243. cors <- cor.test(mean_RT_ID[,2][,1],mean_RT_sim_ID[,2][,1])
  244. cors$estimate^2
  245. ```
  246. ```{r}
  247. cors_err <- cor.test(mean_RT_ID[,2][,2],mean_RT_sim_ID[,2][,2])
  248. cors_err$estimate
  249. ```
  250. ## Plot eCDF of simulated and observed response times
  251. ```{r}
  252. comb_data$Experiment <- factor(comb_data$Experiment, labels = c('Exp. 1', 'Exp. 2'))
  253. comb_data$SOA <- factor(comb_data$SOA, labels = c('Long SOA', 'Short SOA'))
  254. ```
  255. ```{r}
  256. eCDF_plot <- ggplot(data = comb_data, mapping = aes(x = RT, color = Source, linetype = Source, linewidth = Source))+
  257. facet_grid(SOA~Experiment) +
  258. geom_density(stat = "ecdf",na.rm = T) +
  259. xlim(0,1.5) +
  260. scale_color_manual(values = c(my_colors[1],my_colors[4]))+
  261. scale_linetype_manual(values = c(1,1)) +
  262. scale_linewidth_manual(values = c(1.5,.8))+
  263. xlab("Response time in seconds") +
  264. ylab("Empirical CDF")+
  265. labs(color = "Response times: ", linetype = "Response times: ",linewidth = "Response times: ")+
  266. theme_classic()+
  267. theme(legend.position = "bottom",
  268. line = element_line(linewidth = 1),
  269. text = element_text(size = 12),
  270. axis.text = element_text(size = 12))
  271. eCDF_plot
  272. ggsave(filename = "RT_eCDF.jpeg",device = "jpeg",dpi = 600,height = 8, width = 13, units = "cm")
  273. ```
  274. ```{r}
  275. (RTplot + RT_cors_plot) / (errorPlot + Error_cor_plot)
  276. ggsave(filename = "RT_errors_plot.jpeg",device = "jpeg",dpi = 600,height = 18, width = 25, units = "cm")
  277. ```
  278. # Model parameters
  279. ```{r}
  280. # parameters <- read_csv2('parameters.csv')
  281. # parameters$Experiment <- ifelse(parameters$ID<33,1,2)
  282. # short_pars <- parameters[c(1,2,4,6,7,8,10,11)]
  283. # long_pars <- parameters[c(1,3,5,6,7,9,10,11)]
  284. # colnames(short_pars) <- c("ID", "Kappa","Beta","Xi","NDT","Theta","Strength", "Experiment")
  285. # colnames(long_pars) <- c("ID", "Kappa","Beta","Xi","NDT","Theta","Strength","Experiment")
  286. # short_pars$Lambda <- short_pars$Kappa - short_pars$Beta
  287. # short_pars$SOA <- "Short"
  288. # long_pars$Lambda <- long_pars$Kappa - long_pars$Beta
  289. # long_pars$SOA <- "Long"
  290. # short_pars$AO_excitation <- ifelse(short_pars$Strength >.02,'strong','weak')
  291. # short_pars$AO_excitation <- factor(short_pars$AO_excitation, levels = c('weak','strong'))
  292. # long_pars$AO_excitation <- ifelse(long_pars$Strength >.02,'strong','weak')
  293. # long_pars$AO_excitation <- factor(long_pars$AO_excitation, levels = c('weak','strong'))
  294. #
  295. # parametersL <- rbind(short_pars,long_pars)
  296. # parametersL$ID <- factor(parametersL$ID)
  297. # parametersL$SOA <- factor(parametersL$SOA)
  298. # parametersL$Experiment <- factor(parametersL$Experiment)
  299. # parametersL$AO_excitation <- factor(parametersL$AO_excitation)
  300. #
  301. # save(parametersL, file = 'parameters_long_format.RData')
  302. ```
  303. ## Average parameter values
  304. ```{r}
  305. aggregate(.~Experiment:SOA, parametersL[,-1], function(x) c(mean = round(mean(x),2), sd = round(sd(x),2)))
  306. ```
  307. ## Correlations between the parameters in the short and long SOA
  308. ### Experiment 1
  309. ```{r}
  310. correlation(parametersL[parametersL$SOA == "Short" & parametersL$Experiment == "1",c(2:7,9)],method = "spearman",p_adjust = "bonferroni")
  311. ```
  312. ```{r}
  313. correlation(parametersL[parametersL$SOA == "Long" & parametersL$Experiment == "1",c(2:7,9)],method = "spearman",p_adjust = "bonferroni")
  314. ```
  315. ### Experiment 2
  316. ```{r}
  317. correlation(parametersL[parametersL$SOA == "Short" & parametersL$Experiment=="2",c(2:7,9)],method = "spearman",p_adjust = "bonferroni")
  318. ```
  319. ```{r}
  320. correlation(parametersL[parametersL$SOA == "Long" & parametersL$Experiment =="2",c(2:7, 9)],method = "spearman",p_adjust = "bonferroni")
  321. ```
  322. ## Differences between parameter values in the short and long SOA
  323. ### Kappa
  324. #### Experiment 1
  325. ```{r}
  326. wilcox.test(short_pars$Kappa[short_pars$Experiment=="1"], long_pars$Kappa[long_pars$Experiment == "1"], paired = T, conf.int = T)
  327. ```
  328. #### Experiment 2
  329. ```{r}
  330. wilcox.test(short_pars$Kappa[short_pars$Experiment=="2"], long_pars$Kappa[long_pars$Experiment == "2"], paired = T, conf.int = T)
  331. ```
  332. ### Beta
  333. #### Experiment 1
  334. ```{r}
  335. wilcox.test(short_pars$Beta[short_pars$Experiment=="1"], long_pars$Beta[long_pars$Experiment == "1"], paired = T, conf.int = T)
  336. ```
  337. #### Experiment 2
  338. ```{r}
  339. wilcox.test(short_pars$Beta[short_pars$Experiment=="2"], long_pars$Beta[long_pars$Experiment == "2"], paired = T, conf.int = T)
  340. ```
  341. ### Theta
  342. #### Experiment 1
  343. ```{r}
  344. wilcox.test(short_pars$Theta[short_pars$Experiment=="1"], long_pars$Theta[long_pars$Experiment == "1"], paired = T, conf.int = T)
  345. ```
  346. #### Experiment 2
  347. ```{r}
  348. wilcox.test(short_pars$Theta[short_pars$Experiment=="2"], long_pars$Theta[long_pars$Experiment == "2"], paired = T, conf.int = T)
  349. ```
  350. ### Lambda
  351. #### Experiment 1
  352. ```{r}
  353. wilcox.test(short_pars$Lambda[short_pars$Experiment=="1"], long_pars$Lambda[long_pars$Experiment == "1"], paired = T, conf.int = T)
  354. ```
  355. #### Experiment 2
  356. ```{r}
  357. wilcox.test(short_pars$Lambda[short_pars$Experiment=="2"], long_pars$Lambda[long_pars$Experiment == "2"], paired = T, conf.int = T)
  358. ```
  359. ## Differences between strong and weak AO excitation groups
  360. ```{r}
  361. ex1 <- subset(parametersL, Experiment == '1')
  362. ex2 <- subset(parametersL, Experiment == '2')
  363. ```
  364. ### Kappa
  365. #### Experiment 1
  366. ```{r}
  367. kappa_fit1 <- lmer(Kappa ~ SOA + AO_excitation + (1|ID), data = ex1)
  368. summary(kappa_fit1)
  369. ```
  370. #### Experiment 2
  371. ```{r}
  372. kappa_fit2 <- lmer(Kappa ~ SOA + AO_excitation + (1|ID), data = ex2)
  373. summary(kappa_fit2)
  374. ```
  375. ### Beta
  376. #### Experiment 1
  377. ```{r}
  378. beta_fit1 <- lmer(Beta ~ SOA + AO_excitation + (1|ID), data = ex1)
  379. summary(beta_fit1)
  380. ```
  381. #### Experiment 2
  382. ```{r}
  383. beta_fit2 <- lmer(Beta ~ SOA + AO_excitation + (1|ID), data = ex2)
  384. summary(beta_fit2)
  385. ```
  386. ### Theta
  387. #### Experiment 1
  388. ```{r}
  389. theta_fit1 <- lmer(Theta ~ SOA + AO_excitation + (1|ID), data = ex1)
  390. summary(theta_fit1)
  391. ```
  392. #### Experiment 2
  393. ```{r}
  394. theta_fit2 <- lmer(Theta ~ SOA + AO_excitation + (1|ID), data = ex2)
  395. summary(theta_fit2)
  396. ```
  397. ### Xi
  398. #### Experiment 1
  399. ```{r}
  400. xi_fit1 <- lmer(Xi ~ SOA + AO_excitation + (1|ID), data = ex1)
  401. summary(xi_fit1)
  402. ```
  403. #### Experiment 2
  404. ```{r}
  405. xi_fit2 <- lmer(Xi ~ SOA + AO_excitation + (1|ID), data = ex2)
  406. summary(xi_fit2)
  407. ```
  408. ### NDT
  409. #### Experiment 1
  410. ```{r}
  411. NDT_fit1 <- lmer(NDT ~ SOA + AO_excitation + (1|ID), data = ex1)
  412. summary(NDT_fit1)
  413. ```
  414. #### Experiment 2
  415. ```{r}
  416. NDT_fit2 <- lmer(NDT ~ SOA + AO_excitation + (1|ID), data = ex2)
  417. summary(NDT_fit2)
  418. ```
  419. # Model parameters, response times and errors
  420. ```{r}
  421. parametersL$AO_excitation <- NULL
  422. datap <- merge(data, parametersL, by =c("ID","SOA","Experiment"))
  423. datap$Error <- as.numeric(is.na(datap$RT))
  424. datap$Lambda <- datap$Kappa-datap$Beta
  425. datap$too_fast <- datap$RT<.2
  426. datap$too_fast[is.na(datap$too_fast)] <- F
  427. datap <- subset(datap, too_fast ==F)
  428. ```
  429. ## Criterion, Kappa, Beta
  430. ```{r}
  431. sum_data <- datap %>% group_by(Experiment, ID, SOA) %>% summarize(
  432. RT = exp(mean(log(RT), na.rm = T)),
  433. PC = 1-mean(Error),
  434. Theta = mean(Theta),
  435. Kappa = mean(Kappa),
  436. Beta = mean(Beta),
  437. Xi = mean(Xi),
  438. Strength = mean(Strength),
  439. NDT = mean(NDT))
  440. sum_data$Lambda <- sum_data$Kappa-sum_data$Beta
  441. ```
  442. ## Experiment 1
  443. ```{r}
  444. correlation(sum_data[sum_data$SOA == "Short" & sum_data$Experiment=="1",3:10],method = "spearman",p_adjust = "bonferroni")
  445. ```
  446. ```{r}
  447. correlation(sum_data[sum_data$SOA == "Long"&sum_data$Experiment=="1",3:10],method = "spearman",p_adjust = "bonferroni")
  448. ```
  449. ## Experiment 2
  450. ```{r}
  451. correlation(sum_data[sum_data$SOA == "Short" & sum_data$Experiment=="2",3:10],method = "spearman",p_adjust = "bonferroni")
  452. ```
  453. ```{r}
  454. correlation(sum_data[sum_data$SOA == "Long"&sum_data$Experiment=="2",3:10],method = "spearman",p_adjust = "bonferroni")
  455. ```
  456. ## Xi, AO and NDT
  457. ```{r}
  458. sum_data2 <- datap %>% group_by(Experiment, ID) %>% summarize(
  459. RT = exp(mean(log(RT), na.rm = T)),
  460. PC = 1-mean(Error),
  461. Xi = mean(Xi),
  462. Strength = mean(Strength),
  463. NDT = mean(NDT))
  464. ```
  465. ### Experiment 1
  466. ```{r}
  467. correlation(sum_data2[sum_data2$Experiment == "1",3:7],method = "spearman",p_adjust = "bonferroni")
  468. ```
  469. ### Experiment 2
  470. ```{r}
  471. correlation(sum_data2[sum_data2$Experiment == "2",3:7],method = "spearman",p_adjust = "bonferroni")
  472. ```
  473. ## Figure 6
  474. ```{r}
  475. load('parameters_long_format.RData')
  476. pars <- subset(parametersL, Experiment==2)
  477. ```
  478. ```{r}
  479. pdiffs <- pars %>% group_by(ID) %>% summarize(
  480. Theta = Theta[SOA == "Long"]-Theta[SOA =="Short"],
  481. Lambda = Lambda[SOA == "Long"]-Lambda[SOA =="Short"])
  482. pdiffs$ID <- NULL
  483. pdiffs$ID <- 1:31
  484. pdiffs$Theta <- scale(pdiffs$Theta)
  485. ```
  486. ### Decision threshold
  487. ```{r}
  488. data_threshold <- read.csv2('decision_threshold_bold.csv')
  489. ```
  490. ```{r}
  491. data_threshold <- data_threshold %>% group_by(ID, region, SOA) %>% summarise(adjustedBOLD = mean(adjustedBOLD), threshold = mean(decision.threshold))
  492. data_threshold$region <- factor(data_threshold$region)
  493. data_threshold$SOA <- factor(data_threshold$SOA)
  494. data_threshold$region <- factor(data_threshold$region)
  495. ```
  496. ```{r}
  497. ggplot(data = data_threshold, mapping = aes(x = threshold,y = adjustedBOLD, color = SOA)) + geom_vline(xintercept = 0,linetype = 2) +
  498. facet_wrap(~region,nrow = 2)+
  499. geom_point() +
  500. geom_smooth(method = MASS::rlm, alpha= .3) +
  501. scale_color_manual(values = c("black","#42a4f5"))+
  502. ylim(-20,20) + xlim(-2.5,2.5) +
  503. theme_classic() +
  504. ylab("SPM's adjusted \nBOLD amplitude") +
  505. xlab("standardized decision threshold")+
  506. theme(legend.position = "none",text = element_text(size = 14, family = "serif"), line = element_line(linewidth = 1), strip.text.x = element_text(size = 14,face = "bold"))
  507. ```
  508. ### Effective differential leakage
  509. ```{r}
  510. lambda <- read.csv2('lambda_bold.csv')
  511. ```
  512. ```{r}
  513. lambda <- lambda %>% group_by(ID, region, SOA) %>% summarise(adjustedBOLD = mean(adjustedBOLD), lambda = mean(lambda))
  514. data_threshold$region <- factor(data_threshold$region)
  515. data_threshold$SOA <- factor(data_threshold$SOA)
  516. data_threshold$region <- factor(data_threshold$region)
  517. ```
  518. ```{r}
  519. ggplot(data = lambda, mapping = aes(x = lambda,y = adjustedBOLD, color = SOA)) + geom_vline(xintercept = 0,linetype = 2) +
  520. facet_grid(~region)+
  521. geom_point() +
  522. geom_smooth(method = MASS::rlm, alpha= .3) +
  523. scale_color_manual(values = c("black","#42a4f5"))+
  524. ylim(-20,20) + xlim(-2.5,2.5) +
  525. theme_classic() +
  526. ylab("SPM's adjusted \nBOLD amplitude") +
  527. xlab("standardized effective differential leakage")+
  528. guides(color = guide_legend(nrow=1))+
  529. theme(legend.position = "bottom",text = element_text(size = 14, family = "serif"), line = element_line(linewidth = 1), strip.text.x = element_text(size = 14, face = "bold"), legend.text = element_text(size = 14))
  530. ```
  531. ## Does SROM recover the priming effects?
  532. ```{r}
  533. priming_effects <- comb_data %>%
  534. group_by(Source, Experiment, ID, SOA,DirectAssociates,IndirectAssociates) %>%
  535. summarise(RT = mean(RT, na.rm = T),
  536. Error = mean(Error, na.rm = T))
  537. priming_effects <- priming_effects %>% group_by(Source, Experiment, ID,SOA) %>%
  538. summarise(
  539. DirPE_RT = RT[DirectAssociates == "Strong" & IndirectAssociates == "Few"] - RT[DirectAssociates == "No" & IndirectAssociates == "Few"],
  540. DirPE_ER = Error[DirectAssociates == "Strong" & IndirectAssociates == "Few"] - Error[DirectAssociates == "No" & IndirectAssociates == "Few"],
  541. ComPE_RT = RT[DirectAssociates == "No" & IndirectAssociates == "Many"] - RT[DirectAssociates == "No" & IndirectAssociates == "Few"],
  542. ComPE_ER = Error[DirectAssociates == "No" & IndirectAssociates == "Many"] - Error[DirectAssociates == "No" & IndirectAssociates == "Few"],
  543. DCPE_RT = RT[DirectAssociates == "Strong" & IndirectAssociates == "Many"] - RT[DirectAssociates == "No" & IndirectAssociates == "Few"],
  544. DCPE_ER = Error[DirectAssociates == "Strong" & IndirectAssociates == "Many"] - Error[DirectAssociates == "No" & IndirectAssociates == "Few"])
  545. priming_effects1 <- melt(priming_effects,id.vars = c("ID","Source","Experiment","SOA"),
  546. measure.vars = c("DirPE_RT","DirPE_ER","ComPE_RT","ComPE_ER","DCPE_RT","DCPE_ER"),
  547. variable.name = "Condition",value.name = "Priming_effect")
  548. priming_effects1$Outcome <- NA
  549. priming_effects1$Outcome[grep('ER', priming_effects1$Condition)] <- "Error"
  550. priming_effects1$Outcome[grep('RT', priming_effects1$Condition)] <- "RT"
  551. priming_effects1$Priming <- NA
  552. priming_effects1$Priming[grep('Dir', priming_effects1$Condition)] <- "Associative"
  553. priming_effects1$Priming[grep('Com', priming_effects1$Condition)] <- "Semantic"
  554. priming_effects1$Priming[grep('DC', priming_effects1$Condition)] <- "Combined"
  555. priming_RT <- subset(priming_effects1, Outcome == "RT")
  556. priming_ER <- subset(priming_effects1, Outcome == "Error")
  557. ```
  558. ### Plots
  559. ```{r}
  560. ggplot(data = priming_RT, mapping = aes(x = Priming, y = Priming_effect, fill = Source)) + facet_grid(Experiment~SOA) +
  561. geom_bar(position = position_dodge(1),stat = "summary") +
  562. geom_errorbar(position = position_dodge(1), width = .1,stat = "summary")+
  563. theme_classic()
  564. ```
  565. ```{r}
  566. ggplot(data = priming_ER, mapping = aes(x = Priming, y = Priming_effect, fill = Source)) + facet_grid(Experiment~SOA) +
  567. geom_bar(position = position_dodge(1),stat = "summary") +
  568. geom_errorbar(position = position_dodge(1), width = .1,stat = "summary")+
  569. theme_classic()
  570. ```
  571. ### Perform t-Tests
  572. #### Descriptives
  573. ```{r}
  574. priming_effects1 %>% summarise(.by = c('Source','Experiment','SOA','Priming','Outcome'),
  575. mean = round(mean(Priming_effect),2),
  576. se = round(sd(Priming_effect)/sqrt(n()),3))
  577. ```
  578. #### t-Tests
  579. ```{r}
  580. priming_effects1 %>% summarise(.by = c('Source','Experiment','SOA','Priming','Outcome'),
  581. t = round(t.test(Priming_effect)$statistic,2),
  582. p = round(t.test(Priming_effect)$p.value,3), df = t.test(Priming_effect)$parameter)
  583. ```

Analyses.Rmd, no license · at the source

Overview

Authors: Leo Sokolovič1,2,3, Juraj Kukolja2,3, Markus Hofmann1
ORCID iDs: Leo Sokolovič
  1. Department of General and Biological Psychology, University of Wuppertal,42119 Wuppertal, Germany
  2. Department of Neurology and Clinical Neurophysiology, Helios University Hospital Wuppertal,42883 Wuppertal, Germany
  3. Faculty of Health, Witten/Herdecke University,58488 Witten, Germany
Journal: Scientific reports, volume 16, issue 1, article 19183
Dates: received 20 February 2026; accepted 17 June 2026; published online 20 June 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1038/s41598-026-58866-4 · PMID 42323482 · PMCID PMC13283216 · OpenAlex W7165403616
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: fMRI (modality), human (organism), cognitive (subfield)
Methods: Connectivity, Statistics, fMRI & imaging, Spectral & time-frequency
Keywords: associative and semantic priming, leaky competing accumulators, interactive activation model, fMRI, Neuroscience, Psychology
MeSH: Cognition*, Decision Making*, Semantics*, Adult, Brain Mapping, Female, Humans, Magnetic Resonance Imaging, Male, Memory, Short-Term, Reaction Time, Young Adult (* major topic)
Topic: Neural and Behavioral Psychology Studies (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Funding: Bergische Universität Wuppertal (3089)
Citations: cited by 1 paper (Europe PMC); 114 references in the paper

Abstract

This study introduces the sequential read-out model (SROM) to investigate the strategic and decision-making contributions to the semantic priming effect in a lexical-decision task (LDT). We use behavioral and fMRI data from two experiments (n = 32 and 31), which factorially manipulated the association strength, semantic similarity, and stimulus-onset-asynchrony. Using a leaky competing accumulator layer for lexical decisions, the SROM successfully accounted for behavioral data and showed that switching from short to long stimulus-onset-asynchrony changed the decision-making mode from competitive to independent race regime. We then used the individually estimated SROM parameters to predict the interindividual differences in BOLD responses to targets. We found that lexical-orthographic evidence modulated BOLD amplitudes in the left lingual gyrus, suggesting that it maintains lexico-orthographic evidence in working memory, which is then used for lexical decisions. The decision threshold, inhibition parameters and top-down semantic excitation predicted activation differences in the left inferior frontal gyrus, suggesting it regulates the decision process. Decision noise and top-down semantic excitation were associated with the left angular gyrus, supporting its involvement in evidence accumulation. Overall, the SROM provided mechanistic interpretations of brain activations in the regions involved in the semantically primed LDT, while accounting for associative semantic and strategic factors.

Supplementary Information: The online version contains supplementary material available at 10.1038/s41598-026-58866-4.

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

Repository

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

OSF mwsed

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Languages: MATLAB (3), R (1)
Size: 18 files, 4 scripts
Software Heritage: not checked
Found in: “Data availability”
Holds: 1 notebook
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: easystats (1 file), emmeans (1 file), ggplot2 (1 file), lme4 (1 file), lmerTest (1 file), patchwork (1 file), reshape2 (1 file), tidyverse (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
  • 27 September 2026: the link answers (HTTP 200)
484 files
At the source:

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;
  • 484 scripts, each with its path and the digest of its content;
  • no match between paragraphs and code yet;
  • neither the text of the paper nor the code itself.

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

Data

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

Data availability

Data, simulation and analysis code are available on Open Science Framework (https:/doi.org/10.17605/OSF.IO/MWSED).

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

Versions

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

Version 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 3 authors, 6 keywords, 12 MeSH terms, 1 funder, 105 references.

Cite

This paper

Sokolovič, L., Kukolja, J., & Hofmann, M. (2026). A neurocognitive interactive activation model of semantic priming in lexical decisions. Scientific reports, 16(1), 19183. https://doi.org/10.1038/s41598-026-58866-4

BibTeX

@article{sokolovic2026neurocognitive,
author = {Sokolovič, Leo and Kukolja, Juraj and Hofmann, Markus},
title = {{A neurocognitive interactive activation model of semantic priming in lexical decisions}},
journal = {Scientific reports},
year = {2026},
month = jun,
volume = {16},
number = {1},
pages = {19183},
publisher = {Nature Publishing Group},
issn = {2045-2322},
doi = {10.1038/s41598-026-58866-4},
url = {https://doi.org/10.1038/s41598-026-58866-4},
pmid = {42323482},
pmcid = {PMC13283216}
}

RIS

TY - JOUR
AU - Sokolovič, Leo
AU - Kukolja, Juraj
AU - Hofmann, Markus
TI - A neurocognitive interactive activation model of semantic priming in lexical decisions
T2 - Scientific reports
J2 - Sci Rep
PY - 2026
DA - 2026/06/20
VL - 16
IS - 1
SP - 19183
SN - 2045-2322
PB - Nature Publishing Group
DO - 10.1038/s41598-026-58866-4
UR - https://doi.org/10.1038/s41598-026-58866-4
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41598-026-58866-4",
"type": "article-journal",
"title": "A neurocognitive interactive activation model of semantic priming in lexical decisions",
"container-title": "Scientific reports",
"author": [
{
"family": "Sokolovič",
"given": "Leo"
},
{
"family": "Kukolja",
"given": "Juraj"
},
{
"family": "Hofmann",
"given": "Markus"
}
],
"container-title-short": "Sci Rep",
"volume": "16",
"issue": "1",
"page": "19183",
"DOI": "10.1038/s41598-026-58866-4",
"PMID": "42323482",
"PMCID": "PMC13283216",
"ISSN": "2045-2322",
"publisher": "Nature Publishing Group",
"URL": "https://doi.org/10.1038/s41598-026-58866-4",
"language": "en",
"issued": {
"date-parts": [
[
2026,
6,
20
]
]
}
}

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.7554/elife.103846 [code]
Overt visual attention modulates decision-related signals in the frontal cortex.
Journal: eLife
In common: lmerTest, lme4, ggplot2, 1 other tool, cognitive, 8 references
[2] doi:10.1162/imag.a.1313 [code]
Functional specialization of angular gyrus and precuneus subregions for perspective-guided autobiographical memory retrieval.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: easystats, emmeans, lmerTest, 4 other tools, cognitive, 2 references
[3] doi:10.1371/journal.pone.0353990 [code]
Positive mood enhances accessibility of unrelated concepts in the first language but not in the foreign language.
Journal: PloS one
In common: emmeans, lmerTest, lme4, 4 other tools, cognitive, 1 reference
[4] doi:10.1016/j.neuroimage.2026.122115 [code]
Midfrontal theta power relates to response speeding following frustrative nonreward.
Journal: NeuroImage
In common: easystats, emmeans, lmerTest, 5 other tools, cognitive
[5] doi:10.1093/braincomms/fcag279 [code]
Network flexibility facilitates treatment-induced recovery in post-stroke aphasia.
Journal: Brain communications
In common: easystats, emmeans, lmerTest, 4 other tools, fMRI, 1 reference
[6] 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: easystats, emmeans, lme4, 4 other tools, cognitive, 1 reference
[7] doi:10.1038/s41467-026-74753-y [code]
A human-specific microRNA controls the timing of excitatory synaptogenesis.
Journal: Nature communications
In common: easystats, emmeans, lmerTest, 5 other tools
[8] doi:10.1073/pnas.2606871123 [code]
Oxytocin modulates the neurocomputational mechanisms engaged in learning rank relationships in social networks.
Journal: Proceedings of the National Academy of Sciences of the United States of America
In common: easystats, emmeans, lmerTest, 5 other tools
[9] doi:10.1016/j.celrep.2026.117505 [code]
Impaired spatial coding and neuronal hyperactivity in the medial entorhinal cortex of aged APP knock-in mice.
Journal: Cell reports
In common: easystats, emmeans, lmerTest, 5 other tools
[10] doi:10.1016/j.isci.2026.116747 [code]
Age and loneliness relate to reduced trust learning and alterations in amygdala function.
Journal: iScience
In common: easystats, emmeans, lmerTest, 4 other tools, fMRI, cognitive

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.