Learn R Programming

ez (version 2.0-0)

ezPlotBoot: Function to plot bootstrapped predictions and confidence intervals.

Description

This function provides easy visualization of any given user-requested effect from the bootstrap predictions computed by ezBoot.

Usage

ezPlotBoot(
    from_ezBoot
    , x
    , split = NULL
    , row = NULL
    , col = NULL
    , do_lines = TRUE
    , bar_width = NULL
    , to_numeric = NULL
    , x_lab = NULL
    , y_lab = NULL
    , split_lab = NULL
    , levels = NULL
    , diff = NULL
    , reverse_diff = FALSE
    , row_y_free = FALSE
)

Arguments

from_ezBoot
An list object resulting from a call to ezBoot.
x
.() object specifying the variable to plot on the x-axis.
split
Optional .() object specifying a variable by which to split the data into different shapes/colors (and line types, if do_lines==TRUE).
row
Optional .() object specifying a variable by which to split the data into rows.
col
Optional .() object specifying a variable by which to split the data into columns.
do_lines
Logical. If TRUE, lines will be plotted connecting groups of points.
bar_width
Optional numeric value specifying custom widths for the error bar hat.
to_numeric
Optional .() object specifying any variables that need to be converted to the numeric class before plotting.
x_lab
Optional character string specifying the x-axis label.
y_lab
Optional character string specifying the y-axis label.
split_lab
Optional character string specifying the key label.
levels
Optional named list where each item name matches a factored column in data that needs either reordering of levels, renaming of levels, or both. Each item should be a list containing named elements new_order or new_names
diff
Optional .() object specifying a 2-level varbiable to collapse to a difference score.
reverse_diff
Optional boolean to trigger reversal of the difference collapse requested by diff.
row_y_free
Logical. If TRUE, then rows will permit different y-axis scales.

Value

  • A list with 4 components:
  • plotA printable/modifiable ggplot2 object.
  • cellsA data frame containing predictions for each cell in the requested design.
  • bootsA data frame containing each iteration of bootstrap predictions, collased to the requested design.
  • boot_statsA data frame containing the "lo" and "hi" bounds of the 95 percent bootstrap confidence interval of each cell in the requested design.

See Also

ANT, ANT2, ezANOVA, ezBoot, ezCor, ezDesign, ezPerm, ezPlot, ezPlotBoot, ezPrecis, ezStats

Examples

Run this code
#Read in the ANT data (see ?ANT).
data(ANT)
head(ANT)
ezPrecis(ANT)

#Run ezBoot on the accurate RT data
rt = ezBoot(
    data = ANT
    , dv = .(rt)
    , wid = .(subnum)
    , within = .(cue,flank)
    , between = .(group)
    , iterations = 1e1 #1e3 or higher is best for publication
)

#plot the full design
from_ezPlotBoot = ezPlotBoot(
	from_ezBoot = rt
	, x = .(flank)
	, split = .(cue)
	, col = .(group)
)
print(from_ezPlotBoot$plot)

#plot the effect of group across the flank*cue design
from_ezPlotBoot = ezPlotBoot(
	from_ezBoot = rt
	, x = .(flank)
	, split = .(cue)
	, diff = .(group)
)
print(from_ezPlotBoot$plot)

#plot the flank*cue design, averaging across group
from_ezPlotBoot = ezPlotBoot(
	from_ezBoot = rt
	, x = .(flank)
	, split = .(cue)
)
print(from_ezPlotBoot$plot)

Run the code above in your browser using DataLab