Learn R Programming

VWPre (version 1.2.5)

plot_avg: Plots average looks to interest areas.

Description

plot_avg calculates the grand or conditional averages of looks to each interest area along with standard error. It then plots the results. N.B.: This function will work for data with a maximum of 8 interest areas and 2 conditions.

Usage

plot_avg(
  data,
  type = NULL,
  xlim = NA,
  IAColumns = NULL,
  Averaging = "Event",
  Condition1 = NULL,
  Condition2 = NULL,
  Cond1Labels = NA,
  Cond2Labels = 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.

type

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

xlim

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

IAColumns

A named character vector specifying the desired interest area columns with custom strings for the legend.

Averaging

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

Condition1

A string containing the column name corresponding to the first condition, if available.

Condition2

A string containing the column name corresponding to the second condition, if available.

Cond1Labels

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

Cond2Labels

A named character vector specifying the desired custom labels of the levels of the second 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". For SE, the calculation varies for empirical logits and proportions. Further, for CI, the calculation on proportions uses the Wald method.