Title: | Multiverse Analyses for Conditioning Data |
---|---|
Description: | A suite of functions for performing analyses, based on a multiverse approach, for conditioning data. Specifically, given the appropriate data, the functions are able to perform t-tests, analyses of variance, and mixed models for the provided data and return summary statistics and plots. The function is also able to return for all those tests p-values, confidence intervals, and Bayes factors. The methods are described in Lonsdorf, Gerlicher, Klingelhofer-Jens, & Krypotos (2022) <doi:10.1016/j.brat.2022.104072>. |
Authors: | Angelos-Miltiadis Krypotos [aut, cre, cph] |
Maintainer: | Angelos-Miltiadis Krypotos <[email protected]> |
License: | GPL-3 |
Version: | 0.1.3 |
Built: | 2025-02-04 06:12:38 UTC |
Source: | https://github.com/angelospsy/multifear |
Basic function for running the Bayesian t-tests included in the main analyses
bt_test_mf( cs1, cs2, data, subj, group = NULL, na.rm = FALSE, paired = TRUE, rscale = "medium", phase = "acquisition", dv = "scr", exclusion = "full data", cut_off = "full data" )
bt_test_mf( cs1, cs2, data, subj, group = NULL, na.rm = FALSE, paired = TRUE, rscale = "medium", phase = "acquisition", dv = "scr", exclusion = "full data", cut_off = "full data" )
cs1 |
The column name(s) of the conditioned responses for the first conditioned stimulus |
cs2 |
The column name(s) of the conditioned responses for the second conditioned stimulus |
data |
A data frame containing all the relevant columns for the analyses |
subj |
The name of the column including the participant numbers. Unique numbers are expected |
group |
the name of the group, if included, default to |
na.rm |
Whether NAs should be removed, default to |
paired |
Whether the t-test refers to dependent (i.e., paired) or to independent sample(s). Default to |
rscale |
r scale to be used in the prior of the alternative hypothesis, default to "medium". |
phase |
The conditioned phase that the analyses refer to. Accepted values are |
dv |
name of the measured conditioned response. Default to |
exclusion |
Name of the data reduction procedure used. Default to |
cut_off |
cut off Name of the cut_off applied. Default to |
This is a wrapper function function around the BayesFactor::ttestBF(),
running multiple Bayesian t-tests. Similar to the t_test_mf
function, the function will run different t-tests based on the phase that the t-tests refer to. So, in case of the acquisition phase, there will be a t-test of differences and positive differences, whereas for the extinction phase a t-test for differences and negative differences.
A tibble with the following column names:
x: the name of the independent variable (e.g., cs)
y: the name of the dependent variable as this defined in the dv
argument
exclusion: see exclusion
argument
model: the model that was run (e.g., t-test)
controls: ignore this column for this test
method: the model that was run
p.value: irrelevant here
effect.size: irrelevant here
effect.size.ma: irrelevant here
estimate: the estimate of the test run
statistic: the t-value
conf.low: the lower confidence interval for the estimate
conf.high: the higher confidence interval for the estimate
framework: were the data analysed within a NHST or Bayesian framework?
data_used: a list with the data used for the specific test
# Load example data data(example_data) # Paired sample t-tests bt_test_mf(cs1 = "CSP1", cs2 = "CSM1", subj = "id", data = example_data) # Independent sample t-tests bt_test_mf(cs1 = "CSP1", cs2 = "CSM1", subj = "id", group = "group", data = example_data)
# Load example data data(example_data) # Paired sample t-tests bt_test_mf(cs1 = "CSP1", cs2 = "CSM1", subj = "id", data = example_data) # Independent sample t-tests bt_test_mf(cs1 = "CSP1", cs2 = "CSM1", subj = "id", group = "group", data = example_data)
Function for separating the conditioned responses into multiple pieces
chop_cs(cs, data, subj, group = NULL, prefix = "cs", na.rm = FALSE)
chop_cs(cs, data, subj, group = NULL, prefix = "cs", na.rm = FALSE)
cs |
The column name(s) of the conditioned responses |
data |
A data frame containing all the relevant columns for the analyses |
subj |
The name of the column including the participant numbers. Unique numbers are expected |
group |
default to |
prefix |
prefix to be included in the end data frame |
na.rm |
Whether NAs should be removed, default to |
A tibble with the following column names: "id" = id column; "top10per" = mean of top 10 "bottom10per" = mean of bottom 10 "minfirst = all trials minus the first one; "all" = mean of all trials; "t33per = mean of top 33 "m33per" = mean of medium 33 "b33per" = mean of bottom 33 "fhalf" = mean of first half of the trials; "lhalf" = mean of last half of the trials; "ftrial" = first trial; "ltrial" = last trial; "t20per" = mean of top 20 "b20per" = mean of bottom 20 "f2trial" = mean of first two trials; "l2trial" = mean of last two trials; "per2_X" = mean per two trials (i.e., block), with X referring to the number of block.
data(example_data) chop_cs(cs = paste0("CSP", 1:10), data = example_data, subj = "id")
data(example_data) chop_cs(cs = paste0("CSP", 1:10), data = example_data, subj = "id")
Function for separating the conditioned responses into multiple pieces for two CSs.
chop_css(cs1, cs2, data, subj, cs_paired = NULL, group = NULL, na.rm = FALSE)
chop_css(cs1, cs2, data, subj, cs_paired = NULL, group = NULL, na.rm = FALSE)
cs1 |
The column name(s) of the conditioned responses for the first conditioned stimulus |
cs2 |
The column name(s) of the conditioned responses for the second conditioned stimulus |
data |
A data frame containing all the relevant columns for the analyses |
subj |
The name of the column including the participant numbers. Unique numbers are expected |
cs_paired |
A character vector with the trials that were paired. Default is set to |
group |
the name of the group, if included, default to |
na.rm |
Whether NAs should be removed, default to |
Function for computing mean responses across CSs
combine_cs(cs1, cs2, data, na.rm = FALSE)
combine_cs(cs1, cs2, data, na.rm = FALSE)
cs1 |
The column name(s) of the conditioned responses for the first conditioned stimulus |
cs2 |
The column name(s) of the conditioned responses for the second conditioned stimulus |
data |
A data frame containing all the relevant columns for the analyses |
na.rm |
Whether NAs should be removed, default to |
A tibble with the initial data frame (given by the data
argument)
together with an additional column with the means for the columns defined
in the cs1 and cs2 arguments.
A simulated data set containing conditioned skin conductance responses for 10 conditioned stimulus plus trials and a equal number of conditioned stimulus minus trials The variables are as follows:
example_data
example_data
A data frame with 40 rows and 22 variables:
Conditioned stimulus plus, trial 1
Conditioned stimulus plus, trial 2
Conditioned stimulus plus, trial 3
Conditioned stimulus plus, trial 4
Conditioned stimulus plus, trial 5
Conditioned stimulus plus, trial 6
Conditioned stimulus plus, trial 7
Conditioned stimulus plus, trial 8
Conditioned stimulus plus, trial 9
Conditioned stimulus plus, trial 10
Conditioned stimulus minus, trial 1
Conditioned stimulus minus, trial 2
Conditioned stimulus minus, trial 3
Conditioned stimulus minus, trial 4
Conditioned stimulus minus, trial 5
Conditioned stimulus minus, trial 6
Conditioned stimulus minus, trial 7
Conditioned stimulus minus, trial 8
Conditioned stimulus minus, trial 9
Conditioned stimulus minus, trial 10
Participant number
Group assignment
Exclusion criteria
exclusion_criteria(data, cutoff = 0)
exclusion_criteria(data, cutoff = 0)
data |
a data object generated by the |
cutoff |
cut off score |
Here the different exclusion criteria are applied to the provided data.
A tibble with a brace of smaller tibbles, with each sub-tibble including a data frame after each one of the exclusion criteria – mentioned in the multifear::chop_css
function – is applied.
Basic function for forest plot
forestplot_mf( data, ci = TRUE, include_label_text = TRUE, reported_effect = "common", ... )
forestplot_mf( data, ci = TRUE, include_label_text = TRUE, reported_effect = "common", ... )
data |
a universe_mf or multiverse_mf object |
ci |
should confidence intervals be included – default to TRUE |
include_label_text |
Whether the labels for each effect should be include. Default to |
reported_effect |
Option as to what effect size to report. The options are: "common" (default option), "anova", or "ttest". |
... |
any additional argument |
This is a wrapper around the forestplot::forestplot
function.
The function only uses the ANOVAs and the t-tests. For the t-tests though
it includes only the two-sided, as they are the same with the one-sided ones
and having both would probably give a false picture of the effect.
The include_label_text can be used when multiple plots need to be combined side by side, so one of them does not include the labels.
A plot #'
Function for summarizing the multiverse results.
inference_cs(data, alpha_level = 0.05, na.rm = FALSE, framework = "Both")
inference_cs(data, alpha_level = 0.05, na.rm = FALSE, framework = "Both")
data |
a data frame with the results of a multiverse analyses. |
alpha_level |
What should be the alpha level used (default to 0.05). |
na.rm |
Should NA's be removed (default to |
framework |
Inference framework. Values could be "NHST", "Bayesian", or "Both" (no case sensitivity) |
For now the function returns mean, median, standard deviations of p values and proportion of p values below a criterion defined by the alpha_level
parameter (default to 0.05) as well as mean Bayes factors (please see the 'framework' argument). The user may choose to drop the NAs for the summary statistic.
A data frame with summaries of the results.
Function for plotting the multiverse results.
inference_plot( data, alpha_level = 0.05, add_line = TRUE, na.rm = FALSE, framework = "Both", col = c("gray45", "maroon4", "brown1"), return_plot = TRUE )
inference_plot( data, alpha_level = 0.05, add_line = TRUE, na.rm = FALSE, framework = "Both", col = c("gray45", "maroon4", "brown1"), return_plot = TRUE )
data |
a data frame with the results of a multiverse analysis |
alpha_level |
What should be the alpha level used (default to 0.05) |
add_line |
Whether to add a line with the alpha level in the produced histogram (default to |
na.rm |
Should NA's be removed (default to |
framework |
Inference framework. Values could be "NHST", "Bayesian", or "Both" (no case sensitivity) |
col |
A length three vector with the colors to be used for ANOVAS, t-tests, and mixed models (in this order) |
return_plot |
Whether to return a plot or not (default too TRUE) |
For the plot the NAs in the p.value
column are removed automatically – so what ggplot2
does automatically but here no message is returned.
The return_plot
argument is there in case you want to combine multiple panels and you do
not want to have a plot returned every time you run the code.
A histogram summarizing the results.
Basic function for running mixed models for the multiverse analysis
mixed_mf( cs1, cs2, data, subj, group = NULL, phase = "acquisition", dv = "scr", exclusion = "full data", cut_off = "full data" )
mixed_mf( cs1, cs2, data, subj, group = NULL, phase = "acquisition", dv = "scr", exclusion = "full data", cut_off = "full data" )
cs1 |
The column name(s) of the conditioned responses for the first conditioned stimulus |
cs2 |
The column name(s) of the conditioned responses for the second conditioned stimulus |
data |
A data frame containing all the relevant columns for the analyses |
subj |
The name of the column including the participant numbers. Unique numbers are expected |
group |
the name of the group, if included, default to |
phase |
The conditioned phase that the analyses refer to. Accepted values are |
dv |
name of the measured conditioned response. Default to |
exclusion |
Name of the data reduction procedure used. Default to |
cut_off |
cut off Name of the cut_off applied. Default to |
The function assumes that you include more than 1 trial per CS. The function returns an error if that is not the function.
The function performs by default two dependent variable standardizations, the one per subject and the other one without taking subject into account.
In case time is included, the function computes the intercept – i.e., the 0 point – on the middle of the time sequence.
The following models are run and compared: a) Intercept only model, b) Intercept plus CS model, and c) Intercept plus CS x
Time interaction.
Separate models are run with 'Subject' as random factor, as well as 'Subject and Time' as random factors.
The model is fit by maximizing the log-likelihood (i.e., "ML" term in nlme::lme).
The model comparison is done using 'BIC'.
A data frame with the results.
The data frame returned is the standard one returned in all function in the package. Specifically we have:
A tibble with the following column names:
x: the name of the independent variable (e.g., cs). There, you can see the term of the model that is returned. So, not the full model is returned but only this particular term.
y: the name of the dependent variable as this defined in the dv
argument
exclusion: see exclusion
argument
model: the model that was run (e.g., mixed_model)
controls: ignore this column for this test
method: the model that was run
p.value: the p-value for each factor
effect.size: irrelevant here
effect.size.ma: irrelevant here
effect.size.ma.lci: irrelevant here
effect.size.ma.hci: irrelevant here
statistic: the t-value for each factor
conf.low: the lower confidence interval for the estimate
conf.high: the higher confidence interval for the estimate
data_used: a list with the data used for the specific test
# Load example data data(example_data) cs1 <- paste0("CSP", 1:2) cs2 <- paste0("CSM", 1:2) subj <- "id" # mixed models without groups mixed_mf(cs1 = cs1, cs2 = cs2, subj = subj, data = example_data) # mixed models with groups mixed_mf(cs1 = cs1, cs2 = cs2, subj = subj, group = "group", data = example_data)
# Load example data data(example_data) cs1 <- paste0("CSP", 1:2) cs2 <- paste0("CSM", 1:2) subj <- "id" # mixed models without groups mixed_mf(cs1 = cs1, cs2 = cs2, subj = subj, data = example_data) # mixed models with groups mixed_mf(cs1 = cs1, cs2 = cs2, subj = subj, group = "group", data = example_data)
Basic function for conducting multiverse analyses of conditioning data
multiverse_cs( cs1, cs2, data, subj, group = NULL, cs_paired = NULL, include_bayes = TRUE, include_mixed = FALSE, phase = "acquisition", cutoff = c(0, 1, 2, 3), print_output = TRUE, correction = FALSE, meta.effect = "d_to_eta2" )
multiverse_cs( cs1, cs2, data, subj, group = NULL, cs_paired = NULL, include_bayes = TRUE, include_mixed = FALSE, phase = "acquisition", cutoff = c(0, 1, 2, 3), print_output = TRUE, correction = FALSE, meta.effect = "d_to_eta2" )
cs1 |
The column name(s) of the conditioned responses for the first conditioned stimulus |
cs2 |
The column name(s) of the conditioned responses for the second conditioned stimulus |
data |
A data frame containing all the relevant columns for the analyses |
subj |
The name of the column including the participant numbers. Unique numbers are expected |
group |
the name of the group, if included, default to |
cs_paired |
A character vector with the trials that were paired. Default is set to |
include_bayes |
Whether the Bayesian analyses should be run. Default to |
include_mixed |
Whether the mixed model results should be run. Default to |
phase |
The conditioned phase that the analyses refer to. Accepted values are |
cutoff |
A numeric vector of the cutoff criteria applied. Default to |
print_output |
Whether to print the output or not. Default set to |
correction |
whether the Greenhouse-Geisser correction should be applied or not. Default to |
meta.effect |
How the meta-analytic effect should be computed. |
In case of higher order interaction, only the highest order effect is returned.
In case the CSs include only 1 observation per participant, or of unequal numbers of CS trials, the function will return the warning ""Skipping ANOVA due to the number of trials for the cs1 and/or cs2."".
In principle the multiverse_cs function runs the universe_cs function multiple times, so whatever holds for the universe_cs – e.g., in terms of warnings, holds for here as well.
A tibble with the following column names:
x: the name of the independent variable (e.g., cs)
y: the name of the dependent variable as this defined in the dv
argument
exclusion: see exclusion
argument
model: the model that was run (e.g., t-test)
controls: ignore this column for this test
method: the method used
p.value: the reported p-value
effect.size: the reported effect size
estimate: the estimate of the test run
statistic: the value of the test
conf.low: the lower confidence interval for the estimate
conf.high: the higher confidence interval for the estimate
framework: were the data analysed within a NHST or Bayesian framework?
data_used: a list with the data used for the specific test
Basic function for running the frequentist's repeated measures analysis of variance (ANOVA)
rm_anova_mf( cs1, cs2, data, subj, time = TRUE, group = NULL, phase = "acquisition", dv = "scr", exclusion = "full data", cut_off = "full data", correction = FALSE )
rm_anova_mf( cs1, cs2, data, subj, time = TRUE, group = NULL, phase = "acquisition", dv = "scr", exclusion = "full data", cut_off = "full data", correction = FALSE )
cs1 |
The column name(s) of the conditioned responses for the first conditioned stimulus |
cs2 |
The column name(s) of the conditioned responses for the second conditioned stimulus |
data |
A data frame containing all the relevant columns for the analyses |
subj |
The name of the column including the participant numbers. Unique numbers are expected |
time |
should time be included? Default to |
group |
the name of the group, if included, default to |
phase |
The conditioned phase that the analyses refer to. Accepted values are |
dv |
name of the measured conditioned response. Default to |
exclusion |
Name of the data reduction procedure used. Default to |
cut_off |
cut off Name of the cut_off applied. Default to |
correction |
whether the Greenhouse-Geisser correction should be applied or not. Default to |
In case the time
argument is set to TRUE (default value), the function will include this as a within subjects factor, assuming that the columns in
cs1
and cs2
correspond to ascending time points (e.g., cs1
trial 1, cs1 trial 2 ... cs1 trial n
). If this is not the case, the
results are not to be trusted.
The function uses the ez::ezANOVA
function. The function gives by default a warning regarding the collapsing of factors. This function here suppresses this warning but the user should be aware of it. Please note that at the moment no sphericity correction is performed. The reported effect size is omega squared as this is computed by sjstats::omega_sq
. The meta-analytic effect size is eta squared.
A basic function for running repeated measures ANOVAs.
A tibble with the following column names:
x: the name of the independent variable (e.g., cs)
y: the name of the dependent variable as this defined in the dv
argument
exclusion: see exclusion
argument
model: the model that was run (e.g., t-test)
controls: ignore this column for this test
method: the model that was run
p.value: the p-value of the test
effect.size: the estimated effect size
effect.size.ma: the estimated effect size for the meta-analytic plots
effect.size.ma.lci: low confidence intervals for the meta-analytic effect size
effect.size.ma.hci: high confidence intervals for the meta-analytic effect size
estimate: the estimate of the test run
statistic: the F-value
conf.low: the lower confidence interval for the estimate
conf.high: the higher confidence interval for the estimate
framework: were the data analysed within a NHST or Bayesian framework?
data_used: a list with the data used for the specific test
# Load example data data(example_data) # Briefly define argument values that will be plugged in later on in the functions cs1 <- paste0("CSP", 1:10) cs2 <- paste0("CSM", 1:10) subj <- "id" group <- "group" # Repeated measures ANOVA without groups rm_anova_mf(cs1 = cs1, cs2 = cs2, subj = subj, data = example_data, time = TRUE) # Repeated measures ANOVA with groups rm_anova_mf(cs1 = cs1, cs2 = cs2, subj = subj, group = "group", data = example_data, time = TRUE)
# Load example data data(example_data) # Briefly define argument values that will be plugged in later on in the functions cs1 <- paste0("CSP", 1:10) cs2 <- paste0("CSM", 1:10) subj <- "id" group <- "group" # Repeated measures ANOVA without groups rm_anova_mf(cs1 = cs1, cs2 = cs2, subj = subj, data = example_data, time = TRUE) # Repeated measures ANOVA with groups rm_anova_mf(cs1 = cs1, cs2 = cs2, subj = subj, group = "group", data = example_data, time = TRUE)
Basic function for running the Bayesian repeated measures analysis of Variance
rm_banova_mf( cs1, cs2, data, subj, time = TRUE, group = NULL, phase = "acquisition", dv = "scr", exclusion = "full data", cut_off = "full data" )
rm_banova_mf( cs1, cs2, data, subj, time = TRUE, group = NULL, phase = "acquisition", dv = "scr", exclusion = "full data", cut_off = "full data" )
cs1 |
The column name(s) of the conditioned responses for the first conditioned stimulus |
cs2 |
The column name(s) of the conditioned responses for the second conditioned stimulus |
data |
A data frame containing all the relevant columns for the analyses |
subj |
The name of the column including the participant numbers. Unique numbers are expected |
time |
should time be included? Default to |
group |
the name of the group, if included, default to |
phase |
The conditioned phase that the analyses refer to. Accepted values are |
dv |
name of the measured conditioned response. Default to |
exclusion |
Name of the data reduction procedure used. Default to |
cut_off |
cut off Name of the cut_off applied. Default to |
In case the time
argument is set to true, the function will
include this as a within subjects factor, assuming that the columns in
cs1
and cs2
correspond to ascending time points (e.g., cs1
trial 1, cs1 trial 2 ... cs1 trial n
). If this is not the case, the
results are not to be trusted.
The ANOVA will run *all* possible models and combinations. Please note that in case of many factors, this will mean that the analysis will take a long time to be completed.
A tibble with the following column names:
x: the name of the independent variable (e.g., cs)
y: the name of the dependent variable as this defined in the dv
argument
exclusion: see exclusion
argument
model: the model that was run (e.g., rep ANOVA)
controls: ignore this column for this test
method: the model that was run
p.value: irrelevant here
effect.size: irrelevant here
effect.size.ma: irrelevant here
effect.size.lci: irrelevant here
effect.size.hci: irrelevant here
estimate: the estimate of the test run
statistic: the Bayes factor conf.low: the lower confidence interval for the estimate
conf.high: the higher confidence interval for the estimate
framework: were the data analysed within a NHST or Bayesian framework?
data_used: a list with the data used for the specific test
# Briefly define argument values that will be plugged in later on in the functions. # We only use two trials as the function takes a long time to run. data(example_data) cs1 <- paste0("CSP", 1:2) cs2 <- paste0("CSM", 1:2) subj <- "id" # Bayesian Repeated measures ANOVA without groups rm_banova_mf(cs1 = cs1, cs2 = cs2, subj = subj, data = example_data, time = TRUE)
# Briefly define argument values that will be plugged in later on in the functions. # We only use two trials as the function takes a long time to run. data(example_data) cs1 <- paste0("CSP", 1:2) cs2 <- paste0("CSM", 1:2) subj <- "id" # Bayesian Repeated measures ANOVA without groups rm_banova_mf(cs1 = cs1, cs2 = cs2, subj = subj, data = example_data, time = TRUE)
Basic function for running the frequentist's t-tests included in the main analyses
t_test_mf( cs1, cs2, data, subj, group = NULL, na.rm = FALSE, paired = TRUE, quanz = c(0.05, 0.95), meta.effect = "d_to_eta2", phase = "acquisition", dv = "scr", exclusion = "full data", cut_off = "full data" )
t_test_mf( cs1, cs2, data, subj, group = NULL, na.rm = FALSE, paired = TRUE, quanz = c(0.05, 0.95), meta.effect = "d_to_eta2", phase = "acquisition", dv = "scr", exclusion = "full data", cut_off = "full data" )
cs1 |
The column name(s) of the conditioned responses for the first conditioned stimulus |
cs2 |
The column name(s) of the conditioned responses for the second conditioned stimulus |
data |
A data frame containing all the relevant columns for the analyses |
subj |
The name of the column including the participant numbers. Unique numbers are expected |
group |
the name of the group, if included, default to |
na.rm |
Whether NAs should be removed, default to |
paired |
Whether the t-test refers to dependent (i.e., paired) or to independent sample(s). Default to |
quanz |
Quantiles for the meta-analytic effect sizes. Default to .05 (lower) and.95 (upper) |
meta.effect |
How the meta-analytic effect should be computed, Default to |
phase |
The conditioned phase that the analyses refer to. Accepted values are |
dv |
name of the measured conditioned response. Default to |
exclusion |
Name of the data reduction procedure used. Default to |
cut_off |
cut off Name of the cut_off applied. Default to |
Given the correct names for the cs1
, cs2
, subj
, and data
, the function will run one- and two-sided frequentist's t-tests. In case cs1
or cs2
refer to multiple columns, the mean – per row – for each one of these variables will be computed first before running the t-test. Please note that cs1 is implicitly referred to the cs that is reinforced, and cs2 to the cs that is not reinforced.
Depending on whether the data refer to an acquisition or extinction phase (as defined in the phase
argument), the function will return a positive one sided, or negative one-sided, respectively t-test in addition to the two-sided t-test. The returned effect size is Hedge's g in the column effect size. For the meta-analytic effect size (effect.size.ma), the returned effect size is eta-squared.
The function by default runs a Welch t-test, meaning it assumes unequal variances. This is due to calls that such a test should be preferred over Student's t-test, at least for paired samples t-test. Please note that if we let R decide which test to run – this is done by default in stats::t.test
, then for some test there would be a Student t-test whereas in some others not.
There are two different ways to compute the meta-analytic effect sizes but the results may differ. The option
"t_to_eta2" computes the eta squared via the t values whereas the "d_to_eta2" the eta squared is computed via
the Cohen's d value.
A tibble with the following column names:
x: the name of the independent variable (e.g., cs)
y: the name of the dependent variable as this defined in the dv
argument
exclusion: see exclusion
argument
model: the model that was run (e.g., t-test)
controls: ignore this column for this test
method: the model that was run
p.value: the p-value of the test
effect.size: the estimated effect size
effect.size.ma: the estimated effect size for the meta-analytic plots. Here we used eta squared
effect.size.ma.lci: low confidence intervals for the meta-analytic effect size
effect.size.ma.hci: high confidence intervals for the meta-analytic effect size
estimate: the estimate of the test run. For the t-test is the mean of the differences
statistic: the t-value
conf.low: the lower confidence interval for the estimate
conf.high: the higher confidence interval for the estimate
framework: were the data analysed within a NHST or Bayesian framework?
data_used: a list with the data used for the specific test
# Load example data data(example_data) # Paired sample t-tests t_test_mf(cs1 = "CSP1", cs2 = "CSM1", subj = "id", data = example_data) # Independent sample t-tests t_test_mf(cs1 = "CSP1", cs2 = "CSM1", subj = "id", group = "group", data = example_data)
# Load example data data(example_data) # Paired sample t-tests t_test_mf(cs1 = "CSP1", cs2 = "CSM1", subj = "id", data = example_data) # Independent sample t-tests t_test_mf(cs1 = "CSP1", cs2 = "CSM1", subj = "id", group = "group", data = example_data)
Basic function for running a multiverse analysis for a single data set
universe_cs( cs1, cs2, data, subj, group = NULL, include_bayes = TRUE, include_mixed = FALSE, phase = "acquisition", dv = "scr", print_output = TRUE, exclusion = "full data", cut_off = "full data", correction = FALSE, meta.effect = "d_to_eta2" )
universe_cs( cs1, cs2, data, subj, group = NULL, include_bayes = TRUE, include_mixed = FALSE, phase = "acquisition", dv = "scr", print_output = TRUE, exclusion = "full data", cut_off = "full data", correction = FALSE, meta.effect = "d_to_eta2" )
cs1 |
The column name(s) of the conditioned responses for the first conditioned stimulus |
cs2 |
The column name(s) of the conditioned responses for the second conditioned stimulus |
data |
A data frame containing all the relevant columns for the analyses |
subj |
The name of the column including the participant numbers. Unique numbers are expected |
group |
the name of the group, if included, default to |
include_bayes |
Whether the Bayesian analyses should be run. Default to |
include_mixed |
Whether the mixed model results should be run. Default to |
phase |
The conditioned phase that the analyses refer to. Accepted values are |
dv |
name of the measured conditioned response. Default to |
print_output |
Whether to print the output or not. Default set to |
exclusion |
Name of the data reduction procedure used. Default to |
cut_off |
cut off score |
correction |
whether the Greenhouse-Geisser correction should be applied or not. Default to |
meta.effect |
How the meta-analytic effect should be computed. |
In case of higher order interaction, only the highest order effect is shown.
In case the CSs include only 1 observation per participant, or of unequal numbers of CS trials, the function will return the warning ""Skipping ANOVA due to the number of trials for the cs1 and/or cs2."".
A tibble with the following column names:
x: the name of the independent variable (e.g., cs)
y: the name of the dependent variable as this defined in the dv
argument
exclusion: see exclusion
argument
model: the model that was run (e.g., t-test)
controls: ignore this column for this test
method: the method used
p.value: the reported p-value
effect.size: the reported effect size
estimate: the estimate of the test run
statistic: the value of the test
conf.low: the lower confidence interval for the estimate
conf.high: the higher confidence interval for the estimate
framework: were the data analysed within a NHST or Bayesian framework?
data_used: a list with the data used for the specific test
# Load data and define argument to be fed in universe_cs data("example_data", package = "multifear") example_data <- example_data[1:10, ] cs1 <- paste0("CSP", 1:10) cs2 <- paste0("CSM", 1:10) subj = "id" multifear::universe_cs(cs1, cs2, subj = subj, data = example_data, include_bayes = FALSE)
# Load data and define argument to be fed in universe_cs data("example_data", package = "multifear") example_data <- example_data[1:10, ] cs1 <- paste0("CSP", 1:10) cs2 <- paste0("CSM", 1:10) subj = "id" multifear::universe_cs(cs1, cs2, subj = subj, data = example_data, include_bayes = FALSE)