Type: Package
Title: Plan Sample Size for Task fMRI Research using Bayesian Updating
Version: 0.3.1
Description: Calculate the precision in mean differences (raw or Cohen's D) and correlation coefficients for different sample sizes. Uses permutations of the collected functional magnetic resonance imaging (fMRI) region of interest data. Method described in Klapwijk, Jongerling, Hoijtink and Crone (2024) <doi:10.31234/osf.io/cz32t>.
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.3.2
NeedsCompilation: no
Imports: dplyr, rlang, ggplot2, psychometric, tibble, magrittr, bootstrap
Suggests: knitr, readr, rmarkdown, testthat (≥ 3.0.0), vdiffr
Config/testthat/edition: 3
Depends: R (≥ 2.10)
VignetteBuilder: knitr
URL: https://eduardklap.github.io/neuroUp/, https://github.com/eduardklap/neuroUp
BugReports: https://github.com/eduardklap/neuroUp/issues
Packaged: 2024-08-23 13:23:08 UTC; eduardklapwijk
Author: Eduard Klapwijk ORCID iD [aut, cre, cph], Herbert Hoijtink ORCID iD [aut, cph], Joran Jongerling ORCID iD [aut, cph]
Maintainer: Eduard Klapwijk <et.klapwijk@gmail.com>
Repository: CRAN
Date/Publication: 2024-08-28 08:20:05 UTC

Pipe operator

Description

See ⁠magrittr::[\%>\%][magrittr::pipe]⁠ for details.

Usage

lhs %>% rhs

Arguments

lhs

A value or the magrittr placeholder.

rhs

A function call using the magrittr semantics.

Value

The result of calling rhs(lhs).


Estimate correlations

Description

estim_corr determines point estimate, SD and SE, 95% Credibility Intervals, and interval width, for Pearson correlations for multiple sample sizes

Usage

estim_corr(data, vars_of_interest, sample_size, k = 50, name = "")

Arguments

data

Dataframe with the data to be analyzed

vars_of_interest

Vector containing the names of the variables to be correlated: c("var1", "var2")

sample_size

The range of sample size to be used: min:max

k

The number of permutations to be used for each sample size. Defaults to 50

name

The title of the dataset or variables to be displayed with the figure. Defaults to ""

Value

Examples

data_gambling <- gambling
estim_corr(data_gambling,
  c("lnacc_self_winvsloss", "age"), 20:221,
  10, "Gambling NAcc correlation with age")

Estimate differences (unstandardized and Cohen's d)

Description

estim_diff determines point estimate, SD and SE, 95% Credibility Intervals, and interval width, for both differences in raw means and Cohen's d's for multiple sample sizes

Usage

estim_diff(data, vars_of_interest, sample_size, k = 50, name = "")

Arguments

data

Dataframe with the data to be analyzed

vars_of_interest

Vector containing the names of the variables to be compared on their means: c("var1", "var2")

sample_size

The range of sample size to be used min:max

k

The number of permutations to be used for each sample size. Defaults to 50

name

The title of the dataset or variables to be displayed with the figure. Defaults to ""

Value

Examples

data_feedback <- feedback
estim_diff(data_feedback,
  c("mfg_learning", "mfg_application"), 20:71,
  10, "Feedback middle frontal gyrus")

Feedback task fMRI region of interest data

Description

A dataset containing the parameter estimates of the atlas-based middle frontal gyrus (Harvard-Oxford cortical atlas; thresholded at 50%; center-of-mass coordinates x = -4, y = 22, z = 43), ), with one value for the mean activation during learning and one value for the mean activation during application for all participants.

Usage

feedback

Format

A data frame with 271 rows and 4 variables:

participant_id

unique id for every participant

age

age in years (8.01-25.95)

mfg_learning

parameter estimates for the middle frontal gyrus during the learning phase (-2.54-4.83)

mfg_application

parameter estimates for the middle frontal gyrus during the application phase (-6.46-3.09)

Source

Peters, S., & Crone, E. A. (2017). Increased striatal activity in adolescence benefits learning. Nature Communications, 8(1), 1983. doi:10.1038/s41467-017-02174-z


Gambling task fMRI region of interest data

Description

A dataset containing the parameter estimates of the anatomical mask of the left nucleus accumbens (Harvard-Oxford subcortical atlas; thresholded at 40%; 28 voxels included), with one value for the mean activation during winning and one value for the mean activation during losing for all participants.

Usage

gambling

Format

A data frame with 221 rows and 5 variables:

participant_id

unique id for every participant

age

age in years (11.94-28.46)

lnacc_self_win

parameter estimates for the left nucleas accumbens during winning (-2.78-3.41)

lnacc_self_loss

parameter estimates for the left nucleas accumbens during losing (-3.84-3.28)

lnacc_self_winvsloss

parameter estimates for the left nucleas accumbens for the contrast winning versus losing (-2.60-4.47)

Source

Schreuders, E., Braams, B. R., Blankenstein, N. E., Peper, J. S., Guroglu, B., & Crone, E. A. (2018). Contributions of reward sensitivity to ventral striatum activity across adolescence and early adulthood. Child development, 89(3), 797-810. doi:10.1111/cdev.13056


Self-evaluations task fMRI region of interest data

Description

A dataset containing the parameter estimates of the left medial prefrontal cortex (x = -6, y = 50, z = 4), with one value for the mean activation during self-evaluation and one value for the mean activation during the control condition for all participants.

Usage

self_eval

Format

A data frame with 149 rows and 4 variables:

participant_id

unique id for every participant

age

age in years (11.00-20.92)

mpfc_self

parameter estimates for the left medial prefrontal cortex during self-evaluation (-2.82-4.97)

mpfc_control

parameter estimates for the lmedial prefrontal cortex during the control condition (-7.17-3.50)

Source

van der Cruijsen, R., Blankenstein, N. E., Spaans, J. P., Peters, S., & Crone, E. A. (2023). Longitudinal self-concept development in adolescence. Social Cognitive and Affective Neuroscience, 18(1), nsac062. doi:10.1093/scan/nsac062


Vicarious Charity task fMRI region of interest data

Description

A dataset containing the parameter estimates from the anatomical mask of the left nucleus accumbens (Harvard-Oxford subcortical atlas; thresholded at 40%; center-of-mass coordinates x = -10, y = 12, z = -7; 28 voxels included), with one value for the mean activation during gaining for self and one value for the mean activation during no-gain for self and charity for all participants.

Usage

vicar_char

Format

A data frame with 156 rows and 4 variables:

participant_id

unique id for every participant

age

age in years (11.00-21.17)

nacc_selfgain

parameter estimates for the left nucleus accumbens during gaining for self (-5.66-3.05)

nacc_bothnogain

parameter estimates for the left nucleus accumbens during no-gain for self and charity (-6.44-2.97)

Source

Spaans, J., Peters, S., Becht, A., van der Cruijsen, R., van de Groep, S., & Crone, E. A. (2023). Longitudinal neural and behavioral trajectories of charity contributions across adolescence. Journal of Research on Adolescence, 33(2), 480-495. doi:10.1111/jora.12820