Plots an interaction plot for three factors
Description
Plots a function
(the mean by default) of the response
for
the combinations of the three factors
specified as the x.factor
(plotted on the x axis of each plot), the groups.factor
(plotted
as separate lines in each plot) and the trace.factor
(its levels
are plotted in different plots). Interaction plots for more than three
factors
can be produced by using fac.combine
to combine all but
two of them into a single factor
that is specified as the
trace.factor
.
Usage
1 2 3  interaction.ABC.plot(response, x.factor, groups.factor,
trace.factor,data, fun="mean", title="A:B:C Interaction Plot",
xlab, ylab, key.title, lwd=4, columns=2, ggplotFuncs = NULL, ...)

Arguments
response 
A numeric 
x.factor 
The 
groups.factor 
The 
trace.factor 
The 
data 
A 
fun 
The 
title 
Title for plot window. By default it is "A:B:C Interaction Plot". 
xlab 

ylab 

key.title 

lwd 
The width of the 
columns 
The number of columns for arranging the several plots for the
levels of the 
ggplotFuncs 
A 
... 
Other arguments that are passed down to 
Value
An object of class "ggplot
", which can be plotted using print
.
Author(s)
Chris Brien
See Also
fac.combine
in package dae, interaction.plot
.
Examples
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24  ## Not run:
## plot for Example 14.1 from Mead, R. (1990). The Design of Experiments:
## Statistical Principles for Practical Application. Cambridge,
## Cambridge University Press.
## use ?SPLGrass.dat for details
data(SPLGrass.dat)
interaction.ABC.plot(Main.Grass, x.factor=Period,
groups.factor=Spring, trace.factor=Summer,
data=SPLGrass.dat,
title="Effect of Period, Spring and Summer on Main Grass")
## plot for generated data
## use ?ABC.Interact.dat for data set details
data(ABC.Interact.dat)
## Add standard errors for plotting
##  here data contains a single value for each combintion of A, B and C
##  need to supply name for data twice
ABC.Interact.dat$se < rep(c(0.5,1), each=4)
interaction.ABC.plot(MOE, A, B, C, data=ABC.Interact.dat,
ggplotFunc=list(geom_errorbar(data=ABC.Interact.dat,
aes(ymax=MOE+se, ymin=MOEse),
width=0.2)))
## End(Not run)
