OSCR

Nonergodicity and Simpson's paradox in neurocognitive dynamics of cognitive control.

Code ↔ Paper

18 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.

12 blocks of code here have a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.

The 18 matches · 1 of them tie a paragraph to a whole file without given lines: a weak match, whose lines are not tinted
  1. [1] § Results › Between-subjects and within-subjects analysis of brain-behavior associations ↔ taskfmri/6_plotting/plotting_utils.py, lines 9 to 24 · score 0.90 · basal ganglia, AntSalience, PostSalience, VisualAssoc, lFPN, rFPN · block oscr:b:7K0TSC0VFSJBG-6 · Report a mismatch
  2. [2] § Methods › Inclusion criteria ↔ taskfmri/0_subjectlist/inclusions_1.py, lines 70 to 126 · score 0.88 · abcd_imgincl01.txt, iqc_sst_good_ser, mriqcrp20301.txt, imgincl sst · block oscr:b:F5TRGMY32V49F-Y · Report a mismatch
  3. [3] § Results › Between-subjects and within-subjects analysis of brain-behavior associations ↔ taskfmri/6_plotting/plotting_utils.py, lines 4 to 7 · score 0.86 · AntSalience, BasalGanglia, PostSalience, VisualAssoc, lFPN, rFPN · block oscr:b:8H2D3X8YH3Y5X-N · Report a mismatch
  4. [4] § Results › Within-subjects analysis reveals that subgroups with distinct control strategies have distinct brain-behavior associations ↔ taskfmri/6_plotting/plotting_utils.py, lines 4 to 7 · score 0.85 · AntSalience, BasalGanglia, PostSalience, VisualAssoc, lFPN, rFPN · block oscr:b:8H2D3X8YH3Y5X-N · Report a mismatch
  5. [5] § Methods › Networks and regions of interest ↔ image_masks/make_DMN.py, the whole file · a weak match · score 0.82 · connected_components, connected_regions, Neurosynth automatic, retrieved, masks · block oscr:b:TBW3N3CEZ2M07-X · Report a mismatch
  6. [6] § Methods › Between- and within-subjects, general linear model analysis of fMRI ↔ taskfmri/6_plotting/ds_WB.py, lines 71 to 119 · score 0.81 · fetch_surf_fsaverage, plot_surf_stat_map, nilearn, mesh, surface, brain · block oscr:b:GM59N3T89281G-X · Report a mismatch
  7. [7] § Methods › Networks and regions of interest ↔ image_masks/make_subcortical_ROIs.py, lines 1 to 10 · score 0.80 · nonlinear asymmetric space, high resolution, MNI152, masks, subcortical, thresholded · block oscr:b:TMS043TGR7WPZ-1 · Report a mismatch
  8. [8] § Methods › Inclusion criteria ↔ taskfmri/0_subjectlist/inclusions_1_scanner_info_included_family_member.py, lines 25 to 78 · score 0.72 · genetic paired subjectid, pihat, siblings, family, scanner, variables · block oscr:b:DVAE1MP33DM13-I · Report a mismatch
  9. [9] § Methods › Networks and regions of interest ↔ taskfmri/6_plotting/resample.ipynb, lines 4 to 49 · score 0.69 · subcortical regions, Shirer regions, cognitive control regions, Shirer networks, Yeo, Pearson · Report a mismatch
  10. [10] § Methods › Brain imaging ↔ taskfmri/1_preprocess/im_proc.py, lines 31 to 88 · score 0.68 · smooth_img, affine, template, epi, motion, volumes · block oscr:b:FJ9H0HZBZ31K4-I · Report a mismatch
  11. [11] § Methods › Networks and regions of interest ↔ taskfmri/5_more_second_level/resample.py, lines 87 to 134 · score 0.66 · subcortical regions, Shirer regions, cognitive control regions, Shirer networks, Yeo, Pearson · block oscr:b:SCY8V21ZQ3GY0-8 · Report a mismatch
  12. [12] § Methods › Between- and within-subjects, general linear model analysis of fMRI ↔ taskfmri/3_individualstats/individualstats.py, lines 126 to 175 · score 0.64 · FirstLevelModel, design matrices, nilearn, signal, fit, models · block oscr:b:7QJETNR5XS6S0-Q · Report a mismatch
  13. [13] § Methods › Statistical testing ↔ taskfmri/5_more_second_level/permutations.ipynb, lines 390 to 475 · score 0.63 · permutation_test, Pearson correlation, correct go, coefficients, resamples, SSRT · Report a mismatch
  14. [14] § Results › Nonergodic brain-behavior associations using observed reaction time ↔ taskfmri/4_groupstats/groupstats.py, lines 165 to 295 · score 0.61 · dorsal attention, salience network, sensorimotor, precuneus, anterior, posterior · block oscr:b:24S8BA1KR4N19-W · Report a mismatch
  15. [15] § Methods › Statistical testing ↔ taskfmri/5_more_second_level/permutations.ipynb, lines 60 to 106 · score 0.57 · false_discovery_control, permutation_test, Scipy · Report a mismatch
  16. [16] § Methods › Representational similarity analysis ↔ taskfmri/6_plotting/rsa.ipynb, lines 58 to 89 · score 0.56 · common_norm, kdeplot, Density, clip, proactive delaying, correlation · Report a mismatch
  17. [17] § Methods › Between- and within-subjects, general linear model analysis of fMRI ↔ taskfmri/3_individualstats/individualstats.py, lines 57 to 68 · score 0.55 · FirstLevelModel, regression coefficients, voxel, fit, SST, fMRI · block oscr:b:A8ZYB2E7F4PB0-N · Report a mismatch
  18. [18] § Results › Dynamic cognitive process model of behavior ↔ taskfmri/6_plotting/overview.ipynb, lines 219 to 260 · score 0.53 · stopping expectancy, Stop signal, go process, arrow, proactivity · Report a mismatch

Paper

Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

Python · 27 lines · 870 B · no license · 3 matches

  1. """Utilities used for plotting."""
  2. # Order of Shirer networks:
  3. SHIRER_ORDER = ['AntSalience','PostSalience','lFPN','rFPN','DMN','RSC/PHG',
  4. 'Precuneus','Visuospatial','Language','VisualAssoc','Visual','Auditory',
  5. 'Sensorimotor','BasalGanglia']
  6. # Mapping from network names used in code to network names used in plots:
  7. MAPPING = {
  8. # Yeo-17
  9. 'SalVentAttn-1':'SalVAttn-1',
  10. 'SalVentAttn-2':'SalVAttn-2',
  11. # Shirer networks
  12. 'anterior_Salience':'AntSalience',
  13. 'post_Salience':'PostSalience',
  14. 'LECN':'lFPN',
  15. 'RECN':'rFPN',
  16. 'dorsal_DMN':'DMN',
  17. 'ventral_DMN':'RSC/PHG',
  18. 'high_Visual':'VisualAssoc',
  19. 'prim_Visual':'Visual',
  20. 'Basal_Ganglia':'BasalGanglia',
  21. }
  22. def final_roi_names(roi_names):
  23. return [MAPPING[roi] if roi in MAPPING else roi for roi in roi_names]

plotting_utils.py at commit b066a52, no license · at the source

Overview

  1. Department of Psychiatry & Behavioral Sciences, Stanford University School of Medicine, Stanford, CA USA
  2. Wu Tsai Neurosciences Institute, Stanford University, Stanford, CA USA
  3. Department of Neurology & Neurological Sciences, Stanford University School of Medicine, Stanford, CA USA
Institutions: Stanford Medicine (United States); Stanford University (United States)
Journal: Nature communications, volume 17, issue 1, article 3494
Dates: received 29 January 2025; accepted 12 March 2026; published online 27 April 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1038/s41467-026-71404-0 · PMID 42045209 · PMCID PMC13121725 · OpenAlex W4400490780
Open access: gold, a free copy (OpenAlex)
Status: code verified (how the code is found and verified)
Categories: human (organism), cognitive (subfield)
Methods: Connectivity, Statistics, Preprocessing, fMRI & imaging, Machine learning
Keywords: Cognitive control, Computational neuroscience, Human behaviour
MeSH: Brain*, Cognition*, Bayes Theorem, Brain Mapping, Female, Humans, Magnetic Resonance Imaging, Male (* major topic)
Topic: Functional Brain Connectivity Studies (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Funding: U.S. Department of Health & Human Services | National Institutes of Health (NIH) (MH121069, MH124816); National Science Foundation (NSF) (2024856)
Citations: not cited yet (Europe PMC); 80 references in the paper

Abstract

Nonergodicity and Simpson’s paradox present significant, yet underappreciated challenges in cognitive neuroscience. Leveraging brain imaging and behavioral data from over 4000 individuals and a Bayesian computational model of cognitive dynamics, we investigated brain-behavior relationships underlying cognitive control at both between-subjects and within-subjects levels. Strikingly, brain-behavior associations reversed across levels of analysis, revealing pervasive nonergodicity. Within-subjects analysis uncovered dissociated neural representations of reactive and proactive control and revealed that individuals who adaptively versus maladaptively regulated cognitive control exhibited distinct brain-behavior associations. Our findings demonstrate that between-subjects analyses can fundamentally mischaracterize within-individuals mechanisms, as group-level patterns not only disagreed with individual-level patterns but often reversed them. This work highlights the necessity of distinguishing between-subjects and within-subjects inferences in neuroscience, with implications for understanding cognitive mechanisms and designing personalized interventions.

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

Repositories

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

Zenodo 18626601

License: CC-BY-4.0
State: the link answers, verified on 30 September 2026
Evidence: files inventoried
Size: 1 file
Software Heritage: not checked
Found in: “Code availability”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: NumPy (35 files), pandas (29 files), Matplotlib (13 files), Nilearn (11 files), SciPy (10 files), seaborn (8 files), scikit-learn (5 files), FSL (2 files), Statistics and Machine Learning Toolbox (1 file), statsmodels (1 file)
Availability: 1 check, the latest on 30 September 2026: the link answers (HTTP 200)
  • 30 September 2026: the link answers (HTTP 200)
75 files
At the source:

scsnl/mistry_branigan_nonergodicity_2026

License: none: the authors keep all their rights
State: the link answers, verified on 30 September 2026
Evidence: files inventoried
Commit: b066a52ce857aff8287f75ae6971f15c3b4815a1, 12 February 2026
Languages: Python (53), Jupyter (9), MATLAB (8), Shell (4)
Size: 82 files, 74 scripts
Software Heritage: not archived
Found in: the Zenodo archive record
Holds: README, environment (environment.yml), tests, 9 notebooks
Not found: license file, CITATION.cff, continuous integration, documentation
Tools: NumPy (35 files), pandas (29 files), Matplotlib (13 files), Nilearn (11 files), SciPy (10 files), seaborn (8 files), scikit-learn (5 files), FSL (2 files), Statistics and Machine Learning Toolbox (1 file), statsmodels (1 file)
Availability: 1 check, the latest on 30 September 2026: the link answers
  • 30 September 2026: the link answers
75 files

Code availability

All code used in this study has been archived at 10.5281/zenodo.18626601.

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

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;
  • 148 scripts, each with its path and the digest of its content;
  • 18 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

Data used in this study were from the ABCD study (https://abcdstudy.org/), held in the National Institute of Mental Health Data Archive. These data are available to eligible researchers. Source data are provided with this paper.

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, 30 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 5 authors, 3 keywords, 8 MeSH terms, 2 funders, 68 references.

Cite

This paper

Mistry, P. K., Branigan, N. K., Gao, Z., Cai, W., & Menon, V. (2026). Nonergodicity and Simpson's paradox in neurocognitive dynamics of cognitive control. Nature communications, 17(1), 3494. https://doi.org/10.1038/s41467-026-71404-0

BibTeX

@article{mistry2026nonergodicity,
author = {Mistry, Percy K and Branigan, Nicholas K and Gao, Zhiyao and Cai, Weidong and Menon, Vinod},
title = {{Nonergodicity and Simpson's paradox in neurocognitive dynamics of cognitive control}},
journal = {Nature communications},
year = {2026},
month = apr,
volume = {17},
number = {1},
pages = {3494},
publisher = {Nature Publishing Group},
issn = {2041-1723},
doi = {10.1038/s41467-026-71404-0},
url = {https://doi.org/10.1038/s41467-026-71404-0},
pmid = {42045209},
pmcid = {PMC13121725}
}

RIS

TY - JOUR
AU - Mistry, Percy K
AU - Branigan, Nicholas K
AU - Gao, Zhiyao
AU - Cai, Weidong
AU - Menon, Vinod
TI - Nonergodicity and Simpson's paradox in neurocognitive dynamics of cognitive control
T2 - Nature communications
J2 - Nat Commun
PY - 2026
DA - 2026/04/27
VL - 17
IS - 1
SP - 3494
SN - 2041-1723
PB - Nature Publishing Group
DO - 10.1038/s41467-026-71404-0
UR - https://doi.org/10.1038/s41467-026-71404-0
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41467-026-71404-0",
"type": "article-journal",
"title": "Nonergodicity and Simpson's paradox in neurocognitive dynamics of cognitive control",
"container-title": "Nature communications",
"author": [
{
"family": "Mistry",
"given": "Percy K"
},
{
"family": "Branigan",
"given": "Nicholas K"
},
{
"family": "Gao",
"given": "Zhiyao"
},
{
"family": "Cai",
"given": "Weidong"
},
{
"family": "Menon",
"given": "Vinod"
}
],
"container-title-short": "Nat Commun",
"volume": "17",
"issue": "1",
"page": "3494",
"DOI": "10.1038/s41467-026-71404-0",
"PMID": "42045209",
"PMCID": "PMC13121725",
"ISSN": "2041-1723",
"publisher": "Nature Publishing Group",
"URL": "https://doi.org/10.1038/s41467-026-71404-0",
"language": "en",
"issued": {
"date-parts": [
[
2026,
4,
27
]
]
}
}

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.1038/s41467-025-57685-x [code]
Reduced temporal and spatial stability of neural activity patterns predict cognitive control deficits in children with ADHD.
Journal: Nature communications
In common: Statistics and Machine Learning Toolbox, cognitive, 12 references, 3 authors
[2] doi:10.1038/s41467-024-46511-5 [code]
A multi-demand operating system underlying diverse cognitive tasks.
Journal: Nature communications
In common: seaborn, Statistics and Machine Learning Toolbox, scikit-learn, 4 other tools, cognitive, 6 references, 2 authors
[3] doi:10.1073/pnas.2315167121 [code]
Space wandering in the rodent default mode network.
Journal: Proceedings of the National Academy of Sciences of the United States of America
In common: statsmodels, scikit-learn, pandas, 3 other tools, 1 reference, 3 authors
[4] doi:10.1073/pnas.2316149121 [code]
Subthalamic nucleus-language network connectivity predicts dopaminergic modulation of speech function in Parkinson's disease.
Journal: Proceedings of the National Academy of Sciences of the United States of America
In common: Statistics and Machine Learning Toolbox, cognitive, 6 references, 2 authors
[5] doi:10.1016/j.cell.2025.11.039 [code]
Stimulant medications affect arousal and reward, not attention networks.
Journal: Cell
In common: Nilearn, FSL, statsmodels, 7 other tools, 6 references
[6] doi:10.1073/pnas.2310012121 [code]
Deep learning models reveal replicable, generalizable, and behaviorally relevant sex differences in human functional brain organization.
Journal: Proceedings of the National Academy of Sciences of the United States of America
In common: Nilearn, FSL, seaborn, 6 other tools, 3 references, author Vinod Menon
[7] doi:10.1038/s41467-024-54564-9 [code]
Multiple insular-prefrontal pathways underlie perception to execution during response inhibition in humans.
Journal: Nature communications
In common: 10 references
[8] doi:10.1038/s41467-022-29766-8 [code]
Shared and unique brain network features predict cognitive, personality, and mental health scores in the ABCD study.
Journal: Nature communications
In common: Nilearn, FSL, Statistics and Machine Learning Toolbox, 5 other tools, 7 references
[9] doi:10.1016/j.neuroimage.2021.118843 [code]
Functional brain network community structure in childhood: Unfinished territories and fuzzy boundaries.
Journal: NeuroImage
In common: Nilearn, FSL, seaborn, 6 other tools, 6 references
[10] doi:10.1111/psyp.70397 [code]
Cortical Contributions to Attentional Orienting and Response Cancellation in Action Stopping.
Journal: Psychophysiology
In common: statsmodels, seaborn, scikit-learn, 4 other tools, cognitive, 5 references

Contribute

The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.

Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.

Add the badge to the code's README

OSCR: the badge of this paper

If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.

Markdown
<!-- oscr-badge:start -->
[![OSCR](https://openscicode.org/badge/doi/10.1038/s41467-026-71404-0.svg)](https://openscicode.org/badge/doi/10.1038/s41467-026-71404-0)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.1038/s41467-026-71404-0.svg
   :target: https://openscicode.org/badge/doi/10.1038/s41467-026-71404-0
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1038/s41467-026-71404-0"><img src="https://openscicode.org/badge/doi/10.1038/s41467-026-71404-0.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->

On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".

If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.

Request its removal

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

Discussion, reproductions, activity

Discussion: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.

Report a mismatch between the code and the paper · Report a code error (signed in)

Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.

Report a reproduction failure (signed in)

Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.

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