Title: | Plan Sample Size for Task fMRI Research using Bayesian Updating |
---|---|
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>. |
Authors: | Eduard Klapwijk [aut, cre, cph] , Herbert Hoijtink [aut, cph] , Joran Jongerling [aut, cph] |
Maintainer: | Eduard Klapwijk <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.3.1 |
Built: | 2024-11-21 05:21:46 UTC |
Source: | https://github.com/eduardklap/neuroup |
estim_corr
determines point estimate, SD and SE, 95% Credibility Intervals,
and interval width, for Pearson correlations for multiple sample sizes
estim_corr(data, vars_of_interest, sample_size, k = 50, name = "")
estim_corr(data, vars_of_interest, sample_size, k = 50, name = "")
data |
Dataframe with the data to be analyzed |
vars_of_interest |
Vector containing the names of the variables to be
correlated: |
sample_size |
The range of sample size to be used: |
k |
The number of permutations to be used for each sample size. Defaults
to |
name |
The title of the dataset or variables to be displayed with the
figure. Defaults to |
tbl_select
returns a tibble::tibble()
containing estimates of the Pearson
correlation between two correlated variables with associated SD, SE, 95% CI,
and width of the 95% CI (lower, upper) for five different sample sizes
(starting with the minimum sample size, then 1/5th parts of the total
dataset).
fig_corr
returns a scatterplot where for the five different sample sizes, 10
out of the total number of HDCIs computed are displayed (in green). The
average estimate with credible interval summarizing the total number of HDCIs
for each sample size are plotted in orange
fig_corr_nozero
returns a barplot where for each of the five sample sizes
the proportion of permutations not containing zero is displayed
tbl_total
returns a tibble::tibble()
containing estimates of the Pearson
correlation between two correlated variables with associated SD, SE, 95% CI,
and width of the 95% CI (lower, upper) for all sample sizes, including the
permutation number.
data_gambling <- gambling estim_corr(data_gambling, c("lnacc_self_winvsloss", "age"), 20:221, 10, "Gambling NAcc correlation with age")
data_gambling <- gambling estim_corr(data_gambling, c("lnacc_self_winvsloss", "age"), 20:221, 10, "Gambling NAcc correlation with age")
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
estim_diff(data, vars_of_interest, sample_size, k = 50, name = "")
estim_diff(data, vars_of_interest, sample_size, k = 50, name = "")
data |
Dataframe with the data to be analyzed |
vars_of_interest |
Vector containing the names of the variables to be
compared on their means: |
sample_size |
The range of sample size to be used |
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 |
tbl_select
returns a tibble::tibble()
containing estimates of the
difference in raw means and of Cohen's d with associated SD, SE, 95% CI, and
width of the 95% CI (lower, upper) for five different sample sizes (starting
with the minimum sample size, then 1/5th parts of the total dataset).
fig_diff
returns a scatterplot for the difference in raw means, where for
the five different sample sizes, 10 out of the total number of HDCI's
computed are displayed (in light blue). The average estimate with credible
interval summarizing the total number of HDCIs for each sample size are
plotted in reddish purple
fig_nozero
returns a barplot where for each of the five sample sizes the
proportion of permutations not containing zero is displayed for the
difference in raw means
fig_cohens_d
returns a scatterplot for Cohen's d, where for the five
different sample sizes, 10 out of the total number of HDCI's computed are
displayed (in light blue). The average estimate with credible interval
summarizing the total number of HDCIs for each sample size are plotted in
reddish purple
fig_d_nozero
returns a barplot where for each of the five sample sizes the
proportion of permutations not containing zero is displayed for Cohen's d
tbl_total
returns a tibble::tibble()
containing estimates of the difference
in raw means and of Cohen's d with associated SD, SE, 95% CI, and width of
the 95% CI (lower, upper) for all sample sizes, including the permutation
number.
data_feedback <- feedback estim_diff(data_feedback, c("mfg_learning", "mfg_application"), 20:71, 10, "Feedback middle frontal gyrus")
data_feedback <- feedback estim_diff(data_feedback, c("mfg_learning", "mfg_application"), 20:71, 10, "Feedback middle frontal gyrus")
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.
feedback
feedback
A data frame with 271 rows and 4 variables:
unique id for every participant
age in years (8.01-25.95)
parameter estimates for the middle frontal gyrus during the learning phase (-2.54-4.83)
parameter estimates for the middle frontal gyrus during the application phase (-6.46-3.09)
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
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.
gambling
gambling
A data frame with 221 rows and 5 variables:
unique id for every participant
age in years (11.94-28.46)
parameter estimates for the left nucleas accumbens during winning (-2.78-3.41)
parameter estimates for the left nucleas accumbens during losing (-3.84-3.28)
parameter estimates for the left nucleas accumbens for the contrast winning versus losing (-2.60-4.47)
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
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.
self_eval
self_eval
A data frame with 149 rows and 4 variables:
unique id for every participant
age in years (11.00-20.92)
parameter estimates for the left medial prefrontal cortex during self-evaluation (-2.82-4.97)
parameter estimates for the lmedial prefrontal cortex during the control condition (-7.17-3.50)
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
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.
vicar_char
vicar_char
A data frame with 156 rows and 4 variables:
unique id for every participant
age in years (11.00-21.17)
parameter estimates for the left nucleus accumbens during gaining for self (-5.66-3.05)
parameter estimates for the left nucleus accumbens during no-gain for self and charity (-6.44-2.97)
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