plot_avg_cdiff: Plots average difference between two conditions.

Description Usage Arguments Examples

View source: R/plotting.R

Description

plot_avg_cdiff calculates the average of differences between two specified conditions along with standard error and then plots the results.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
plot_avg_cdiff(
  data,
  IAColumn = NULL,
  xlim = NA,
  type = NULL,
  Averaging = "Subject",
  Condition = NULL,
  CondLabels = NA,
  ErrorBar = TRUE,
  VWPreTheme = TRUE,
  ConfLev = 95,
  CItype = "simultaneous",
  ErrorBand = FALSE,
  ErrorType = "SE"
)

Arguments

data

A data table object output by either bin_prop. transform_to_elogit, or create_binomial.

IAColumn

A character vector specifying the desired column corresponding to the interest area.

xlim

A vector of two integers specifying the limits of the x-axis.

type

A character string indicating "proportion" or "elogit", which influences how standard error and confidence intervals are calculated.

Averaging

A character string indicating how the averaging should be done. "Subject" (default) will produce the grand mean in the data, while "Item" (or, in principle, any other column name) will calculate the grand mean by that factor.

Condition

A list containing the column name corresponding to the condition and factor levels to be used for calculating the difference.

CondLabels

A named character vector specifying the desired labels of the levels of the condition.

ErrorBar

A logical indicating whether error bars should be included in the plot.

VWPreTheme

A logical indicating whether the theme included with the function should be applied, or ggplot2's base theme (to which any other custom theme could be added).

ConfLev

A number indicating the confidence level of the CI.

CItype

A string indicating "simultaneous" or "pointwise". Simultaneous performs a Bonferroni correction for the interval.

ErrorBand

A logical indicating whether error bands should be included in the plot.

ErrorType

A string indicating "SE" or "CI".

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
library(VWPre)
# For plotting average difference between conditions...
plot_avg_cdiff(data = dat, xlim = c(0, 1000), type = "proportion",
             IAColumn = "IA_1_P", Condition = list(talker = c("EN3", "CH1")),
             CondLabels = NA, ErrorBar = TRUE, VWPreTheme = TRUE, 
             ErrorBand = FALSE, ErrorType = "SE")

# For a more complete tutorial on VWPre plotting functions:
vignette("SR_Plotting", package="VWPre")

## End(Not run)

VWPre documentation built on Nov. 30, 2020, 1:08 a.m.