rm_anova_mf: rm_anova_mf

View source: R/rm_anova_mf.R

rm_anova_mfR Documentation

rm_anova_mf

Description

Basic function for running the frequentist's repeated measures analysis of variance (ANOVA)

Usage

rm_anova_mf(
  cs1,
  cs2,
  data,
  subj,
  time = TRUE,
  group = NULL,
  phase = "acquisition",
  dv = "scr",
  exclusion = "full data",
  cut_off = "full data",
  correction = FALSE
)

Arguments

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 TRUE

group

the name of the group, if included, default to NULL

phase

The conditioned phase that the analyses refer to. Accepted values are acquisition, acq, extinction, or ext

dv

name of the measured conditioned response. Default to "SCR"

exclusion

Name of the data reduction procedure used. Default to full data

cut_off

cut off Name of the cut_off applied. Default to full data

correction

whether the Greenhouse-Geisser correction should be applied or not. Default to FALSE

Details

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.

Value

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

Examples

# 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)

AngelosPsy/multifear documentation built on Oct. 1, 2023, 2:07 p.m.