Skip to content

Commit

Permalink
add files to publish
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardklap committed Jun 13, 2024
1 parent eaa96e1 commit 1082fa8
Show file tree
Hide file tree
Showing 24 changed files with 244 additions and 3,563 deletions.
3 changes: 3 additions & 0 deletions .Rproj.user/61FBC8AB/jobs/7B1C1D9A-output.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@
[1,"\u001B[1mpandoc \u001B[22m\n to: html\n output-file: >-\n /Users/eduardklapwijk/ownCloud/2020_Samplesizes\n (Projectfolder)/reproducible-paper/index.html\n standalone: true\n section-divs: true\n html-math-method: mathjax\n wrap: none\n default-image-extension: png\n number-sections: true\n toc: true\n \n\u001B[1mmetadata\u001B[22m\n \n document-css: false\n link-citations: true\n date-format: long\n lang: en\n manuscript:\n article: index.qmd\n notebooks:\n - notebook: notebooks/figures-cohens_d.qmd\n title: Code to create Figures 1 and 2\n - notebook: notebooks/figures-correlations.qmd\n title: Code to create Figures 3 and 4\n mecaFile: index-meca.zip\n notebook-preview-options:\n back: true\n theme: litera\n title-block-style: manuscript\n lightbox: auto\n comments:\n hypothesis: true\n title: Sample size estimation for task-related functional MRI studies using Bayesian updating\n author:\n - name: Eduard T. Klapwijk\n orcid: 0000-0002-8936-0365\n corresponding: true\n email: [email protected]\n roles:\n - Data curation\n - Formal analysis\n - Software\n - Visualization\n - Writing - original draft\n - Writing - review & editing\n affiliations:\n - 'Erasmus University Rotterdam, Netherlands'\n - name: Joran Jongerling\n orcid: 0000-0001-5697-1381\n corresponding: false\n roles:\n - Methodology\n - Software\n - Validation\n - Visualization\n - Writing - review & editing\n affiliations:\n - 'Tilburg University, Netherlands'\n - name: Herbert Hoijtink\n orcid: 0000-0001-8509-1973\n corresponding: false\n roles:\n - Conceptualization\n - Methodology\n - Software\n - Supervision\n - Visualization\n - Writing - review & editing\n affiliations:\n - 'Utrecht University, Netherlands'\n - name: Eveline A. Crone\n orcid: 0000-0002-7508-6078\n corresponding: false\n roles:\n - Conceptualization\n - Funding acquisition\n - Investigation\n - Methodology\n - Supervision\n - Writing - review & editing\n affiliations:\n - 'Erasmus University Rotterdam, Netherlands'\n - 'Leiden University, Netherlands'\n keywords:\n - power analysis\n - region of interest\n - effect size\n - R package\n - sample sizes\n - Bayesian updating\n abstract: |\n Task-related functional MRI (fMRI) studies need to be properly powered with an adequate sample size to reliably detect effects of interest. But for most fMRI studies, it is not straightforward to determine a proper sample size using power calculations based on published effect sizes. Here, we present an alternative approach of sample size estimation with empirical Bayesian updating. First, this method provides an estimate of the required sample size using existing data from a similar task and similar region of interest. Using this estimate researchers can plan their research project, and report empirically determined sample size estimations in their research proposal or pre-registration. Second, researchers can expand the sample size estimations with new data. We illustrate this approach using four existing fMRI data sets where Cohen’s d is the effect size of interest for the hemodynamic response in the task condition of interest versus a control condition, and where a Pearson correlation between task effect and age is the covariate of interest. We show that sample sizes to reliably detect effects differ between various tasks and regions of interest. We provide an R package to allow researchers to use Bayesian updating with other task-related fMRI studies.\n date: last-modified\n bibliography:\n - references.bib\n google-scholar: true\n toc-location: left\n clear-hidden-classes: none\n remove-hidden: all\n unroll-markdown-cells: true\n \n"]
[1,"Output created: _manuscript/index.html\n\n\u001B[32mWatching files for changes\u001B[39m\n"]
[1,"\u001B[32mGET: /\u001B[39m\n"]
[1,"\u001B[1m\u001B[34mRendering notebook previews\u001B[39m\u001B[22m\n\u001B[1m\u001B[34m[1/2] figures-cohens_d.qmd\u001B[39m\u001B[22m\n"]
[1,"\u001B[1m\u001B[34m[2/2] figures-correlations.qmd\u001B[39m\u001B[22m\n"]
[1,"\u001B[32mGET: /\u001B[39m\n"]
2 changes: 1 addition & 1 deletion .Rproj.user/61FBC8AB/pcs/source-pane.pper
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"activeTab": 1
"activeTab": 2
}
32 changes: 16 additions & 16 deletions .quarto/embed/notebooks/figures-cohens_d.embed.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"\n",
"Load libraries to produce figures:"
],
"id": "fd729612-c833-46f2-9cff-6a178c54fe00"
"id": "9b8bfc66-1fdc-4a3e-8274-ae66f7a94433"
},
{
"cell_type": "code",
Expand All @@ -26,15 +26,15 @@
"install_github(\"eduardklap/neuroUp\")\n",
"library(neuroUp)"
],
"id": "59530b55-349b-4b55-8676-e892017262af"
"id": "492c6840-a65f-41b5-a998-1ccb51ee7a7d"
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Set seed and create Figure 1A for the Feedback task DLPFC ROI:"
],
"id": "0f8292e9-8433-4d7c-8692-19a7285da715"
"id": "854d782b-717b-4e80-87d7-0dda212828ad"
},
{
"cell_type": "code",
Expand All @@ -53,15 +53,15 @@
" k = 1000, \n",
" name = \"A. Feedback DLPFC\")"
],
"id": "73836737-caff-4846-a36d-e2da2c2886a9"
"id": "f24b4781-ecc1-47ba-b843-722b7550eab7"
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Set seed and create Figure 1B for the Gambling task NAcc ROI:"
],
"id": "e8a0c713-ae7c-4646-98cd-c3e81b536795"
"id": "bcfa2231-4f2a-46a2-8012-dd51280df94c"
},
{
"cell_type": "code",
Expand All @@ -80,15 +80,15 @@
" k = 1000, \n",
" name = \"B. Gambling NAcc\")"
],
"id": "4df10f41-737e-41d1-b8d9-24a88bceef68"
"id": "63663959-0fe4-4f4a-8fa7-06c0382a9503"
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Set seed and create Figure 1C for the Self-evaluations task mPFC ROI:"
],
"id": "a5aea976-27a5-43fd-8275-7db190817aed"
"id": "bd0e3906-d760-4e67-ba1d-58c9b927248c"
},
{
"cell_type": "code",
Expand All @@ -107,15 +107,15 @@
" k = 10, \n",
" name = \"C. Self-evaluations mPFC\")"
],
"id": "cd28955e-4f5b-4ad3-921d-de83c5de2f4a"
"id": "f0706ba9-b71d-4e4f-8893-83b3ce2c895f"
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Set seed and create Figure 1D for the Gaining for self task NAcc ROI:"
],
"id": "7f47d7fd-fef9-4e13-b6d7-1ae767b5f4fa"
"id": "32cbcc72-8572-4e72-b9f5-530399a29229"
},
{
"cell_type": "code",
Expand All @@ -134,15 +134,15 @@
" k = 10, \n",
" name = \"D. Gaining self NAcc\")"
],
"id": "d0fde9e3-cdc0-43c9-837a-5054b07a6619"
"id": "fae93ee4-5958-4f3e-98a9-0985c269aae7"
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Combine figures 1A-D in one figure for Cohen’s d estimates:"
],
"id": "6ef6efed-2db4-4ea4-8f96-0236ad62f9c5"
"id": "0a7187ee-3932-4aef-a2ae-757c1463264a"
},
{
"cell_type": "code",
Expand All @@ -152,15 +152,15 @@
"source": [
"Fig1a$fig_cohens_d + Fig1b$fig_cohens_d + Fig1c$fig_cohens_d + Fig1d$fig_cohens_d"
],
"id": "8c53c147-330a-49a3-9a3f-680e346ec1c9"
"id": "fdf84737-0fc4-4324-be4d-5c8523ca713a"
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Combine figures 1A-D in one figure for the proportion of intervals not containing the value 0:"
],
"id": "43ee7fbb-8ff6-4a15-9502-c716300522ea"
"id": "3d3a1197-cb83-45fd-a04d-e40ce075eb1e"
},
{
"cell_type": "code",
Expand All @@ -170,15 +170,15 @@
"source": [
"Fig1a$fig_d_nozero + Fig1b$fig_d_nozero + Fig1c$fig_d_nozero + Fig1d$fig_d_nozero"
],
"id": "8530c18d-b72c-445b-86ee-4e5e0246ded3"
"id": "57889519-d0ce-4ee4-9c43-97481fd19e73"
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Extract numbers to make table 2:"
],
"id": "a2c93db3-006e-4752-8fd2-222b70075d18"
"id": "26342211-d98e-47fc-8846-b4e238bd7c6d"
},
{
"cell_type": "code",
Expand All @@ -198,7 +198,7 @@
"\n",
"# use numbers to make a table in text"
],
"id": "bb4a27e3-ed38-4563-96b9-e174bf48c7a3"
"id": "41a8e581-4d5e-4afe-a147-2b409a16fa48"
}
],
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion .quarto/xref/fad5c24f
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"entries":[{"caption":"Mean estimates (with credible interval in brackets) of Cohen’s d for five different sample sizes (starting with n=20, then 1/5th parts of the total dataset) of the 1000 HDCI’s. DLPFC = dorsolateral prefrontal cortex; mPFC = medial prefrontal cortex; NAcc = nucleus accumbens.","order":{"number":2,"section":[3,1,0,0,0,0,0]},"key":"tbl-2"},{"caption":"Estimates of task effects for five different sample sizes (starting with N=20, then 1/5th parts of the total dataset). For each sample size 10 randomly chosen HDCI’s out of the 1000 HDCI’s computed are displayed (in light blue, permutation numbers used are displayed to the right of each subfigure). The average estimate with credible interval summarizing the 1000 HDCI’s for each sample size are plotted in reddish purple. DLPFC = dorsolateral prefrontal cortex; mPFC = medial prefrontal cortex; NAcc = nucleus accumbens.","order":{"number":1,"section":[3,1,0,0,0,0,0]},"key":"fig-1"},{"caption":"Estimates of Pearson’s correlation between age and the task effect for five different sample sizes (starting with N=20, then 1/5th parts of the total dataset). For each sample size 10 randomly chosen HDCI’s out of the 1000 HDCI’s computed are displayed (in green, permutation numbers used are displayed to the right of each subfigure). The average estimate with credible interval summarizing the 1000 HDCI’s for each sample size are plotted in orange. DLPFC = dorsolateral prefrontal cortex; mPFC = medial prefrontal cortex; NAcc = nucleus accumbens. Age is modeled as linearly increasing or decreasing.","order":{"number":3,"section":[3,2,0,0,0,0,0]},"key":"fig-3"},{"caption":"Mean estimates (with credible interval in brackets) of Pearson’s correlation between age and the task effect for five different sample sizes (starting with N=20, then 1/5th parts of the total dataset) of the 1000 HDCI’s. DLPFC = dorsolateral prefrontal cortex; mPFC = medial prefrontal cortex; NAcc = nucleus accumbens.","order":{"number":3,"section":[3,2,0,0,0,0,0]},"key":"tbl-3"},{"caption":"For each task, for five different sample sizes (starting with N=20, then 1/5th parts of the total dataset), the proportion of intervals not containing the value 0 is plotted inorange. Age is modeled as linearly increasing or decreasing.","order":{"number":4,"section":[3,2,0,0,0,0,0]},"key":"fig-4"},{"caption":"For each task, for five different sample sizes (starting with n=20, then 1/5th parts of the total dataset), the proportion of intervals not containing the value 0 is plotted in reddish purple.","order":{"number":2,"section":[3,1,0,0,0,0,0]},"key":"fig-2"},{"caption":"Overview of tasks processed in the current study.","order":{"number":1,"section":[2,0,0,0,0,0,0]},"key":"tbl-1"}],"headings":["introduction","bayesian-updating","the-highest-density-credible-interval-hdci","sample-size-determination","neuroup-r-package","method-materials","data-and-processing","braintime-study","feedback-task","gambling-task","self-concept-study","self-evaluations-task","vicarious-charity-task","fmri-analysis","regions-of-interest","results","task-effects-using-cohens-d","pearson-correlations-between-task-effects-and-age","discussion","practical-recommendations","acknowledgments","references"]}
{"headings":["introduction","bayesian-updating","the-highest-density-credible-interval-hdci","sample-size-determination","neuroup-r-package","method-materials","data-and-processing","braintime-study","feedback-task","gambling-task","self-concept-study","self-evaluations-task","vicarious-charity-task","fmri-analysis","regions-of-interest","results","task-effects-using-cohens-d","pearson-correlations-between-task-effects-and-age","discussion","practical-recommendations","acknowledgments","references"],"entries":[{"key":"tbl-1","order":{"number":1,"section":[2,0,0,0,0,0,0]},"caption":"Overview of tasks processed in the current study."},{"key":"fig-3","order":{"number":3,"section":[3,2,0,0,0,0,0]},"caption":"Estimates of Pearson’s correlation between age and the task effect for five different sample sizes (starting with N=20, then 1/5th parts of the total dataset). For each sample size 10 randomly chosen HDCI’s out of the 1000 HDCI’s computed are displayed (in green, permutation numbers used are displayed to the right of each subfigure). The average estimate with credible interval summarizing the 1000 HDCI’s for each sample size are plotted in orange. DLPFC = dorsolateral prefrontal cortex; mPFC = medial prefrontal cortex; NAcc = nucleus accumbens. Age is modeled as linearly increasing or decreasing."},{"key":"tbl-3","order":{"number":3,"section":[3,2,0,0,0,0,0]},"caption":"Mean estimates (with credible interval in brackets) of Pearson’s correlation between age and the task effect for five different sample sizes (starting with N=20, then 1/5th parts of the total dataset) of the 1000 HDCI’s. DLPFC = dorsolateral prefrontal cortex; mPFC = medial prefrontal cortex; NAcc = nucleus accumbens."},{"key":"fig-4","order":{"number":4,"section":[3,2,0,0,0,0,0]},"caption":"For each task, for five different sample sizes (starting with N=20, then 1/5th parts of the total dataset), the proportion of intervals not containing the value 0 is plotted inorange. Age is modeled as linearly increasing or decreasing."},{"key":"fig-1","order":{"number":1,"section":[3,1,0,0,0,0,0]},"caption":"Estimates of task effects for five different sample sizes (starting with N=20, then 1/5th parts of the total dataset). For each sample size 10 randomly chosen HDCI’s out of the 1000 HDCI’s computed are displayed (in light blue, permutation numbers used are displayed to the right of each subfigure). The average estimate with credible interval summarizing the 1000 HDCI’s for each sample size are plotted in reddish purple. DLPFC = dorsolateral prefrontal cortex; mPFC = medial prefrontal cortex; NAcc = nucleus accumbens."},{"key":"fig-2","order":{"number":2,"section":[3,1,0,0,0,0,0]},"caption":"For each task, for five different sample sizes (starting with n=20, then 1/5th parts of the total dataset), the proportion of intervals not containing the value 0 is plotted in reddish purple."},{"key":"tbl-2","order":{"number":2,"section":[3,1,0,0,0,0,0]},"caption":"Mean estimates (with credible interval in brackets) of Cohen’s d for five different sample sizes (starting with n=20, then 1/5th parts of the total dataset) of the 1000 HDCI’s. DLPFC = dorsolateral prefrontal cortex; mPFC = medial prefrontal cortex; NAcc = nucleus accumbens."}]}
Loading

0 comments on commit 1082fa8

Please sign in to comment.