MEAdistplot: Distribution of cross-correlations

View source: R/rMEA_graphics.R

MEAdistplotR Documentation

Distribution of cross-correlations

Description

Plots the distribution of the average cross-correlations in a list of MEA objects.

Usage

MEAdistplot(
  mea,
  contrast = FALSE,
  by = c("none", "group", "id", "session"),
  by.group = FALSE,
  sub.line = 0.5,
  ...
)

Arguments

mea

a well formatted list of MEA objects (see function MEAlist).

contrast

either FALSE or a list of MEA objects to be used as a contrast

by

Either "none", "group", "id", or "session". Defines the grouping to be used.

by.group

deprecated argument. Use by="group" instead.

sub.line

on which margin line should the Effect Size subtitle be printed, starting at 0 counting outwards.

...

further graphical parameters passed to plot

Details

If contrast is defined, then a normalized difference (Cohen's d) between the means of each group and the contrast is provided. Otherwise, if the mea object has 3 or less groups, Cohen's d will be calculated on the group differences.

Examples


## This example is excluded from test as it may take more than 10s to run
## read the first 4 minutes of the normal sample
##   (intake interviews of patients that carried on therapy)
path_normal <- system.file("extdata/normal", package = "rMEA")
mea_normal <- readMEA(path_normal, sampRate = 25, s1Col = 1, s2Col = 2,
                     s1Name = "Patient", s2Name = "Therapist",
                     idOrder = c("id","session"), idSep="_", skip=1, nrow = 6000)
mea_normal <- setGroup(mea_normal, "normal")

## read the dropout sample (intake interviews of patients that dropped out)
path_dropout <- system.file("extdata/dropout", package = "rMEA")
mea_dropout <- readMEA(path_dropout, sampRate = 25, s1Col = 1, s2Col = 2,
                     s1Name = "Patient", s2Name = "Therapist",
                     idOrder = c("id","session"), idSep="_", skip=1, nrow = 6000)
mea_dropout <- setGroup(mea_dropout, "dropout")

## Combine into a single object
mea_all = c(mea_normal, mea_dropout)

## Create a shuffled sample
mea_rand = shuffle(mea_all, 20)

## Compute ccf
mea_all = MEAccf(mea_all, lagSec = 5, winSec = 60, incSec = 30, r2Z = TRUE, ABS = TRUE)
mea_rand = MEAccf(mea_rand, lagSec = 5, winSec = 60, incSec = 30, r2Z = TRUE, ABS = TRUE)

## Visualize the effects:

MEAdistplot(mea_all, contrast = mea_rand, by.group = TRUE)


rMEA documentation built on March 18, 2022, 5:41 p.m.