OSCR

Working memory demands modulate memory brain state engagement.

Code ↔ Paper

11 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 11 matches
  1. [1] § STAR★Methods › Quantification and statistical analysis › EEG data preprocessing ↔ codes/anaCodes/eegPrepro.py, lines 59–103 · score 0.91 · notch filter, Hurst exponent, high pass filter, Bad electrodes, harmonics, noise
  2. [2] § Results › Memory brain states are modulated by working memory demands ↔ codes/anaCodes/permStats.Rmd, lines 273–325 · score 0.81 · gradual increase, rmANOVA, response selectively, Response locked memory, indicating greater retrieval, assessed response locked
  3. [3] § STAR★Methods › Quantification and statistical analysis › EEG data analysis ↔ codes/anaCodes/config.py, lines 271–314 · score 0.79 · Morlet wavelet transform, logarithmically spaced frequencies, 100 Hz
  4. [4] § STAR★Methods › Method details › Procedure and design › General overview ↔ codes/expCodes/perm.py, lines 169–246 · score 0.75 · response mappings, perception blocks, memory blocks, response phase, jitter, locations
  5. [5] § STAR★Methods › Quantification and statistical analysis › Statistical analyses ↔ codes/anaCodes/perm_group_memState.py, lines 307–357 · score 0.59 · logistic regression, linear regression, predicts, memory state evidence, delay, perception
  6. [6] § Results › Memory brain states are modulated by working memory demands ↔ codes/anaCodes/permStats.Rmd, lines 327–370 · score 0.59 · pre response dissociation, post hoc, perception responses, anticipated, SD, interval
  7. [7] § STAR★Methods › Method details › Procedure and design › Memory task ↔ codes/expCodes/perm.py, lines 169–246 · score 0.58 · memory blocks, response phase, change detection, locations, squares
  8. [8] § Results › Set size modulates target and change detection behavior ↔ codes/anaCodes/permStats.Rmd, lines 372–455 · score 0.55 · logistic regression, memory accuracy, linear regression, RT, SD, perception
  9. [9] § Results › Memory brain states are modulated by working memory demands ↔ codes/anaCodes/perm_stats.py, lines 357–402 · score 0.54 · 500–2500 ms, delay, retrieval, memory
  10. [10] § Results › Memory brain states are modulated by working memory demands ↔ codes/anaCodes/permStats.Rmd, lines 457–497 · score 0.51 · memory response, pre response, BF, hit, CRs, SD
  11. [11] § STAR★Methods › Quantification and statistical analysis › EEG data analysis ↔ codes/anaCodes/zpowerAna.py, lines 15–98 · score 0.50 · log transforming, onset, power, electrodes, EEG

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 · 497 lines · 17 KB · no license · 4 matches

  1. ---
  2. title: "perm stats"
  3. author: "Nicole Long & DT Nguyen"
  4. date: "1/31/2025"
  5. output:
  6. pdf_document:
  7. toc: yes
  8. latex_engine: xelatex
  9. mainfont: Helvetica
  10. cache: yes
  11. ---
  12. # Set desired parameters for the markdown output and load libraries
  13. ```{r setup, include=FALSE}
  14. knitr::opts_chunk$set(echo = FALSE)
  15. knitr::opts_chunk$set(cache = TRUE)
  16. knitr::opts_chunk$set(warning = FALSE)
  17. knitr::opts_chunk$set(message = FALSE)
  18. library(tidyverse)
  19. library(dplyr)
  20. library(glue) # prints results
  21. library(sjstats) # calculates eta squared
  22. library(emmeans)
  23. library(BayesFactor)
  24. ```
  25. # Specify subjects and directories
  26. ```{r}
  27. expr = "dtn4gn"
  28. N = 39
  29. dataDir = paste("/Users/",expr,"/eeg/perm/data/group/",sep="")
  30. #dataDir = paste("/Users/",expr,"/Library/CloudStorage/Box-Box/DT/perm/analysis/data/group/",sep="")
  31. demoDir = paste("/Users/",expr,"/eeg/perm/data/demographics/",sep="")
  32. ```
  33. # Demographics
  34. ```{r}
  35. demoData = read.csv(paste(demoDir, "eeg_demoPerm.csv", sep="")) %>%
  36. dplyr::select(-Study, -X, -X.1) # remove unnecessary columns
  37. ageM = round(mean(demoData$Age), 4)
  38. print(glue("Mean age is {ageM}"))
  39. ageSD = round(sd(demoData$Age), 4)
  40. print(glue("Standard deviation of age is {ageSD}"))
  41. ```
  42. # Load data
  43. ```{r}
  44. # behavioral data
  45. data = read.csv(paste(paste(dataDir,"N", N,"_perm_performance_Acc_RT.csv", sep=""))) %>%
  46. dplyr::select(-X) # remove this X column
  47. ## separate by task
  48. percDF = data[data$task=="perception",]
  49. memoDF = data[data$task=="memory",]
  50. # stimulus-locked data
  51. dataStimANOVA = read.csv(paste(paste0(dataDir,"N39_perm_trained_N57_repo_0to2000_to_stimLocked_0to3500in100ms_whole_brain_allFreqs_retEvi_Task.csv", sep=""))) %>%
  52. select(-X) %>% # remove this X column
  53. rename(
  54. retEvi = retrieval.evidence,
  55. time = time..ms.)
  56. dataRetEviDelay = read_csv(paste(paste0(dataDir, "N39_perm_trained_N57_repo_0to2000_to_stimLocked_500to2500in2000ms_whole_brain_allFreqs_retEvi_TaskXSetSize.csv"))) %>%
  57. select(-1) %>% # remove this X column
  58. rename(
  59. retEvi = `retrieval evidence`,
  60. time = `time (ms)`,
  61. setSize = `set size`)
  62. ## memory task only
  63. memoDelayDF = dataRetEviDelay[dataRetEviDelay$task=="memory",] %>%
  64. select(-3,-4)
  65. dataCapLimit = read.csv(paste(paste0(dataDir,"N39_perm_trained_N57_repo_0to2000_to_stimLocked_500to2500in2000ms_whole_brain_allFreqs_accuracy_SetSize.csv", sep=""))) %>%
  66. select(-X) %>% # remove this X column
  67. rename(
  68. setSize = set.size,
  69. capGroup = capacity.group)
  70. # response-locked data
  71. dataRespANOVA = read.csv(paste(paste0(dataDir,"N39_perm_trained_N57_repo_0to2000_to_respLocked_-500to500in100ms_whole_brain_allFreqs_retEvi_Task.csv", sep=""))) %>%
  72. select(-X) %>% # remove this X column
  73. rename(
  74. retEvi = retrieval.evidence,
  75. time = time..ms.)
  76. ```
  77. # ANOVAs
  78. ## 1x4 rmANOVA
  79. To examine the effect of set size on reaction time on perceptual trials, we conducted a one-way repeated-measures ANOVA with factors of set size (1, 2, 4, 6) as the IV and reaction time as the DV.
  80. To examine the effect of set size on response accuracy on memory trials, we conducted a one-way repeated-measures ANOVA with factors of set size (1, 2, 4, 6) as the IV and response accuracy as the DV.
  81. ### Analysis
  82. ```{r}
  83. # 1 x 4 ANOVA (perception)
  84. model = aov(rt ~ setSize + Error(subject/(setSize)), data=percDF)
  85. es_res = effectsize::eta_squared(model)
  86. summary(model)
  87. FACTOR = 2
  88. pval = summary(model)[[FACTOR]][[1]]['Pr(>F)'][[1]][[1]]
  89. factor_df = summary(model)[[FACTOR]][[1]]['Df'][[1]][[1]]
  90. resid_df = summary(model)[[FACTOR]][[1]]['Df'][[1]][[2]]
  91. f_stat = round(summary(model)[[FACTOR]][[1]]['F value'][[1]][[1]],4)
  92. pval_round = round(pval,4)
  93. # partial eta sq is one "off" because there's no eta for the subjects factor
  94. part_eta_sq = round(es_res$Eta2_partial,4)[FACTOR-1]
  95. print('Main effect of set size (perception trials)')
  96. print(glue("F({factor_df},{resid_df}) = {f_stat}; p = {pval_round}; pEta2 = {part_eta_sq}"))
  97. # 1 x 4 ANOVA (memory)
  98. model = aov(accuracy ~ setSize + Error(subject/(setSize)), data=memoDF)
  99. es_res = effectsize::eta_squared(model)
  100. summary(model)
  101. FACTOR = 2
  102. pval = summary(model)[[FACTOR]][[1]]['Pr(>F)'][[1]][[1]]
  103. factor_df = summary(model)[[FACTOR]][[1]]['Df'][[1]][[1]]
  104. resid_df = summary(model)[[FACTOR]][[1]]['Df'][[1]][[2]]
  105. f_stat = round(summary(model)[[FACTOR]][[1]]['F value'][[1]][[1]],4)
  106. pval_round = round(pval,4)
  107. # partial eta sq is one "off" because there's no eta for the subjects factor
  108. part_eta_sq = round(es_res$Eta2_partial,4)[FACTOR-1]
  109. print('Main effect of set size (memory trials)')
  110. print(glue("F({factor_df},{resid_df}) = {f_stat}; p = {pval_round}; pEta2 = {part_eta_sq}"))
  111. ```
  112. ### M & SD
  113. (if the interaction is significant, report the means and SDs of each of the four conditions)
  114. ```{r}
  115. perc_ss1 = percDF %>%
  116. filter(setSize==1)
  117. perc_ss2 = percDF %>% # perc_ss2 and perc_ss4 NS for post-hoc
  118. filter(setSize==2)
  119. perc_ss4 = percDF %>%
  120. filter(setSize==4)
  121. perc_ss6 = percDF %>%
  122. filter(setSize==6)
  123. # ----- perception: set size 1 ----- #
  124. muF1L1_F2L1 = round(mean(perc_ss1$rt),4)
  125. sdF1L1_F2L1 = round(sd(perc_ss1$rt),4)
  126. print(paste('perception: set size 1 mu = ',muF1L1_F2L1))
  127. print(paste('perception: set size 1 sd = ',sdF1L1_F2L1))
  128. # ----- perception: set size 2 ----- #
  129. muF1L1_F2L2 = round(mean(perc_ss2$rt),4)
  130. sdF1L1_F2L2 = round(sd(perc_ss2$rt),4)
  131. print(paste('perception: set size 2 mu = ',muF1L1_F2L2))
  132. print(paste('perception: set size 2 sd = ',sdF1L1_F2L2))
  133. # ----- perception: set size 4 ----- #
  134. muF1L2_F2L1 = round(mean(perc_ss4$rt),4)
  135. sdF1L2_F2L1 = round(sd(perc_ss4$rt),4)
  136. print(paste('perception: set size 4 mu = ',muF1L2_F2L1))
  137. print(paste('perception: set size 4 sd = ',sdF1L2_F2L1))
  138. # ----- perception: set size 6 ----- #
  139. muF1L2_F2L2 = round(mean(perc_ss6$rt),4)
  140. sdF1L2_F2L2 = round(sd(perc_ss6$rt),4)
  141. print(paste('perception: set size 6 mu = ',muF1L2_F2L2))
  142. print(paste('perception: set size 6 sd = ',sdF1L2_F2L2))
  143. # memory
  144. memo_ss1 = memoDF %>% # memo_ss1 and memo_ss2 NS for post-hoc
  145. filter(setSize==1)
  146. memo_ss2 = memoDF %>%
  147. filter(setSize==2)
  148. memo_ss4 = memoDF %>%
  149. filter(setSize==4)
  150. memo_ss6 = memoDF %>%
  151. filter(setSize==6)
  152. # ----- memory: set size 1 ----- #
  153. muF1L1_F2L1 = round(mean(memo_ss1$accuracy),4)
  154. sdF1L1_F2L1 = round(sd(memo_ss1$accuracy),4)
  155. print(paste('memory: set size 1 mu = ',muF1L1_F2L1))
  156. print(paste('memory: set size 1 sd = ',sdF1L1_F2L1))
  157. # ----- memory: set size 2 ----- #
  158. muF1L1_F2L2 = round(mean(memo_ss2$accuracy),4)
  159. sdF1L1_F2L2 = round(sd(memo_ss2$accuracy),4)
  160. print(paste('memory: set size 2 mu = ',muF1L1_F2L2))
  161. print(paste('memory: set size 2 sd = ',sdF1L1_F2L2))
  162. # ----- memory: set size 4 ----- #
  163. muF1L2_F2L1 = round(mean(memo_ss4$accuracy),4)
  164. sdF1L2_F2L1 = round(sd(memo_ss4$accuracy),4)
  165. print(paste('memory: set size 4 mu = ',muF1L2_F2L1))
  166. print(paste('memory: set size 4 sd = ',sdF1L2_F2L1))
  167. # ----- memory: set size 6 ----- #
  168. muF1L2_F2L2 = round(mean(memo_ss6$accuracy),4)
  169. sdF1L2_F2L2 = round(sd(memo_ss6$accuracy),4)
  170. print(paste('memory: set size 6 mu = ',muF1L2_F2L2))
  171. print(paste('memory: set size 6 sd = ',sdF1L2_F2L2))
  172. ```
  173. ## 2x35 rmANOVA
  174. We expect to find a significant main effect of time and a significant interaction between task and time. We expect a decrease in memory state evidence (reflecting encoding state engagement) during the display phase and an increase in memory state evidence (reflecting retrieval state engagement) during the delay phase, the latter of which will be larger for memory compared to perception trials.
  175. ### Analysis (task)
  176. ```{r}
  177. model = aov(retEvi ~ task*time + Error(subject/(task*time)), data=dataStimANOVA)
  178. es_res = effectsize::eta_squared(model)
  179. summary(model)
  180. # task
  181. FACTOR = 2
  182. pval = summary(model)[[FACTOR]][[1]]['Pr(>F)'][[1]][[1]]
  183. factor_df = summary(model)[[FACTOR]][[1]]['Df'][[1]][[1]]
  184. resid_df = summary(model)[[FACTOR]][[1]]['Df'][[1]][[2]]
  185. f_stat = round(summary(model)[[FACTOR]][[1]]['F value'][[1]][[1]],4)
  186. pval_round = round(pval,4)
  187. # partial eta sq is one "off" because there's no eta for the subjects factor
  188. part_eta_sq = round(es_res$Eta2_partial,4)[FACTOR-1]
  189. print('Main effect of task:')
  190. print(glue("F({factor_df},{resid_df}) = {f_stat}; p = {pval_round}; pEta2 = {part_eta_sq}"))
  191. # time
  192. FACTOR = 3
  193. pval = summary(model)[[FACTOR]][[1]]['Pr(>F)'][[1]][[1]]
  194. factor_df = summary(model)[[FACTOR]][[1]]['Df'][[1]][[1]]
  195. resid_df = summary(model)[[FACTOR]][[1]]['Df'][[1]][[2]]
  196. f_stat = round(summary(model)[[FACTOR]][[1]]['F value'][[1]][[1]],4)
  197. pval_round = round(pval,4)
  198. # partial eta sq is one "off" because there's no eta for the subjects factor
  199. part_eta_sq = round(es_res$Eta2_partial,4)[FACTOR-1]
  200. print('Main effect of time:')
  201. print(glue("F({factor_df},{resid_df}) = {f_stat}; p = {pval_round}; pEta2 = {part_eta_sq}"))
  202. # task:time
  203. FACTOR = 4
  204. pval = summary(model)[[FACTOR]][[1]]['Pr(>F)'][[1]][[1]]
  205. factor_df = summary(model)[[FACTOR]][[1]]['Df'][[1]][[1]]
  206. resid_df = summary(model)[[FACTOR]][[1]]['Df'][[1]][[2]]
  207. f_stat = round(summary(model)[[FACTOR]][[1]]['F value'][[1]][[1]],4)
  208. pval_round = round(pval,4)
  209. # partial eta sq is one "off" because there's no eta for the subjects factor
  210. part_eta_sq = round(es_res$Eta2_partial,4)[FACTOR-1]
  211. print('Interaction between task and time:')
  212. print(glue("F({factor_df},{resid_df}) = {f_stat}; p = {pval_round}; pEta2 = {part_eta_sq}"))
  213. ```
  214. ## 2x10 rmANOVA
  215. We will assess response-locked memory state evidence during the response interval of each task which will provide insights into the extent to which the retrieval state is modulated by decision making. There are two alternative outcomes:
  216. - First, to the extent that the retrieval state is recruited for any decision, we should find a gradual increase in memory state evidence (indicating greater retrieval state engagement) leading up to the response on both memory and perception trials.
  217. - Alternatively, to the extent that the retrieval state is specifically recruited for a decision based on internal, rather than external, information, we should find a gradual increase in memory state evidence leading up to the response selectively for memory trials.
  218. We expect to find a significant main effect of time and a significant interaction between task and time.
  219. ### Analysis
  220. ```{r}
  221. model = aov(retEvi ~ task*time + Error(subject/(task*time)), data=dataRespANOVA)
  222. es_res = effectsize::eta_squared(model)
  223. summary(model)
  224. # task
  225. FACTOR = 2
  226. pval = summary(model)[[FACTOR]][[1]]['Pr(>F)'][[1]][[1]]
  227. factor_df = summary(model)[[FACTOR]][[1]]['Df'][[1]][[1]]
  228. resid_df = summary(model)[[FACTOR]][[1]]['Df'][[1]][[2]]
  229. f_stat = round(summary(model)[[FACTOR]][[1]]['F value'][[1]][[1]],4)
  230. pval_round = round(pval,4)
  231. # partial eta sq is one "off" because there's no eta for the subjects factor
  232. part_eta_sq = round(es_res$Eta2_partial,4)[FACTOR-1]
  233. print('Main effect of tas:')
  234. print(glue("F({factor_df},{resid_df}) = {f_stat}; p = {pval_round}; pEta2 = {part_eta_sq}"))
  235. # time
  236. FACTOR = 3
  237. pval = summary(model)[[FACTOR]][[1]]['Pr(>F)'][[1]][[1]]
  238. factor_df = summary(model)[[FACTOR]][[1]]['Df'][[1]][[1]]
  239. resid_df = summary(model)[[FACTOR]][[1]]['Df'][[1]][[2]]
  240. f_stat = round(summary(model)[[FACTOR]][[1]]['F value'][[1]][[1]],4)
  241. pval_round = round(pval,4)
  242. # partial eta sq is one "off" because there's no eta for the subjects factor
  243. part_eta_sq = round(es_res$Eta2_partial,4)[FACTOR-1]
  244. print('Main effect of time:')
  245. print(glue("F({factor_df},{resid_df}) = {f_stat}; p = {pval_round}; pEta2 = {part_eta_sq}"))
  246. # task:time
  247. FACTOR = 4
  248. pval = summary(model)[[FACTOR]][[1]]['Pr(>F)'][[1]][[1]]
  249. factor_df = summary(model)[[FACTOR]][[1]]['Df'][[1]][[1]]
  250. resid_df = summary(model)[[FACTOR]][[1]]['Df'][[1]][[2]]
  251. f_stat = round(summary(model)[[FACTOR]][[1]]['F value'][[1]][[1]],4)
  252. pval_round = round(pval,4)
  253. # partial eta sq is one "off" because there's no eta for the subjects factor
  254. part_eta_sq = round(es_res$Eta2_partial,4)[FACTOR-1]
  255. print('Interaction between task and time:')
  256. print(glue("F({factor_df},{resid_df}) = {f_stat}; p = {pval_round}; pEta2 = {part_eta_sq}"))
  257. ```
  258. ### Post-hoc t-tests
  259. (if interaction is significant, perform post-hoc tests on specific conditions)
  260. Because we anticipate a pre-response dissociation between memory and perception responses, we will conduct post-hoc analyses on the pre-response (-500 to 0 ms) time interval.
  261. ```{r}
  262. # define pre-response time interval bins
  263. bins = seq(-500, -100, by = 100) # 100 ms intervals from 500 ms pre-response to 0 ms response
  264. time_order = paste0(bins, "to", bins + 100)
  265. # average across pre-response bins
  266. preResp = dataRespANOVA %>%
  267. filter(time %in% time_order) %>%
  268. group_by(subject, task) %>%
  269. summarise(muRetEvi = mean(retEvi))
  270. # separate by task
  271. percPreResp = preResp[preResp$task == "perception",]
  272. memoPreResp = preResp[preResp$task == "memory",]
  273. # compare F1L1_F2L1 to F1L1_F2L2
  274. res = t.test(memoPreResp$muRetEvi,percPreResp$muRetEvi,paired=TRUE)
  275. t_val = round(res$statistic[[1]],4)
  276. p_val = round(res$p.value[[1]],4)
  277. CI1 = round(res$conf.int[[1]],4)
  278. CI2 = round(res$conf.int[[2]],4)
  279. # cohen's d
  280. M1 = mean(memoPreResp$muRetEvi)
  281. S1 = sd(memoPreResp$muRetEvi)
  282. M2 = mean(percPreResp$muRetEvi)
  283. S2 = sd(percPreResp$muRetEvi)
  284. Spooled = sqrt(((S1^2)+(S2^2))/2)
  285. cohD = round((M1-M2)/Spooled,4)
  286. print(glue('Memory vs. Perception: t = {t_val}; p = {p_val}; d = {cohD}, CI = [{CI1},{CI2}]'))
  287. print(paste('memory: mu = ',M1))
  288. print(paste('memory: sd = ',S1))
  289. print(paste('perception: mu = ',M2))
  290. print(paste('perception: sd = ',S2))
  291. ```
  292. # Resub
  293. ## Bayes factors
  294. ### Regressions
  295. ```{r}
  296. # DISPLAY: MEMORY STATE EVIDENCE & MEMORY ACCURACY (LOGISTIC REGRESSION)
  297. retEviReg_display = read.csv(paste(paste(dataDir,"N", N,"_perm_trained_N57_repo_0to2000_to_stimLocked_0to500in500ms_whole_brain_allFreqs_retEvi_Display_Reg.csv", sep="")))
  298. statData = retEviReg_display %>%
  299. filter(task == 'memory')
  300. # Means and SDs
  301. M = round(mean(statData$beta),4)
  302. S = round(sd(statData$beta),4)
  303. print(glue('display (memory): M = {M}, SD = {S}'))
  304. res = t.test(statData$beta,mu=0)
  305. df = nrow(statData) - 1
  306. t_val = round(res$statistic[[1]],4)
  307. p_val = round(res$p.value[[1]],4)
  308. bf = ttestBF(x = statData$beta,mu=0)
  309. bf = extractBF(bf)
  310. # You know that people don't always want to print things directly to the console. Right? Right?!?!?!
  311. bf = round(bf$bf,4)
  312. # Cohen's d
  313. cohD = round(M/S,4)
  314. print(glue('vs 0: t({df}) = {t_val}; p = {p_val}; d = {cohD}, BF = {bf}'))
  315. # DELAY: MEMORY STATE EVIDENCE & ACCURACY PER SET SIZE (LOGISTIC REGRESSION)
  316. retEviReg_delay = read.csv(paste(paste(dataDir,"N", N,"_perm_trained_N57_repo_0to2000_to_stimLocked_500to2500in2000ms_whole_brain_allFreqs_retEvi_Delay_Reg_perSetSize.csv", sep="")))
  317. statData = retEviReg_delay %>%
  318. group_by(subject) %>%
  319. summarise(beta = mean(beta), .groups = "drop")
  320. # Means and SDs
  321. M = round(mean(statData$beta),4)
  322. S = round(sd(statData$beta),4)
  323. print(glue('delay (memory): M = {M}, SD = {S}'))
  324. res = t.test(statData$beta,mu=0)
  325. df = nrow(statData) - 1
  326. t_val = round(res$statistic[[1]],4)
  327. p_val = round(res$p.value[[1]],4)
  328. bf = ttestBF(x = statData$beta,mu=0)
  329. bf = extractBF(bf)
  330. bf = round(bf$bf,4)
  331. # Cohen's d
  332. cohD = round(M/S,4)
  333. print(glue('vs 0: t({df}) = {t_val}; p = {p_val}; d = {cohD}, BF = {bf}'))
  334. # DELAY: MEMORY STATE EVIDENCE & PERCEPTION RT (LINEAR REGRESSION)
  335. retEviReg_delay_perc = read.csv(paste(paste(dataDir,"N", N,"_perm_trained_N57_repo_0to2000_to_stimLocked_500to2500in2000ms_whole_brain_allFreqs_retEvi_Delay_Reg_SetSize.csv", sep="")))
  336. statData = retEviReg_delay_perc %>%
  337. filter(task == 'perception')
  338. # Means and SDs
  339. M = round(mean(statData$beta),4)
  340. S = round(sd(statData$beta),4)
  341. print(glue('delay (perception): M = {M}, SD = {S}'))
  342. res = t.test(statData$beta,mu=0)
  343. df = nrow(statData) - 1
  344. t_val = round(res$statistic[[1]],4)
  345. p_val = round(res$p.value[[1]],4)
  346. bf = ttestBF(x = statData$beta,mu=0)
  347. bf = extractBF(bf)
  348. bf = round(bf$bf,4)
  349. # Cohen's d
  350. cohD = round(M/S,4)
  351. print(glue('vs 0: t({df}) = {t_val}; p = {p_val}; d = {cohD}, BF = {bf}'))
  352. ```
  353. ### Hits vs CRs
  354. ```{r}
  355. # basically turning the python code in perm_stats.py to R here, so going a little against the template. sorry, nicole!
  356. # read in data
  357. retEviResponse = read.csv(paste(paste(dataDir,"N", N,"_perm_trained_N57_repo_0to2000_to_respLocked_-500to500in100ms_whole_brain_allFreqs_retEvi_Memory_Response.csv", sep="")))
  358. bins = seq(-500, -100, by = 100)
  359. preResponse = paste0(bins, "to", bins + 100)
  360. responseDF <- retEviResponse %>%
  361. filter(task == "memory",
  362. response %in% c("hit", "cr"),
  363. time..ms. %in% preResponse) %>% # this is ugly but keeping it like this since we only need the BF anyway
  364. group_by(subject, response) %>%
  365. summarise(retrieval.evidence = mean(retrieval.evidence, na.rm = TRUE), .groups = "drop")
  366. responseDF <- responseDF %>%
  367. pivot_wider(names_from = response, values_from = retrieval.evidence)
  368. hitRetEvi = responseDF$hit
  369. crRetEvi = responseDF$cr
  370. res = t.test(hitRetEvi, crRetEvi, paired = TRUE)
  371. df = res$parameter
  372. t_val = round(res$statistic, 4)
  373. p_val = round(res$p.value, 4)
  374. # cohen's d (for paired: mean of difference scores / sd of difference scores)
  375. diff = hitRetEvi - crRetEvi
  376. cohD = round(mean(diff) / sd(diff), 4)
  377. print(paste0("Hit mean: ", round(mean(hitRetEvi), 4)))
  378. print(paste0("Hit sd: ", round(sd(hitRetEvi), 4)))
  379. print(paste0("CR mean: ", round(mean(crRetEvi), 4)))
  380. print(paste0("CR sd: ", round(sd(crRetEvi), 4)))
  381. print(glue('Hit vs CR: t({df}) = {t_val}; p = {p_val}; BF = {bf}'))
  382. ```

permStats.Rmd, no license · at the source

Overview

  1. Department of Psychology, University of Virginia, Charlottesville, VA, USA
Institutions: University of Virginia (United States)
Journal: iScience, volume 29, issue 9, article 117285
Dates: received 24 April 2026; accepted 5 August 2026; published online 25 August 2026
Type: Research article · Language: English
License: CC BY-NC-ND
Identifiers: DOI 10.1016/j.isci.2026.117285 · PMID 42699593 · PMCID PMC13543892 · OpenAlex W7154531691
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: EEG (modality), cognitive (subfield)
Methods: Preprocessing, Connectivity, Statistics, Smoothing, state filtering, decompositions, Machine learning, Spectral & time-frequency, Complexity, Single-unit activity, calcium imaging, Physiology & signal measures
Keywords: working memory, encoding, retrieval, external attention, internal attention, brain states, scalp EEG
Topic: Neural and Behavioral Psychology Studies (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Funding: National Institutes of Health; National Institute of Neurological Disorders and Stroke (R01 NS132872)
Citations: not cited yet (Europe PMC); 99 references in the paper
Research resources: R studio RRID:SCR_000432, Psychopy RRID:SCR_006571

Abstract

The abstract is not reproduced here: the paper's license (CC BY-NC-ND) does not allow it. Read it in the paper, at the publisher or on Europe PMC.

Repositories

Its files are read in the Code ↔ Paper reader above, with 11 matches between paragraphs and lines of code.

OSF m6knv

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Languages: Python (25), R (1)
Size: 53 files, 26 scripts
Software Heritage: not checked
Found in: the text, “EEG data preprocessing”
Holds: 1 notebook
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: NumPy (19 files), pandas (18 files), Matplotlib (13 files), seaborn (8 files), SciPy (7 files), statsmodels (2 files), BayesFactor (1 file), easystats (1 file), emmeans (1 file), MNE-Python (1 file), PsychoPy (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)
26 files
At the source: osf.io/m6knv

longtermmemorylab.com/papers

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: the link answers
Software Heritage: not checked
Found in: “Data and code availability”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
  • 27 September 2026: the link answers (HTTP 200)

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:

  • 2 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 26 scripts, each with its path and the digest of its content;
  • 11 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.

Code and data availability statement

The paper has a code and data availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:

Read it in the paper: doi.org/10.1016/j.isci.2026.117285.

Versions

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

Version 2, 28 September 2026

  • Authors: added DT Nguyen (0009-0007-8321-2277); Nicole M Long (0000-0003-3766-2764); removed DT Nguyen; Nicole M Long

Version 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 2 authors, 7 keywords, 2 funders, 98 references, 2 RRIDs.

Cite

This paper

Nguyen, D., & Long, N. M. (2026). Working memory demands modulate memory brain state engagement. iScience, 29(9), 117285. https://doi.org/10.1016/j.isci.2026.117285

BibTeX

@article{nguyen2026working,
author = {Nguyen, DT and Long, Nicole M},
title = {{Working memory demands modulate memory brain state engagement}},
journal = {iScience},
year = {2026},
month = aug,
volume = {29},
number = {9},
pages = {117285},
publisher = {Elsevier},
issn = {2589-0042},
doi = {10.1016/j.isci.2026.117285},
url = {https://doi.org/10.1016/j.isci.2026.117285},
pmid = {42699593},
pmcid = {PMC13543892}
}

RIS

TY - JOUR
AU - Nguyen, DT
AU - Long, Nicole M
TI - Working memory demands modulate memory brain state engagement
T2 - iScience
J2 - iScience
PY - 2026
DA - 2026/08/25
VL - 29
IS - 9
SP - 117285
SN - 2589-0042
PB - Elsevier
DO - 10.1016/j.isci.2026.117285
UR - https://doi.org/10.1016/j.isci.2026.117285
LA - en
ER -

CSL-JSON

{
"id": "10.1016/j.isci.2026.117285",
"type": "article-journal",
"title": "Working memory demands modulate memory brain state engagement",
"container-title": "iScience",
"author": [
{
"family": "Nguyen",
"given": "DT"
},
{
"family": "Long",
"given": "Nicole M"
}
],
"container-title-short": "iScience",
"volume": "29",
"issue": "9",
"page": "117285",
"DOI": "10.1016/j.isci.2026.117285",
"PMID": "42699593",
"PMCID": "PMC13543892",
"ISSN": "2589-0042",
"publisher": "Elsevier",
"URL": "https://doi.org/10.1016/j.isci.2026.117285",
"language": "en",
"issued": {
"date-parts": [
[
2026,
8,
25
]
]
}
}

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.1523/eneuro.0076-26.2026 [code]
Exogenously Driven Neural Reactivation of Spatially Matching Visual Working-Memory Contents.
Journal: eNeuro
In common: BayesFactor, PsychoPy, emmeans, 5 other tools, EEG, cognitive, 2 references
[2] doi:10.1038/s41597-026-07350-9 [code]
An open multi-center MEG-EEG dataset for studying conscious visual perception.
Journal: Scientific data
In common: BayesFactor, easystats, emmeans, 8 other tools, EEG
[3] doi:10.1093/nc/niag029 [code]
A data-driven approach to identifying and evaluating connectivity-based neural correlates of conscious visual perception.
Journal: Neuroscience of consciousness
In common: BayesFactor, easystats, emmeans, 8 other tools, cognitive
[4] doi:10.34133/csbj.0042 [code]
Using Steady-State Visual Evoked Potentials to Characterize Wide-Ranging Retinopathy Linked to &lt;i&gt;CRB1&lt;/i&gt;: Implications for Clinical Trials.
Journal: Computational and structural biotechnology journal
In common: PsychoPy, easystats, emmeans, 8 other tools, EEG
[5] doi:10.1038/s41597-026-07377-y [code]
An open-access multi-site fMRI dataset for investigating conscious visual perception.
Journal: Scientific data
In common: BayesFactor, easystats, emmeans, 8 other tools
[6] doi:10.1038/s41467-026-73865-9 [code]
Histamine shapes the neurocomputational dynamics of human learning.
Journal: Nature communications
In common: BayesFactor, PsychoPy, easystats, 7 other tools, cognitive
[7] doi:10.1167/jov.26.8.4 [code]
The neural processes of illusory occlusion in object recognition.
Journal: Journal of vision
In common: BayesFactor, PsychoPy, MNE-Python, 6 other tools, EEG, cognitive
[8] doi:10.1093/cercor/bhag113 [code]
Long-term reliability and stability of parameterized resting state EEG: evidence from a five-year follow-up.
Journal: Cerebral cortex (New York, N.Y. : 1991)
In common: easystats, emmeans, MNE-Python, 6 other tools, EEG, 1 reference
[9] doi:10.1073/pnas.2603114123 [code]
The human hippocampus can pattern separate memories by meaning.
Journal: Proceedings of the National Academy of Sciences of the United States of America
In common: PsychoPy, easystats, emmeans, 5 other tools, cognitive, 1 reference
[10] doi:10.1038/s41598-026-41129-7 [code]
Non-linear relationships between auditory mismatch responses and the inharmonicity of complex sounds.
Journal: Scientific reports
In common: PsychoPy, emmeans, MNE-Python, 6 other tools, EEG, 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.