@brainpilot/skills 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/package.json +35 -0
- package/skills/01_Meta-Skills/contribute-skill/SKILL.md +277 -0
- package/skills/01_Meta-Skills/contribute-skills-via-pr/SKILL.md +163 -0
- package/skills/01_Meta-Skills/paper-to-skill/SKILL.md +435 -0
- package/skills/01_Meta-Skills/paper-to-skill/references/extraction-guide.md +286 -0
- package/skills/01_Meta-Skills/paper-to-skill/references/skill-template.md +250 -0
- package/skills/01_Meta-Skills/repo-to-skill/SKILL.md +289 -0
- package/skills/01_Meta-Skills/share-case/SKILL.md +253 -0
- package/skills/01_Meta-Skills/share-usage/README.md +63 -0
- package/skills/01_Meta-Skills/share-usage/SKILL.md +395 -0
- package/skills/01_Meta-Skills/verify-skill/SKILL.md +331 -0
- package/skills/02_Cross-Domain_Foundation/cogsci-power-analysis/SKILL.md +194 -0
- package/skills/02_Cross-Domain_Foundation/cogsci-power-analysis/references/effect-sizes.md +352 -0
- package/skills/02_Cross-Domain_Foundation/cogsci-power-analysis/references/sample-size-guide.md +407 -0
- package/skills/02_Cross-Domain_Foundation/cogsci-statistics/SKILL.md +361 -0
- package/skills/02_Cross-Domain_Foundation/cogsci-statistics/references/common-analyses.md +517 -0
- package/skills/02_Cross-Domain_Foundation/cogsci-visualization/SKILL.md +292 -0
- package/skills/02_Cross-Domain_Foundation/cogsci-visualization/references/plot-recipes.md +709 -0
- package/skills/02_Cross-Domain_Foundation/research-literacy/SKILL.md +286 -0
- package/skills/02_Cross-Domain_Foundation/research-literacy/references/common-assumptions.md +320 -0
- package/skills/02_Cross-Domain_Foundation/research-literacy/references/planning-template.md +143 -0
- package/skills/03_Cognitive_Psychology/alternative-uses-task-designer/SKILL.md +197 -0
- package/skills/03_Cognitive_Psychology/alternative-uses-task-designer/references/instruction-templates.md +60 -0
- package/skills/03_Cognitive_Psychology/cognitive-paradigm-design/SKILL.md +246 -0
- package/skills/03_Cognitive_Psychology/cognitive-paradigm-design/references/classic-paradigms.md +435 -0
- package/skills/03_Cognitive_Psychology/cognitive-paradigm-design/references/design-principles.md +256 -0
- package/skills/03_Cognitive_Psychology/creativity-self-efficacy-mediation/SKILL.md +270 -0
- package/skills/03_Cognitive_Psychology/creativity-self-efficacy-mediation/references/lavaan-templates.md +172 -0
- package/skills/03_Cognitive_Psychology/divergent-thinking-scoring/SKILL.md +238 -0
- package/skills/03_Cognitive_Psychology/divergent-thinking-scoring/references/scoring-rubric.md +143 -0
- package/skills/03_Cognitive_Psychology/drift-diffusion-model/SKILL.md +203 -0
- package/skills/03_Cognitive_Psychology/drift-diffusion-model/references/fitting-guide.md +571 -0
- package/skills/03_Cognitive_Psychology/drift-diffusion-model/references/model-variants.md +427 -0
- package/skills/03_Cognitive_Psychology/evidence-accumulation-selector/SKILL.md +310 -0
- package/skills/03_Cognitive_Psychology/evidence-accumulation-selector/references/ez-diffusion-formulas.md +137 -0
- package/skills/03_Cognitive_Psychology/signal-detection-analysis/SKILL.md +300 -0
- package/skills/03_Cognitive_Psychology/signal-detection-analysis/references/application-guide.md +278 -0
- package/skills/03_Cognitive_Psychology/signal-detection-analysis/references/sdt-formulas.md +318 -0
- package/skills/03_Cognitive_Psychology/visual-search-array-generator/SKILL.md +283 -0
- package/skills/03_Cognitive_Psychology/visual-search-array-generator/references/array-generation-parameters.yaml +111 -0
- package/skills/04_Psycholinguistics/reading-time-analysis/SKILL.md +301 -0
- package/skills/04_Psycholinguistics/reading-time-analysis/references/measure-computation-guide.md +195 -0
- package/skills/04_Psycholinguistics/self-paced-reading-designer/SKILL.md +257 -0
- package/skills/04_Psycholinguistics/self-paced-reading-designer/references/analysis-guide.md +356 -0
- package/skills/04_Psycholinguistics/self-paced-reading-designer/references/region-segmentation.md +266 -0
- package/skills/04_Psycholinguistics/sentence-stimulus-norming/SKILL.md +346 -0
- package/skills/04_Psycholinguistics/sentence-stimulus-norming/references/lexical-databases-guide.md +184 -0
- package/skills/05_EEG_ERP/eeg-paradigm-designer/SKILL.md +226 -0
- package/skills/05_EEG_ERP/eeg-paradigm-designer/references/component-paradigm-map.md +276 -0
- package/skills/05_EEG_ERP/eeg-paradigm-designer/references/timing-parameters.md +244 -0
- package/skills/05_EEG_ERP/eeg-preprocessing-pipeline-guide/SKILL.md +367 -0
- package/skills/05_EEG_ERP/eeg-preprocessing-pipeline-guide/references/parameter-lookup-tables.md +138 -0
- package/skills/05_EEG_ERP/erp-analysis/SKILL.md +185 -0
- package/skills/05_EEG_ERP/erp-analysis/references/erp-components.md +447 -0
- package/skills/05_EEG_ERP/erp-analysis/references/preprocessing-pipeline.md +277 -0
- package/skills/05_EEG_ERP/erp-analysis/references/statistical-approaches.md +351 -0
- package/skills/05_EEG_ERP/mne-python-guide/SKILL.md +174 -0
- package/skills/05_EEG_ERP/mne-python-guide/references/decoding.md +178 -0
- package/skills/05_EEG_ERP/mne-python-guide/references/io_formats.md +160 -0
- package/skills/05_EEG_ERP/mne-python-guide/references/preprocessing.md +259 -0
- package/skills/05_EEG_ERP/mne-python-guide/references/simulation.md +173 -0
- package/skills/05_EEG_ERP/mne-python-guide/references/source_localization.md +234 -0
- package/skills/05_EEG_ERP/mne-python-guide/references/statistics.md +196 -0
- package/skills/05_EEG_ERP/mne-python-guide/references/time_frequency.md +165 -0
- package/skills/05_EEG_ERP/mne-python-guide/references/visualization.md +175 -0
- package/skills/06_fMRI_Neuroimaging/brain-connectivity-modeler/SKILL.md +317 -0
- package/skills/06_fMRI_Neuroimaging/brain-connectivity-modeler/references/method-implementation-guide.md +116 -0
- package/skills/06_fMRI_Neuroimaging/fmri-glm-analysis-guide/SKILL.md +296 -0
- package/skills/06_fMRI_Neuroimaging/fmri-glm-analysis-guide/references/design-matrix-guide.md +214 -0
- package/skills/06_fMRI_Neuroimaging/fmri-glm-analysis-guide/references/statistical-inference.md +288 -0
- package/skills/06_fMRI_Neuroimaging/fmri-preprocessing-pipeline-guide/SKILL.md +274 -0
- package/skills/06_fMRI_Neuroimaging/fmri-preprocessing-pipeline-guide/references/quality-control.md +336 -0
- package/skills/06_fMRI_Neuroimaging/fmri-preprocessing-pipeline-guide/references/step-by-step-pipeline.md +380 -0
- package/skills/06_fMRI_Neuroimaging/fmri-task-design-guide/SKILL.md +264 -0
- package/skills/06_fMRI_Neuroimaging/fmri-task-design-guide/references/design-optimization-examples.md +114 -0
- package/skills/06_fMRI_Neuroimaging/neural-decoding-analysis/SKILL.md +273 -0
- package/skills/06_fMRI_Neuroimaging/neural-decoding-analysis/references/decoding-methods.md +170 -0
- package/skills/06_fMRI_Neuroimaging/neural-decoding-analysis/references/rsa-guide.md +266 -0
- package/skills/06_fMRI_Neuroimaging/pycortex-guide/SKILL.md +123 -0
- package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/database-subjects.md +179 -0
- package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/dataset-types.md +208 -0
- package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/freesurfer-fmriprep.md +162 -0
- package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/mapping-transforms.md +181 -0
- package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/mni-utils.md +207 -0
- package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/surface-analysis.md +219 -0
- package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/visualization.md +251 -0
- package/skills/07_Computational_Modeling/act-r-model-builder/SKILL.md +297 -0
- package/skills/07_Computational_Modeling/act-r-model-builder/references/model-patterns.md +197 -0
- package/skills/07_Computational_Modeling/act-r-model-builder/references/parameter-table.yaml +204 -0
- package/skills/07_Computational_Modeling/bayesian-cognitive-model-builder/SKILL.md +294 -0
- package/skills/07_Computational_Modeling/bayesian-cognitive-model-builder/references/diagnostics-checklist.md +351 -0
- package/skills/07_Computational_Modeling/bayesian-cognitive-model-builder/references/prior-selection-guide.md +241 -0
- package/skills/07_Computational_Modeling/parameter-recovery-checker/SKILL.md +269 -0
- package/skills/07_Computational_Modeling/parameter-recovery-checker/references/recovery-diagnostics.md +207 -0
- package/skills/08_Computational_Neuroscience/brain-connectivity-modeler/SKILL.md +317 -0
- package/skills/08_Computational_Neuroscience/brain-connectivity-modeler/references/method-implementation-guide.md +116 -0
- package/skills/08_Computational_Neuroscience/neural-decoding-analysis/SKILL.md +273 -0
- package/skills/08_Computational_Neuroscience/neural-decoding-analysis/references/decoding-methods.md +170 -0
- package/skills/08_Computational_Neuroscience/neural-decoding-analysis/references/rsa-guide.md +266 -0
- package/skills/08_Computational_Neuroscience/neural-population-analysis-guide/SKILL.md +305 -0
- package/skills/08_Computational_Neuroscience/neural-population-analysis-guide/references/data-requirements.md +60 -0
- package/skills/08_Computational_Neuroscience/neural-population-analysis-guide/references/method-comparison.md +151 -0
- package/skills/08_Computational_Neuroscience/spiking-network-model-builder/SKILL.md +376 -0
- package/skills/08_Computational_Neuroscience/spiking-network-model-builder/references/hh-parameters.md +117 -0
- package/skills/08_Computational_Neuroscience/spiking-network-model-builder/references/network-regimes.md +130 -0
- package/skills/09_Cellular_Molecular_Neuroscience/calcium-imaging-analysis-guide/SKILL.md +258 -0
- package/skills/09_Cellular_Molecular_Neuroscience/calcium-imaging-analysis-guide/references/indicator-parameters.md +242 -0
- package/skills/09_Cellular_Molecular_Neuroscience/calcium-imaging-analysis-guide/references/pipeline-details.md +211 -0
- package/skills/09_Cellular_Molecular_Neuroscience/optogenetics-protocol-designer/SKILL.md +261 -0
- package/skills/09_Cellular_Molecular_Neuroscience/optogenetics-protocol-designer/references/opsin-catalog.md +124 -0
- package/skills/09_Cellular_Molecular_Neuroscience/optogenetics-protocol-designer/references/stimulation-parameters.md +304 -0
- package/skills/10_Clinical_Neuropsychology/lesion-symptom-mapping-guide/SKILL.md +367 -0
- package/skills/10_Clinical_Neuropsychology/lesion-symptom-mapping-guide/references/disconnection-guide.md +152 -0
- package/skills/10_Clinical_Neuropsychology/lesion-symptom-mapping-guide/references/vlsm-pipeline.md +182 -0
- package/skills/10_Clinical_Neuropsychology/neuropsych-battery-selector/SKILL.md +250 -0
- package/skills/10_Clinical_Neuropsychology/neuropsych-battery-selector/references/deficit-profiles.md +302 -0
- package/skills/10_Clinical_Neuropsychology/neuropsych-battery-selector/references/test-catalog.md +304 -0
- package/skills/11_Developmental_Cognition/infant-looking-time-designer/SKILL.md +345 -0
- package/skills/11_Developmental_Cognition/infant-looking-time-designer/references/age-parameters.yaml +186 -0
- package/skills/12_Social_Cognition/tom-task-selector/SKILL.md +379 -0
- package/skills/12_Social_Cognition/tom-task-selector/references/task-database.md +317 -0
- package/skills/13_Visualization/nature-figure/README.md +442 -0
- package/skills/13_Visualization/nature-figure/SKILL.md +60 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-01-bar-charts.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-02-line-trends.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-03-heatmaps.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-04-scatter-bubble.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-05-radar-polar.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-06-distributions.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-07-forest-interval.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-08-area-stacked.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-09-image-plates.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-10-network-matrix.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/Dispersion_motivation.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/Dispersion_observation.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/Dispersion_observation_distillation.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/ImmunoStruct_contrastive.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/ImmunoStruct_results_CEDAR.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/ImmunoStruct_results_IEDB.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/ImmunoStruct_schematic.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/RNAGenScape_schematic.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_CellSpliceNet/figures/ablation.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_CellSpliceNet/figures/comparison.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_CellSpliceNet/plot_ablation.py +86 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_CellSpliceNet/plot_comparison.py +109 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/diffusion_swiss_roll.py +97 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/diffusion_swiss_roll.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/fig2_comparison_GeneRegulatory.pdf +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/fig2_comparison_GeneRegulatory.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/fig2_comparison_Trajectory.pdf +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/fig2_comparison_Trajectory.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/figX_comparison_Ablation.pdf +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/figX_comparison_Ablation.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/plot_comparison_Ablation.py +64 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/plot_comparison_GeneRegulatory.py +74 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/plot_comparison_Trajectory.py +74 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Dispersion/figures/idea.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Dispersion/figures/illustration.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Dispersion/plot_idea.py +76 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Dispersion/plot_illustration.py +404 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_FPGM/figures/freq_prior.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_FPGM/plot_freq_prior.py +146 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/figures/bars_ablation_Cancer.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/figures/bars_ablation_IEDB.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/figures/bars_comparison_Cancer.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/figures/bars_comparison_IEDB.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/plot_bars.py +216 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/raw_data.py +125 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/figures/manifold.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/figures/manifold_holes.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/figures/results_comparison_optimization.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/figures/results_comparison_speed.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/figures/results_sweep.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/plot_comparison.py +228 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/plot_hole_manifold.py +82 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/plot_manifold.py +61 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/plot_sweep.py +77 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_VIGIL/figures/comparison_posttraining.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_VIGIL/figures/comparison_radar.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_VIGIL/plot_comparison_radar.py +173 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_VIGIL/plot_posttraining.py +82 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/figures/brute_force.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/figures/correctness_by_category.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/figures/correctness_by_subcategory.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/figures/rewriting.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/figures/selfcorrection_math.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/plot_brute_force.py +248 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/plot_correctness_by_category.py +132 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/plot_correctness_by_subcategory.py +131 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/plot_rewriting.py +105 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/plot_selfcorrection_math.py +99 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ophthal_review/figures/composition_heatmap.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ophthal_review/figures/trend_by_month.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ophthal_review/plot_composition.py +81 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ophthal_review/plot_trend.py +125 -0
- package/skills/13_Visualization/nature-figure/assets/gallery/fig1-material-mechanism-rich.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/gallery/fig2-spatial-imaging-rich.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/gallery/fig3-in-vivo-efficacy-rich.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/gallery/fig4-single-cell-systems-rich.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/gallery/fig5-validation-perturbation-rich.png +0 -0
- package/skills/13_Visualization/nature-figure/evals/evals.json +37 -0
- package/skills/13_Visualization/nature-figure/manifest.yaml +57 -0
- package/skills/13_Visualization/nature-figure/references/api.md +428 -0
- package/skills/13_Visualization/nature-figure/references/backend-selection.md +100 -0
- package/skills/13_Visualization/nature-figure/references/chart-types.md +281 -0
- package/skills/13_Visualization/nature-figure/references/common-patterns.md +350 -0
- package/skills/13_Visualization/nature-figure/references/demos.md +65 -0
- package/skills/13_Visualization/nature-figure/references/design-theory.md +436 -0
- package/skills/13_Visualization/nature-figure/references/figure-contract.md +93 -0
- package/skills/13_Visualization/nature-figure/references/nature-2026-observations.md +112 -0
- package/skills/13_Visualization/nature-figure/references/qa-contract.md +119 -0
- package/skills/13_Visualization/nature-figure/references/r-template-index.md +66 -0
- package/skills/13_Visualization/nature-figure/references/r-workflow.md +161 -0
- package/skills/13_Visualization/nature-figure/references/tutorials.md +251 -0
- package/skills/13_Visualization/nature-figure/static/core/contract.md +29 -0
- package/skills/13_Visualization/nature-figure/static/core/stance.md +37 -0
- package/skills/13_Visualization/nature-figure/static/fragments/backend/python.md +37 -0
- package/skills/13_Visualization/nature-figure/static/fragments/backend/r.md +44 -0
- package/skills/14_Writing/markdown-report-writing/SKILL.md +306 -0
- package/skills/14_Writing/markdown-report-writing/references/compatibility-matrix.md +72 -0
- package/skills/14_Writing/markdown-report-writing/references/templates.md +299 -0
- package/skills/15_Others/neuroimaging-power-guide/SKILL.md +324 -0
- package/skills/15_Others/neuroimaging-power-guide/references/effect-size-lookup-tables.md +102 -0
- package/skills/15_Others/neuroimaging-sample-size-calculator/SKILL.md +330 -0
- package/skills/15_Others/neuroimaging-sample-size-calculator/references/worked-examples.md +220 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# Effect Size Lookup Tables for Neuroimaging
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
This reference provides empirically derived effect size benchmarks for common neuroimaging paradigms, organized by analysis type. These values can be used as starting points for power analysis when pilot data are unavailable.
|
|
6
|
+
|
|
7
|
+
**Important caveat**: Published effect sizes are likely inflated due to publication bias and the "winner's curse" (Button et al., 2013). When using these values for power analysis, consider using 50-75% of the reported effect as a more realistic estimate.
|
|
8
|
+
|
|
9
|
+
## fMRI Task Activation Effect Sizes
|
|
10
|
+
|
|
11
|
+
### Sensory and Motor Paradigms
|
|
12
|
+
|
|
13
|
+
| Paradigm | Region | Typical d | Typical % Signal Change | Source |
|
|
14
|
+
|---|---|---|---|---|
|
|
15
|
+
| Visual checkerboard | V1 | 1.5-3.0 | 2-5% | Poldrack et al., 2017 |
|
|
16
|
+
| Finger tapping | M1 | 1.0-2.5 | 1-3% | Poldrack et al., 2017 |
|
|
17
|
+
| Auditory tone | A1 | 0.8-2.0 | 0.5-2% | Poldrack et al., 2017 |
|
|
18
|
+
| Face viewing | FFA | 0.8-1.5 | 0.5-1.5% | Kanwisher et al., 1997 |
|
|
19
|
+
|
|
20
|
+
### Cognitive Paradigms
|
|
21
|
+
|
|
22
|
+
| Paradigm | Typical Region | Typical d | Source |
|
|
23
|
+
|---|---|---|---|
|
|
24
|
+
| Working memory (n-back) | dlPFC, parietal | 0.5-1.0 | Owen et al., 2005 |
|
|
25
|
+
| Stroop interference | ACC, dlPFC | 0.4-0.8 | Nee et al., 2007 |
|
|
26
|
+
| Episodic memory encoding | MTL, PFC | 0.3-0.8 | Kim, 2011 |
|
|
27
|
+
| Language (semantic) | Left temporal, IFG | 0.5-1.0 | Binder et al., 2009 |
|
|
28
|
+
| Emotion (faces > shapes) | Amygdala | 0.3-0.7 | Hariri et al., 2002 |
|
|
29
|
+
|
|
30
|
+
### Between-Group Differences
|
|
31
|
+
|
|
32
|
+
| Comparison | Typical d | Sample Needed (80% power, corrected) | Source |
|
|
33
|
+
|---|---|---|---|
|
|
34
|
+
| Patient vs. control (task activation) | 0.5-0.8 | 25-50 per group | Poldrack et al., 2017 |
|
|
35
|
+
| Patient vs. control (resting connectivity) | 0.3-0.6 | 40-80 per group | Marek et al., 2022 |
|
|
36
|
+
| Age group differences | 0.3-0.7 | 30-60 per group | Grady, 2012 |
|
|
37
|
+
| Sex differences (task) | 0.2-0.5 | 50-100+ per group | Poldrack et al., 2017 |
|
|
38
|
+
|
|
39
|
+
## ERP Effect Sizes
|
|
40
|
+
|
|
41
|
+
### Classic ERP Components
|
|
42
|
+
|
|
43
|
+
| Component | Paradigm | Typical d (within-subject) | Typical Amplitude | Minimum Trials | Source |
|
|
44
|
+
|---|---|---|---|---|---|
|
|
45
|
+
| P300 (P3b) | Oddball | 0.8-1.5 | 5-15 uV | 20 | Luck, 2014 |
|
|
46
|
+
| N400 | Semantic violation | 0.5-1.0 | 2-5 uV | 30 | Kutas & Federmeier, 2011 |
|
|
47
|
+
| N170 | Face vs. object | 0.5-1.0 | 3-8 uV | 30 | Rossion & Jacques, 2008 |
|
|
48
|
+
| MMN | Auditory deviant | 0.4-0.8 | 1-3 uV | 100+ deviants | Naatanen et al., 2007 |
|
|
49
|
+
| ERN | Error vs. correct | 0.5-1.0 | 3-10 uV | 6+ errors minimum | Olvet & Hajcak, 2009 |
|
|
50
|
+
| LPP | Emotional vs. neutral | 0.3-0.7 | 2-5 uV | 30 | Hajcak et al., 2010 |
|
|
51
|
+
| N2pc | Attention lateralization | 0.4-0.8 | 1-3 uV | 200+ | Luck, 2012 |
|
|
52
|
+
|
|
53
|
+
### Between-Group ERP Effects
|
|
54
|
+
|
|
55
|
+
| Comparison | Component | Typical d | N Needed (80% power) | Source |
|
|
56
|
+
|---|---|---|---|---|
|
|
57
|
+
| Anxiety vs. control | ERN | 0.4-0.6 | 35-50 per group | Olvet & Hajcak, 2009 |
|
|
58
|
+
| Depression vs. control | P300 | 0.3-0.5 | 50-80 per group | Luck, 2014 |
|
|
59
|
+
| Young vs. elderly | N400 | 0.4-0.7 | 30-50 per group | Kutas & Federmeier, 2011 |
|
|
60
|
+
|
|
61
|
+
## EEG Oscillatory Effect Sizes
|
|
62
|
+
|
|
63
|
+
| Measure | Typical d | Typical N | Source |
|
|
64
|
+
|---|---|---|---|
|
|
65
|
+
| Alpha power (eyes closed vs. open) | 1.0-2.0 | 10-15 | Cohen, 2014 |
|
|
66
|
+
| Alpha lateralization (attention task) | 0.3-0.6 | 25-40 | Cohen, 2014 |
|
|
67
|
+
| Theta power (WM load) | 0.4-0.8 | 20-35 | Cohen, 2014 |
|
|
68
|
+
| Gamma power (perceptual binding) | 0.2-0.5 | 30-60 | Cohen, 2014 |
|
|
69
|
+
| Phase-amplitude coupling | 0.3-0.6 | 25-40 | Cohen, 2014 |
|
|
70
|
+
|
|
71
|
+
## Correction for Publication Bias
|
|
72
|
+
|
|
73
|
+
Published effect sizes are inflated because:
|
|
74
|
+
1. Studies with larger effects are more likely to be published
|
|
75
|
+
2. Small studies that find significant effects necessarily have inflated effect sizes ("winner's curse")
|
|
76
|
+
3. Analytic flexibility (researcher degrees of freedom) inflates reported effects
|
|
77
|
+
|
|
78
|
+
**Correction heuristic** (Button et al., 2013):
|
|
79
|
+
- For well-replicated effects (meta-analyses with many studies): use **75%** of the meta-analytic estimate
|
|
80
|
+
- For single-study effects: use **50%** of the reported effect
|
|
81
|
+
- For very small studies (N < 20): use **40%** of the reported effect
|
|
82
|
+
|
|
83
|
+
## References
|
|
84
|
+
|
|
85
|
+
- Binder, J. R., Desai, R. H., Graves, W. W., & Conant, L. L. (2009). Where is the semantic system? *Cerebral Cortex*, 19(12), 2767-2796.
|
|
86
|
+
- Button, K. S., Ioannidis, J. P. A., Mokrysz, C., et al. (2013). Power failure. *Nature Reviews Neuroscience*, 14(5), 365-376.
|
|
87
|
+
- Cohen, M. X. (2014). *Analyzing Neural Time Series Data*. MIT Press.
|
|
88
|
+
- Grady, C. (2012). The cognitive neuroscience of ageing. *Nature Reviews Neuroscience*, 13, 491-505.
|
|
89
|
+
- Hajcak, G., MacNamara, A., & Olvet, D. M. (2010). Event-related potentials, emotion, and emotion regulation. *Journal of Abnormal Psychology*, 119(1), 126-135.
|
|
90
|
+
- Hariri, A. R., Tessitore, A., Mattay, V. S., et al. (2002). The amygdala response to emotional stimuli. *NeuroImage*, 17(1), 317-323.
|
|
91
|
+
- Kanwisher, N., McDermott, J., & Chun, M. M. (1997). The fusiform face area. *Journal of Neuroscience*, 17(11), 4302-4311.
|
|
92
|
+
- Kim, H. (2011). Neural activity that predicts subsequent memory and forgetting. *NeuroImage*, 54(3), 2446-2461.
|
|
93
|
+
- Kutas, M., & Federmeier, K. D. (2011). Thirty years and counting: Finding meaning in the N400 component. *Annual Review of Psychology*, 62, 621-647.
|
|
94
|
+
- Luck, S. J. (2012). Electrophysiological correlates of the focusing of attention within complex visual scenes. In *Cognitive Electrophysiology of Attention*, 329-346.
|
|
95
|
+
- Luck, S. J. (2014). *An Introduction to the Event-Related Potential Technique* (2nd ed.). MIT Press.
|
|
96
|
+
- Marek, S., Tervo-Clemmens, B., Calabro, F. J., et al. (2022). Reproducible brain-wide association studies require thousands of individuals. *Nature*, 603(7902), 654-660.
|
|
97
|
+
- Naatanen, R., Paavilainen, P., Rinne, T., & Alho, K. (2007). The mismatch negativity (MMN) in basic research of central auditory processing. *Clinical Neurophysiology*, 118(12), 2544-2590.
|
|
98
|
+
- Nee, D. E., Wager, T. D., & Jonides, J. (2007). Interference resolution: Insights from a meta-analysis of neuroimaging tasks. *Cognitive, Affective, & Behavioral Neuroscience*, 7(1), 1-17.
|
|
99
|
+
- Olvet, D. M., & Hajcak, G. (2009). The stability of error-related brain activity with increasing number of trials. *Psychophysiology*, 46(5), 957-961.
|
|
100
|
+
- Owen, A. M., McMillan, K. M., Laird, A. R., & Bullmore, E. (2005). N-back working memory paradigm: A meta-analysis. *Human Brain Mapping*, 25(1), 46-59.
|
|
101
|
+
- Poldrack, R. A., Baker, C. I., Durnez, J., et al. (2017). Scanning the horizon. *Nature Reviews Neuroscience*, 18(2), 115-126.
|
|
102
|
+
- Rossion, B., & Jacques, C. (2008). Does physical interstimulus variance account for early electrophysiological face sensitive responses? *NeuroImage*, 39(3), 1694-1703.
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "neuroimaging-sample-size-calculator"
|
|
3
|
+
description: "Simulation-based sample-size planning for neuroimaging studies using effect-size maps"
|
|
4
|
+
domain: "cross-cutting-methodology"
|
|
5
|
+
version: "1.0.0"
|
|
6
|
+
authors:
|
|
7
|
+
- "awesome_cognitive_and_neuroscience_skills contributors"
|
|
8
|
+
papers:
|
|
9
|
+
- "Mumford & Nichols, 2008"
|
|
10
|
+
- "Durnez et al., 2016"
|
|
11
|
+
- "Marek et al., 2022"
|
|
12
|
+
- "Poldrack et al., 2017"
|
|
13
|
+
- "Turner et al., 2018"
|
|
14
|
+
- "Joyce & Hayasaka, 2012"
|
|
15
|
+
dependencies:
|
|
16
|
+
required:
|
|
17
|
+
- research-literacy
|
|
18
|
+
recommended:
|
|
19
|
+
- neuroimaging-power-guide
|
|
20
|
+
- fmri-glm-analysis-guide
|
|
21
|
+
review_status: "ai-generated"
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
# Neuroimaging Sample Size Calculator
|
|
25
|
+
|
|
26
|
+
## Purpose
|
|
27
|
+
|
|
28
|
+
Traditional power analysis (e.g., using G*Power for a t-test) fails for neuroimaging because it cannot account for the massive multiple comparisons problem, spatial correlation structure, or the multi-level nature of neuroimaging inference. Neuroimaging requires simulation-based approaches that generate synthetic datasets, apply the full analysis pipeline including multiple comparison correction, and estimate power as the proportion of simulations detecting the effect.
|
|
29
|
+
|
|
30
|
+
A competent programmer without neuroimaging training would use standard power formulas and dramatically overestimate the power of a whole-brain analysis. They would not know that cluster-extent thresholds, random field theory corrections, and spatial smoothness all affect the effective number of tests, nor that pilot-data-based simulation is the gold standard for neuroimaging power analysis. This skill encodes the domain-specific methodology for simulation-based sample size planning.
|
|
31
|
+
|
|
32
|
+
## When to Use This Skill
|
|
33
|
+
|
|
34
|
+
- Planning sample size for a new fMRI, EEG, or MEG study
|
|
35
|
+
- Conducting power analysis for a grant application or registered report
|
|
36
|
+
- Estimating required N when pilot data or published effect size maps are available
|
|
37
|
+
- Choosing between whole-brain and ROI-based analysis based on power constraints
|
|
38
|
+
- Evaluating the statistical adequacy of a proposed or completed study
|
|
39
|
+
|
|
40
|
+
## Research Planning Protocol
|
|
41
|
+
|
|
42
|
+
Before executing the domain-specific steps below, you MUST:
|
|
43
|
+
|
|
44
|
+
1. **State the research question** — What specific question is this analysis/paradigm addressing?
|
|
45
|
+
2. **Justify the method choice** — Why is this approach appropriate? What alternatives were considered?
|
|
46
|
+
3. **Declare expected outcomes** — What results would support vs. refute the hypothesis?
|
|
47
|
+
4. **Note assumptions and limitations** — What does this method assume? Where could it mislead?
|
|
48
|
+
5. **Present the plan to the user and WAIT for confirmation** before proceeding.
|
|
49
|
+
|
|
50
|
+
For detailed methodology guidance, see the `research-literacy` skill.
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
## ⚠️ Verification Notice
|
|
54
|
+
|
|
55
|
+
This skill was generated by AI from academic literature. All parameters, thresholds, and citations require independent verification before use in research. If you find errors, please [open an issue](https://github.com/HaoxuanLiTHUAI/awesome_cognitive_and_neuroscience_skills/issues).
|
|
56
|
+
|
|
57
|
+
## Why Traditional Power Analysis Fails for Neuroimaging
|
|
58
|
+
|
|
59
|
+
### The Fundamental Problem
|
|
60
|
+
|
|
61
|
+
Standard power analysis computes the sample size for a single statistical test at a given effect size, alpha, and power. Neuroimaging violates every assumption of this framework:
|
|
62
|
+
|
|
63
|
+
| Standard Assumption | Neuroimaging Reality | Consequence |
|
|
64
|
+
|---|---|---|
|
|
65
|
+
| Single test | ~100,000 voxels tested | Alpha must be corrected, dramatically reducing per-test sensitivity |
|
|
66
|
+
| Independent tests | Voxels are spatially correlated (due to smoothing and neural organization) | Effective number of tests is much less than 100,000, but hard to compute analytically |
|
|
67
|
+
| Known effect size | Effect size varies across voxels and depends on ROI definition | No single "effect size" characterizes a study |
|
|
68
|
+
| Simple test statistic | Cluster-based, TFCE, and permutation tests have complex null distributions | Power depends on the specific inference method used |
|
|
69
|
+
| One-level inference | Subject-level estimation + group-level test | Within-subject variance and between-subject variance both affect power |
|
|
70
|
+
|
|
71
|
+
Source: Mumford & Nichols, 2008; Poldrack et al., 2017.
|
|
72
|
+
|
|
73
|
+
## The Pilot-Data-Based Simulation Approach
|
|
74
|
+
|
|
75
|
+
The gold standard for neuroimaging power analysis uses pilot data to simulate full datasets at varying sample sizes (Mumford & Nichols, 2008).
|
|
76
|
+
|
|
77
|
+
### Step-by-Step Procedure
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
Step 1: Obtain pilot data or published effect-size maps
|
|
81
|
+
|
|
|
82
|
+
Step 2: Estimate expected effect sizes at regions of interest
|
|
83
|
+
|
|
|
84
|
+
Step 3: Simulate datasets with varying N
|
|
85
|
+
|
|
|
86
|
+
Step 4: Apply full analysis pipeline (including multiple comparison correction)
|
|
87
|
+
|
|
|
88
|
+
Step 5: Compute power = proportion of simulations detecting the effect
|
|
89
|
+
|
|
|
90
|
+
Step 6: Find the N that achieves target power (typically 80% or 90%)
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Step 1: Obtain Pilot Data
|
|
94
|
+
|
|
95
|
+
| Source | Quality | Requirements | Caveats |
|
|
96
|
+
|---|---|---|---|
|
|
97
|
+
| Own pilot study | **Best** | At least **10-15 subjects** for stable variance estimates | Effect sizes from small pilots are inflated; use conservative estimates |
|
|
98
|
+
| Published group map | Good | Unthresholded statistical map (t-map or z-map) | May not match your exact paradigm or population |
|
|
99
|
+
| NeuroVault repository | Good | Search for comparable paradigms | Maps may use different preprocessing/analysis pipelines |
|
|
100
|
+
| Meta-analytic map (NeuroSynth, NiMARE) | Moderate | Coordinate-based or image-based meta-analysis | Provides average effect across studies, may underestimate for specific paradigms |
|
|
101
|
+
|
|
102
|
+
Source: Mumford & Nichols, 2008; Poldrack et al., 2017.
|
|
103
|
+
|
|
104
|
+
**Critical warning**: Effect sizes from small pilot studies (N < 20) are inflated due to the winner's curse. Assume the true effect is **50-75%** of the pilot estimate (Button et al., 2013).
|
|
105
|
+
|
|
106
|
+
### Step 2: Estimate Effect Sizes
|
|
107
|
+
|
|
108
|
+
For ROI-based analysis:
|
|
109
|
+
1. Define the ROI a priori (from atlas, meta-analysis, or independent data)
|
|
110
|
+
2. Extract the mean effect size (Cohen's d or percent signal change) from the pilot data within the ROI
|
|
111
|
+
3. Apply the deflation correction (multiply by 0.5-0.75) for conservative estimation
|
|
112
|
+
|
|
113
|
+
For whole-brain analysis:
|
|
114
|
+
1. Use the full unthresholded statistical map as the effect-size map
|
|
115
|
+
2. The map captures spatial variation in effect size across the brain
|
|
116
|
+
3. Power will vary by region -- focus on the primary region of interest for sample size determination
|
|
117
|
+
|
|
118
|
+
### Step 3: Simulate Datasets
|
|
119
|
+
|
|
120
|
+
For each candidate sample size N:
|
|
121
|
+
|
|
122
|
+
1. Generate **1,000-5,000** simulated group maps by:
|
|
123
|
+
a. Sampling N subjects from a population with the estimated effect size and variance
|
|
124
|
+
b. Adding realistic noise (estimated from pilot residuals or assumed Gaussian with spatial smoothness matching the pilot data)
|
|
125
|
+
c. Creating a group-level statistical map
|
|
126
|
+
|
|
127
|
+
2. Apply the smoothness estimate from the pilot data (or the planned smoothing kernel) to each simulated map
|
|
128
|
+
|
|
129
|
+
### Step 4: Apply Full Analysis Pipeline
|
|
130
|
+
|
|
131
|
+
For each simulated dataset:
|
|
132
|
+
1. Compute the group-level statistical map (e.g., one-sample t-test)
|
|
133
|
+
2. Apply the planned multiple comparison correction method:
|
|
134
|
+
- Cluster-based inference: apply cluster-defining threshold (CDT) of **p < 0.001** (Eklund et al., 2016) and identify significant clusters
|
|
135
|
+
- Voxelwise FWE: apply random field theory correction at **p < 0.05** FWE
|
|
136
|
+
- TFCE: compute TFCE image and apply permutation-based correction
|
|
137
|
+
- FDR: apply Benjamini-Hochberg at **q < 0.05**
|
|
138
|
+
|
|
139
|
+
### Step 5: Compute Power
|
|
140
|
+
|
|
141
|
+
- **Voxel-level power**: For each voxel, power = proportion of simulations in which that voxel is significant
|
|
142
|
+
- **ROI-level power**: Power = proportion of simulations in which at least one voxel in the target ROI is significant
|
|
143
|
+
- **Cluster-level power**: Power = proportion of simulations in which a significant cluster overlaps with the target region
|
|
144
|
+
|
|
145
|
+
Report the power metric most relevant to your planned analysis (Mumford & Nichols, 2008).
|
|
146
|
+
|
|
147
|
+
## Tools and Implementations
|
|
148
|
+
|
|
149
|
+
### fMRIpower (Mumford & Nichols, 2008)
|
|
150
|
+
|
|
151
|
+
| Feature | Description |
|
|
152
|
+
|---|---|
|
|
153
|
+
| Input | Pilot group-level statistical maps (from FSL) |
|
|
154
|
+
| Method | Resamples from pilot to estimate power at varying N |
|
|
155
|
+
| Output | Power curves for specified ROIs at different sample sizes |
|
|
156
|
+
| Requirements | FSL, R; pilot data from at least 10-15 subjects |
|
|
157
|
+
| Strengths | Uses actual pilot data; accounts for design-specific temporal autocorrelation |
|
|
158
|
+
| Limitations | Assumes pilot effect sizes are representative; FSL-specific |
|
|
159
|
+
|
|
160
|
+
### NeuroPowerTools (Durnez et al., 2016)
|
|
161
|
+
|
|
162
|
+
| Feature | Description |
|
|
163
|
+
|---|---|
|
|
164
|
+
| Input | Unthresholded statistical map (any software) |
|
|
165
|
+
| Method | Fits mixture model to peak distribution; estimates prevalence and effect size |
|
|
166
|
+
| Output | Power estimates at varying N; optimal sample size for target power |
|
|
167
|
+
| Access | Web-based: https://neuropowertools.org |
|
|
168
|
+
| Strengths | Does not require individual subject data; works with published maps |
|
|
169
|
+
| Limitations | Peak-based approximation; may underestimate power for distributed effects |
|
|
170
|
+
|
|
171
|
+
### PowerMap (Joyce & Hayasaka, 2012)
|
|
172
|
+
|
|
173
|
+
| Feature | Description |
|
|
174
|
+
|---|---|
|
|
175
|
+
| Input | Assumed effect size map, noise model, smoothness |
|
|
176
|
+
| Method | Full simulation with parametric statistical testing |
|
|
177
|
+
| Output | Voxelwise power maps at specified N |
|
|
178
|
+
| Requirements | MATLAB |
|
|
179
|
+
| Strengths | Voxel-level power visualization; flexible correction methods |
|
|
180
|
+
| Limitations | Computationally intensive; requires specification of noise model |
|
|
181
|
+
|
|
182
|
+
### AFNI 3dClustSim
|
|
183
|
+
|
|
184
|
+
| Feature | Description |
|
|
185
|
+
|---|---|
|
|
186
|
+
| Input | Smoothness estimates (from 3dFWHMx), voxel dimensions, mask |
|
|
187
|
+
| Method | Monte Carlo simulation of random fields |
|
|
188
|
+
| Output | Cluster-size thresholds for a given alpha level |
|
|
189
|
+
| Use for power | Estimate minimum detectable cluster size at a given sample size; not a full power tool |
|
|
190
|
+
| Strengths | Fast, accounts for non-Gaussian smoothness (ACF model; Cox et al., 2017) |
|
|
191
|
+
| Limitations | Does not compute power directly; only provides cluster-extent thresholds |
|
|
192
|
+
|
|
193
|
+
## ROI-Based Power Shortcuts
|
|
194
|
+
|
|
195
|
+
When full simulation is impractical, ROI-based power analysis provides a reasonable alternative:
|
|
196
|
+
|
|
197
|
+
### Procedure
|
|
198
|
+
|
|
199
|
+
1. Define the target ROI a priori (from atlas, meta-analysis, or independent data)
|
|
200
|
+
2. Extract the expected effect size (Cohen's d) from pilot data or literature:
|
|
201
|
+
- Mean activation within ROI / standard deviation of activation across subjects
|
|
202
|
+
3. Use standard power formulas (G*Power or similar) with the ROI-level effect size
|
|
203
|
+
4. No multiple comparison correction is needed for a **single a priori ROI**
|
|
204
|
+
|
|
205
|
+
### Effect Size Extraction from Published Results
|
|
206
|
+
|
|
207
|
+
| Published Statistic | Conversion to Cohen's d | Source |
|
|
208
|
+
|---|---|---|
|
|
209
|
+
| t-value (within-subject) | d = t / sqrt(N) | Standard formula |
|
|
210
|
+
| t-value (between-group) | d = 2t / sqrt(df) | Standard formula |
|
|
211
|
+
| z-value | d = z / sqrt(N) (approximate) | Approximate for large N |
|
|
212
|
+
| Percent signal change + SD | d = mean_PSC / SD_PSC | Direct computation |
|
|
213
|
+
| Partial eta-squared | d = sqrt(eta^2 / (1 - eta^2)) | Conversion formula |
|
|
214
|
+
|
|
215
|
+
### Meta-Analytic Effect Sizes
|
|
216
|
+
|
|
217
|
+
Use coordinate-based meta-analysis tools to estimate effect sizes at specific brain locations:
|
|
218
|
+
|
|
219
|
+
| Tool | Method | Output | Source |
|
|
220
|
+
|---|---|---|---|
|
|
221
|
+
| NiMARE | ALE, MKDA, or other CBMA | Meta-analytic map; extract effect at ROI | Salo et al., 2023 |
|
|
222
|
+
| NeuroSynth | Automated term-based meta-analysis | Association maps; extract effect at coordinates | Yarkoni et al., 2011 |
|
|
223
|
+
| BrainMap | ALE meta-analysis | Coordinate-based likelihood maps | Laird et al., 2005 |
|
|
224
|
+
|
|
225
|
+
**Caveat**: Meta-analytic effect sizes aggregate across many studies with different designs, populations, and analysis pipelines. They provide a reasonable lower bound but may not match your specific paradigm (Yarkoni et al., 2011).
|
|
226
|
+
|
|
227
|
+
## Current Sample Size Recommendations
|
|
228
|
+
|
|
229
|
+
### Landmark Findings
|
|
230
|
+
|
|
231
|
+
| Finding | Recommendation | Source |
|
|
232
|
+
|---|---|---|
|
|
233
|
+
| Brain-behavior associations require massive samples for replicability | **N > 2,000** for whole-brain brain-behavior correlations | Marek et al., 2022 |
|
|
234
|
+
| N = 20 gives ~50% power for medium fMRI effects | **N = 40+** for 80% power with medium effects | Poldrack et al., 2017 |
|
|
235
|
+
| 80% power at uncorrected p < 0.001 requires N ~ 40 for d = 0.8 | **N = 40** per group for large between-group effects | Turner et al., 2018 |
|
|
236
|
+
| Cluster-based inference with CDT p < 0.01 produces inflated false positives | Use CDT **p < 0.001** and increase N to compensate for reduced sensitivity | Eklund et al., 2016 |
|
|
237
|
+
| Within-subject designs are much more powerful than between-subject | Prefer **within-subject** designs when scientifically appropriate | Mumford & Nichols, 2008 |
|
|
238
|
+
|
|
239
|
+
### Minimum Sample Size Table
|
|
240
|
+
|
|
241
|
+
| Analysis Type | Minimum N (80% Power) | Effect Size Assumed | Correction Method | Source |
|
|
242
|
+
|---|---|---|---|---|
|
|
243
|
+
| Within-subject activation (whole-brain) | **25-30** | d = 0.8 (large) | Cluster-based, CDT p < 0.001 | Desmond & Glover, 2002 |
|
|
244
|
+
| Between-group (whole-brain, large effect) | **20-25 per group** | d = 0.8 | Cluster-based, CDT p < 0.001 | Thirion et al., 2007 |
|
|
245
|
+
| Between-group (whole-brain, medium effect) | **40-50 per group** | d = 0.5 | Cluster-based, CDT p < 0.001 | Poldrack et al., 2017 |
|
|
246
|
+
| ROI-based (single a priori ROI) | **15-25** | d = 0.5-0.8 | Uncorrected (single test) | Desmond & Glover, 2002 |
|
|
247
|
+
| Resting-state connectivity (group mean) | **25-40** | r = 0.3-0.5 | FDR or NBS | Smith et al., 2011 |
|
|
248
|
+
| Brain-behavior correlation (whole-brain) | **2,000+** | r < 0.1 (replicable) | Permutation | Marek et al., 2022 |
|
|
249
|
+
| Brain-behavior correlation (single ROI) | **80-200** | r = 0.2-0.3 | Uncorrected | Standard formula |
|
|
250
|
+
|
|
251
|
+
## Registered Report Considerations
|
|
252
|
+
|
|
253
|
+
Registered reports require pre-specification of sample size with a formal power analysis. For neuroimaging registered reports:
|
|
254
|
+
|
|
255
|
+
1. **Specify the primary analysis** (whole-brain vs. ROI) and the corresponding power analysis method
|
|
256
|
+
2. **Use simulation-based power** when possible; if not, use ROI-based power with conservative effect size estimates
|
|
257
|
+
3. **Pre-specify the multiple comparison correction method** and document its impact on required N
|
|
258
|
+
4. **Include sensitivity analysis**: What is the minimum detectable effect size at the planned N?
|
|
259
|
+
5. **State stopping rules**: Pre-register the exact N and analysis plan; sequential analysis requires adjustment (Lakens, 2014)
|
|
260
|
+
6. **Account for attrition**: Specify expected exclusion rate (typically **10-20%** for fMRI) and over-recruit
|
|
261
|
+
|
|
262
|
+
**Domain insight**: Reviewers will be suspicious of power analyses based on large effect sizes from small pilot studies. Use conservative (deflated) effect size estimates and show power curves across a range of plausible effect sizes.
|
|
263
|
+
|
|
264
|
+
## Practical Workflow for Grant Applications
|
|
265
|
+
|
|
266
|
+
### When Pilot Data Are Available
|
|
267
|
+
|
|
268
|
+
1. Run fMRIpower or NeuroPowerTools with pilot maps
|
|
269
|
+
2. Generate power curves showing power vs. N for the primary contrast and ROI
|
|
270
|
+
3. Select N that achieves **80-90%** power for the primary analysis
|
|
271
|
+
4. Add **15-20%** for expected participant exclusions
|
|
272
|
+
5. Report: pilot study details, effect size estimates, power tool used, correction method, target power, final N
|
|
273
|
+
|
|
274
|
+
### When No Pilot Data Are Available
|
|
275
|
+
|
|
276
|
+
1. Search NeuroVault for comparable paradigms; download unthresholded maps
|
|
277
|
+
2. Use NeuroPowerTools with the published map
|
|
278
|
+
3. Alternatively, estimate ROI-level effect sizes from published papers:
|
|
279
|
+
- Extract t-values and convert to Cohen's d
|
|
280
|
+
- Apply deflation (multiply by 0.5-0.75; Button et al., 2013)
|
|
281
|
+
- Use G*Power for ROI-based power
|
|
282
|
+
4. As a last resort, use the benchmark table above with the analysis type closest to your planned study
|
|
283
|
+
5. Document all assumptions and state that the power analysis is based on estimated (not measured) effect sizes
|
|
284
|
+
|
|
285
|
+
## Common Pitfalls
|
|
286
|
+
|
|
287
|
+
1. **Using G*Power for whole-brain analyses**: Standard power tools compute power for a single test and do not account for multiple comparison correction. This overestimates power by an order of magnitude (Mumford & Nichols, 2008)
|
|
288
|
+
2. **Trusting pilot study effect sizes**: Small pilot studies (N < 20) produce inflated effect sizes. Always deflate by **25-50%** (Button et al., 2013)
|
|
289
|
+
3. **Ignoring the correction method**: Power depends critically on whether you use voxelwise FWE, cluster-based, FDR, or permutation-based correction. Power at FDR q < 0.05 can be 2-3x higher than voxelwise FWE p < 0.05 for the same N
|
|
290
|
+
4. **Conflating within-subject and between-subject power**: Within-subject designs (one-sample t-test on contrast maps) are much more powerful than between-subject designs (two-sample t-test) because they eliminate between-subject variance (Mumford & Nichols, 2008)
|
|
291
|
+
5. **Not accounting for attrition**: In fMRI, 10-20% of data may be unusable due to motion, scanner artifacts, or task non-compliance. Over-recruit accordingly
|
|
292
|
+
6. **Treating all regions equally**: Power varies across the brain because effect sizes and noise vary spatially. Power at your primary ROI may be adequate even if whole-brain power is low
|
|
293
|
+
7. **Assuming published N is adequate**: Most published fMRI studies are underpowered (Button et al., 2013). Matching a published study's N does not guarantee adequate power
|
|
294
|
+
8. **Not reporting sensitivity analysis**: Always report the minimum detectable effect size at your planned N, in addition to the power estimate for the expected effect
|
|
295
|
+
|
|
296
|
+
## Minimum Reporting Checklist
|
|
297
|
+
|
|
298
|
+
- [ ] Source of effect size estimate (pilot data, published study, meta-analysis)
|
|
299
|
+
- [ ] Effect size metric (Cohen's d, r, percent signal change) and value used
|
|
300
|
+
- [ ] Whether effect size deflation was applied and the correction factor
|
|
301
|
+
- [ ] Power analysis method (simulation-based, ROI-based analytical, benchmark-based)
|
|
302
|
+
- [ ] Power analysis tool and version (fMRIpower, NeuroPowerTools, G*Power, custom simulation)
|
|
303
|
+
- [ ] Number of simulations (for simulation-based approaches)
|
|
304
|
+
- [ ] Multiple comparison correction method assumed in power analysis
|
|
305
|
+
- [ ] Statistical threshold used (e.g., CDT p < 0.001, cluster p < 0.05 FWE)
|
|
306
|
+
- [ ] Target power level (80% or 90%)
|
|
307
|
+
- [ ] Planned total N and N per group (if applicable)
|
|
308
|
+
- [ ] Expected attrition rate and over-recruitment plan
|
|
309
|
+
- [ ] Sensitivity analysis (minimum detectable effect at planned N)
|
|
310
|
+
|
|
311
|
+
## References
|
|
312
|
+
|
|
313
|
+
- Button, K. S., Ioannidis, J. P. A., Mokrysz, C., et al. (2013). Power failure: Why small sample size undermines the reliability of neuroscience. *Nature Reviews Neuroscience*, 14(5), 365-376.
|
|
314
|
+
- Cox, R. W., Chen, G., Glen, D. R., Reynolds, R. C., & Taylor, P. A. (2017). FMRI clustering in AFNI: False-positive rates redux. *Brain Connectivity*, 7(3), 152-171.
|
|
315
|
+
- Desmond, J. E., & Glover, G. H. (2002). Estimating sample size in functional MRI (fMRI) neuroimaging studies. *Journal of Neuroscience Methods*, 118(2), 115-128.
|
|
316
|
+
- Durnez, J., Degryse, J., Moerkerke, B., et al. (2016). Power and sample size calculations for fMRI studies based on the prevalence of active peaks. *bioRxiv*, 049429.
|
|
317
|
+
- Eklund, A., Nichols, T. E., & Knutsson, H. (2016). Cluster failure: Why fMRI inferences for spatial extent have inflated false-positive rates. *PNAS*, 113(28), 7900-7905.
|
|
318
|
+
- Joyce, K. E., & Hayasaka, S. (2012). Development of PowerMap: A software package for statistical power calculation in neuroimaging studies. *Neuroinformatics*, 10(4), 351-365.
|
|
319
|
+
- Laird, A. R., Fox, P. M., Price, C. J., et al. (2005). ALE meta-analysis: Controlling the false discovery rate and performing statistical contrasts. *Human Brain Mapping*, 25(1), 155-164.
|
|
320
|
+
- Lakens, D. (2014). Performing high-powered studies efficiently with sequential analyses. *European Journal of Social Psychology*, 44(7), 701-710.
|
|
321
|
+
- Marek, S., Tervo-Clemmens, B., Calabro, F. J., et al. (2022). Reproducible brain-wide association studies require thousands of individuals. *Nature*, 603(7902), 654-660.
|
|
322
|
+
- Mumford, J. A., & Nichols, T. E. (2008). Power calculation for group fMRI studies accounting for arbitrary design and temporal autocorrelation. *NeuroImage*, 39(1), 261-268.
|
|
323
|
+
- Poldrack, R. A., Baker, C. I., Durnez, J., et al. (2017). Scanning the horizon: Towards transparent and reproducible neuroimaging research. *Nature Reviews Neuroscience*, 18(2), 115-126.
|
|
324
|
+
- Salo, T., Yarkoni, T., Nichols, T. E., et al. (2023). NiMARE: Neuroimaging Meta-Analysis Research Environment. *NeuroImage*, 268, 119862.
|
|
325
|
+
- Smith, S. M., Miller, K. L., Salimi-Khorshidi, G., et al. (2011). Network modelling methods for FMRI. *NeuroImage*, 54(2), 875-891.
|
|
326
|
+
- Thirion, B., Pinel, P., Meriaux, S., et al. (2007). Analysis of a large fMRI cohort: Statistical and methodological issues for group analyses. *NeuroImage*, 35(1), 105-120.
|
|
327
|
+
- Turner, B. O., Paul, E. J., Miller, M. B., & Barbey, A. K. (2018). Small sample sizes reduce the replicability of task-based fMRI studies. *Communications Biology*, 1, 62.
|
|
328
|
+
- Yarkoni, T., Poldrack, R. A., Nichols, T. E., Van Essen, D. C., & Wager, T. D. (2011). Large-scale automated synthesis of human functional neuroimaging data. *Nature Methods*, 8(8), 665-670.
|
|
329
|
+
|
|
330
|
+
See `references/` for worked examples and simulation code templates.
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
# Simulation-Based Power Analysis: Worked Examples
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
This reference provides worked examples of simulation-based power analysis for common neuroimaging study designs, expanding on the methodology described in `../SKILL.md`.
|
|
6
|
+
|
|
7
|
+
## Example 1: Within-Subject Task Activation (fMRI)
|
|
8
|
+
|
|
9
|
+
### Scenario
|
|
10
|
+
|
|
11
|
+
A researcher plans to study the neural correlates of cognitive control using a Stroop task. The primary analysis is a whole-brain within-subject contrast (incongruent > congruent). Pilot data from N=12 subjects are available.
|
|
12
|
+
|
|
13
|
+
### Step 1: Extract Effect Size from Pilot
|
|
14
|
+
|
|
15
|
+
From the pilot group-level t-map (incongruent > congruent):
|
|
16
|
+
- Peak voxel in dorsal ACC: t(11) = 4.2, Cohen's d = 4.2 / sqrt(12) = **1.21**
|
|
17
|
+
- Peak voxel in left dlPFC: t(11) = 3.5, Cohen's d = 3.5 / sqrt(12) = **1.01**
|
|
18
|
+
- Mean d across ACC ROI: **0.85**
|
|
19
|
+
|
|
20
|
+
### Step 2: Apply Conservative Deflation
|
|
21
|
+
|
|
22
|
+
Small pilot (N=12), so apply 50% deflation (Button et al., 2013):
|
|
23
|
+
- Conservative ACC d estimate: 0.85 * 0.50 = **0.43**
|
|
24
|
+
- Conservative dlPFC d estimate: 1.01 * 0.50 = **0.51**
|
|
25
|
+
|
|
26
|
+
### Step 3: ROI-Based Power (Quick Estimate)
|
|
27
|
+
|
|
28
|
+
Using G*Power for a one-sample t-test (two-tailed):
|
|
29
|
+
- d = 0.43, alpha = 0.05, power = 0.80
|
|
30
|
+
- Required N = **35**
|
|
31
|
+
- Add 15% attrition: Final planned N = **41**
|
|
32
|
+
|
|
33
|
+
### Step 4: Simulation-Based Power (Full Analysis)
|
|
34
|
+
|
|
35
|
+
Using fMRIpower or custom simulation:
|
|
36
|
+
1. Use pilot residuals to estimate noise characteristics
|
|
37
|
+
2. Simulate 2,000 group maps at each candidate N (10, 15, 20, 25, 30, 35, 40, 50)
|
|
38
|
+
3. Apply cluster-based correction (CDT p < 0.001, cluster p < 0.05 FWE)
|
|
39
|
+
4. Count proportion of simulations with a significant cluster in the ACC/dlPFC region
|
|
40
|
+
|
|
41
|
+
### Expected Power Curve
|
|
42
|
+
|
|
43
|
+
| N | Power (ROI) | Power (Whole-Brain Cluster) |
|
|
44
|
+
|---|---|---|
|
|
45
|
+
| 15 | 38% | 22% |
|
|
46
|
+
| 20 | 52% | 35% |
|
|
47
|
+
| 25 | 65% | 48% |
|
|
48
|
+
| 30 | 76% | 60% |
|
|
49
|
+
| 35 | 84% | 70% |
|
|
50
|
+
| 40 | 90% | 78% |
|
|
51
|
+
| 50 | 96% | 88% |
|
|
52
|
+
|
|
53
|
+
**Decision**: Target N = 40 (with 15% attrition buffer, recruit 46 participants).
|
|
54
|
+
|
|
55
|
+
Values are illustrative based on typical parameters from Mumford & Nichols (2008).
|
|
56
|
+
|
|
57
|
+
## Example 2: Between-Group Comparison (Patients vs. Controls)
|
|
58
|
+
|
|
59
|
+
### Scenario
|
|
60
|
+
|
|
61
|
+
A researcher plans to compare amygdala reactivity to emotional faces between patients with social anxiety disorder and healthy controls. Published studies report d = 0.6-0.8 for amygdala group differences.
|
|
62
|
+
|
|
63
|
+
### Step 1: Effect Size Estimate
|
|
64
|
+
|
|
65
|
+
Using the meta-analytic estimate (conservative):
|
|
66
|
+
- Published meta-analytic d = 0.7 (Etkin & Wager, 2007)
|
|
67
|
+
- Apply 25% deflation: d = 0.7 * 0.75 = **0.53**
|
|
68
|
+
|
|
69
|
+
### Step 2: ROI-Based Power
|
|
70
|
+
|
|
71
|
+
Using G*Power for an independent samples t-test (two-tailed):
|
|
72
|
+
- d = 0.53, alpha = 0.05, power = 0.80
|
|
73
|
+
- Required N per group = **58**
|
|
74
|
+
- Add 15% attrition: Final planned N = **67 per group**
|
|
75
|
+
|
|
76
|
+
### Step 3: Sensitivity Analysis
|
|
77
|
+
|
|
78
|
+
At the planned N = 58 per group, what is the minimum detectable effect?
|
|
79
|
+
- Minimum detectable d (80% power, alpha = 0.05) = **0.53**
|
|
80
|
+
|
|
81
|
+
If the true effect is only d = 0.3 (plausible for clinical samples):
|
|
82
|
+
- Power at N = 58 per group = **33%** (inadequate)
|
|
83
|
+
- Required N for d = 0.3 at 80% power = **176 per group**
|
|
84
|
+
|
|
85
|
+
**Conclusion**: If the effect could be as small as d = 0.3, a much larger sample or multi-site study is needed.
|
|
86
|
+
|
|
87
|
+
## Example 3: Brain-Behavior Correlation
|
|
88
|
+
|
|
89
|
+
### Scenario
|
|
90
|
+
|
|
91
|
+
A researcher wants to correlate trait anxiety scores with amygdala connectivity strength during an emotion task.
|
|
92
|
+
|
|
93
|
+
### Step 1: Effect Size Estimate
|
|
94
|
+
|
|
95
|
+
Brain-behavior correlations are typically small (Marek et al., 2022):
|
|
96
|
+
- Expected r = 0.2-0.3 (optimistic for a single ROI)
|
|
97
|
+
- Conservative estimate: r = 0.15
|
|
98
|
+
|
|
99
|
+
### Step 2: ROI-Based Power
|
|
100
|
+
|
|
101
|
+
For a Pearson correlation test:
|
|
102
|
+
- r = 0.15, alpha = 0.05, power = 0.80
|
|
103
|
+
- Required N = **346**
|
|
104
|
+
|
|
105
|
+
For a more optimistic r = 0.25:
|
|
106
|
+
- Required N = **123**
|
|
107
|
+
|
|
108
|
+
### Step 3: Whole-Brain Considerations
|
|
109
|
+
|
|
110
|
+
If searching for brain-behavior correlations across the whole brain:
|
|
111
|
+
- Marek et al. (2022) showed that N > 2,000 is needed for replicable whole-brain brain-behavior associations
|
|
112
|
+
- This is far beyond the budget of most single-site studies
|
|
113
|
+
- **Recommendation**: Use a priori ROIs or join large-scale consortia (ABCD, HCP, UK Biobank)
|
|
114
|
+
|
|
115
|
+
## Example 4: ERP Study Power Analysis
|
|
116
|
+
|
|
117
|
+
### Scenario
|
|
118
|
+
|
|
119
|
+
A researcher plans to study the N400 effect (semantically anomalous > expected) in patients with schizophrenia vs. controls.
|
|
120
|
+
|
|
121
|
+
### Step 1: Effect Size Estimate
|
|
122
|
+
|
|
123
|
+
- Within-subject N400 effect: d = 0.5-1.0 (Kutas & Federmeier, 2011)
|
|
124
|
+
- Between-group difference in N400: d = 0.4-0.6 (meta-analytic; Kiang et al., 2012)
|
|
125
|
+
- Conservative between-group estimate: d = 0.4
|
|
126
|
+
|
|
127
|
+
### Step 2: Trial Count Planning
|
|
128
|
+
|
|
129
|
+
- Minimum trials per condition: **30** post-rejection (Boudewyn et al., 2018)
|
|
130
|
+
- Expected rejection rate: 25% for patients (more artifacts)
|
|
131
|
+
- Required presented trials: 30 / 0.75 = **40 per condition**
|
|
132
|
+
- Design: 80 trials per condition (comfortable margin)
|
|
133
|
+
|
|
134
|
+
### Step 3: Subject-Level Power
|
|
135
|
+
|
|
136
|
+
Using G*Power for an independent samples t-test:
|
|
137
|
+
- d = 0.4, alpha = 0.05, power = 0.80
|
|
138
|
+
- Required N per group = **100**
|
|
139
|
+
|
|
140
|
+
For a within-subject N400 effect at d = 0.7:
|
|
141
|
+
- Required N = **19** per group (but this is only for the within-subject effect, not the group comparison)
|
|
142
|
+
|
|
143
|
+
**Recommendation**: For the between-group comparison at d = 0.4, plan for **50-60 per group** as a pragmatic compromise (acknowledging this provides only ~60% power). Consider multi-site collaboration for full 80% power.
|
|
144
|
+
|
|
145
|
+
## Simulation Code Template (Python/Nilearn)
|
|
146
|
+
|
|
147
|
+
### Pseudocode for fMRI Power Simulation
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
# Pseudocode -- not executable without actual data
|
|
151
|
+
# Illustrates the logic of simulation-based power analysis
|
|
152
|
+
|
|
153
|
+
import numpy as np
|
|
154
|
+
from nilearn import image
|
|
155
|
+
|
|
156
|
+
def simulate_power(pilot_effect_map, pilot_residual_std_map,
|
|
157
|
+
smoothness_fwhm, candidate_Ns, n_simulations,
|
|
158
|
+
correction_method, alpha, roi_mask):
|
|
159
|
+
"""
|
|
160
|
+
Parameters:
|
|
161
|
+
- pilot_effect_map: 3D array of estimated effect sizes (Cohen's d) at each voxel
|
|
162
|
+
- pilot_residual_std_map: 3D array of estimated noise SD at each voxel
|
|
163
|
+
- smoothness_fwhm: estimated spatial smoothness in mm
|
|
164
|
+
- candidate_Ns: list of sample sizes to evaluate
|
|
165
|
+
- n_simulations: number of simulations per N (recommend 1000-5000)
|
|
166
|
+
- correction_method: 'cluster', 'fwe', 'fdr', or 'tfce'
|
|
167
|
+
- alpha: significance level (typically 0.05)
|
|
168
|
+
- roi_mask: binary mask for the target ROI
|
|
169
|
+
|
|
170
|
+
Returns:
|
|
171
|
+
- power_by_N: dict mapping N to power estimate
|
|
172
|
+
"""
|
|
173
|
+
|
|
174
|
+
power_by_N = {}
|
|
175
|
+
|
|
176
|
+
for N in candidate_Ns:
|
|
177
|
+
detections = 0
|
|
178
|
+
|
|
179
|
+
for sim in range(n_simulations):
|
|
180
|
+
# Step 1: Generate N subject-level contrast maps
|
|
181
|
+
# Each subject map = true_effect + noise
|
|
182
|
+
# noise ~ N(0, residual_std / sqrt(n_trials))
|
|
183
|
+
group_data = []
|
|
184
|
+
for subj in range(N):
|
|
185
|
+
noise = np.random.randn(*pilot_effect_map.shape)
|
|
186
|
+
noise = smooth(noise, smoothness_fwhm)
|
|
187
|
+
noise *= pilot_residual_std_map
|
|
188
|
+
subj_map = pilot_effect_map + noise
|
|
189
|
+
group_data.append(subj_map)
|
|
190
|
+
|
|
191
|
+
# Step 2: Compute group t-map
|
|
192
|
+
group_mean = np.mean(group_data, axis=0)
|
|
193
|
+
group_se = np.std(group_data, axis=0) / np.sqrt(N)
|
|
194
|
+
t_map = group_mean / group_se
|
|
195
|
+
|
|
196
|
+
# Step 3: Apply multiple comparison correction
|
|
197
|
+
sig_map = apply_correction(t_map, correction_method, alpha,
|
|
198
|
+
smoothness_fwhm)
|
|
199
|
+
|
|
200
|
+
# Step 4: Check if effect detected in ROI
|
|
201
|
+
if np.any(sig_map[roi_mask > 0]):
|
|
202
|
+
detections += 1
|
|
203
|
+
|
|
204
|
+
power_by_N[N] = detections / n_simulations
|
|
205
|
+
|
|
206
|
+
return power_by_N
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
**Note**: This pseudocode illustrates the logic. For actual implementation, use fMRIpower (Mumford & Nichols, 2008), NeuroPowerTools (Durnez et al., 2016), or nilearn/nipype simulation pipelines.
|
|
210
|
+
|
|
211
|
+
## References
|
|
212
|
+
|
|
213
|
+
- Boudewyn, M. A., Luck, S. J., Farrens, J. L., & Kappenman, E. S. (2018). How many trials does it take to get a significant ERP effect? *Psychophysiology*, 55(6), e13049.
|
|
214
|
+
- Button, K. S., Ioannidis, J. P. A., Mokrysz, C., et al. (2013). Power failure. *Nature Reviews Neuroscience*, 14(5), 365-376.
|
|
215
|
+
- Durnez, J., Degryse, J., Moerkerke, B., et al. (2016). Power and sample size calculations for fMRI studies based on the prevalence of active peaks. *bioRxiv*, 049429.
|
|
216
|
+
- Etkin, A., & Wager, T. D. (2007). Functional neuroimaging of anxiety: A meta-analysis. *American Journal of Psychiatry*, 164(10), 1476-1488.
|
|
217
|
+
- Kiang, M., Kutas, M., Light, G. A., & Braff, D. L. (2012). An event-related brain potential study of the N400 in schizophrenia. *Schizophrenia Research*, 137(1-3), 21-28.
|
|
218
|
+
- Kutas, M., & Federmeier, K. D. (2011). Thirty years and counting: Finding meaning in the N400. *Annual Review of Psychology*, 62, 621-647.
|
|
219
|
+
- Marek, S., Tervo-Clemmens, B., Calabro, F. J., et al. (2022). Reproducible brain-wide association studies require thousands of individuals. *Nature*, 603(7902), 654-660.
|
|
220
|
+
- Mumford, J. A., & Nichols, T. E. (2008). Power calculation for group fMRI studies. *NeuroImage*, 39(1), 261-268.
|