Skip to Content

interaction.ABC.plot {dae}

Plots an interaction plot for three factors
Package: 
dae
Version: 
2.1-7

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

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, ...)

Arguments

response
A numeric vector containing the response variable from which a function (the mean by default) is computed for plotting on the y-axis.
x.factor
The factor to be plotted on the x-axis of each plot.
groups.factor
The factor plotted as separate lines in each plot.
trace.factor
The factor for whose levels there are separate plots.
data
A data.frame containing the three factors and the response.
fun
The function to be computed from the response for each combination of the three factors x.factor, groups.factor and trace.factor. By default, the mean is computed for each combination.
title
Title for plot window. By default it is "A:B:C Interaction Plot".
xlab
Label for the x-axis. By default it is the name of the x.factor.
ylab
Label for the y-axis. By default it is the name of the response.
key.title
Label for the xkey to the lines in each plot. By default it is the name of the groups.factor.
lwd
The width of the lines. By default it is 4.
columns
The number of columns for arranging the several plots for the levels of the groups.factor. By default it is 2.
...
Other arguments that are passed down to the function xyplot.

Values

An object of class "trellis", which is automatically plotted by print.trellis.

Note

A data.frame called data.means is created, attached and detached during execution of this function.

See Also

fac.combine in package dae, interaction.plot.

Examples

## plot for generated data
## use ?ABC.Interact.dat for data set details
data(ABC.Interact.dat)
interaction.ABC.plot(MOE, A, B, C, data=ABC.Interact.dat)
 
## 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")

Author(s)

Chris Brien

Documentation reproduced from package dae, version 2.1-7. License: GPL (>= 2)