Two-Way Interaction Plots

DESCRIPTION:
Produces a plot with the levels of one factor along the x-axis, the response on the y-axis and the points corresponding to a particular level of a second factor connected by lines. This type of plot is useful for exploring or discovering interactions.

USAGE:
interaction.plot(x.factor, trace.factor, response, fun=mean,
        trace.label=deparse(substitute(trace.factor)), fixed=F)

REQUIRED ARGUMENTS:
x.factor:
factor to be plotted on the x-axis.
trace.factor:
factor whose levels will be separate traces.
response:
vector containing the response.
Missing values (NA) are allowed.

OPTIONAL ARGUMENTS:
fun=:
a function or the name of a function. This should be a summary function returning one number on each call.
trace.label=:
labels for levels of factor plotted as traces.
fixed=:
logical flag: if TRUE, the legend is in the order of the levels of the trace factor. Otherwise, it is in the order of the traces at the right end of the plot.

Graphical parameters may also be supplied as arguments to this function (see par). Of particular use is lty which has a default value of nc:1 where nc is the number of levels of trace.factor. The parameter for color, col, may also be a vector of integers for this function. In addition, the high-level graphics arguments described under par and the arguments to title may be supplied to this function.


SIDE EFFECTS:
a plot will be created showing the requested function of responses for each level of the second factor at each level of the first factor. By default, lines for each value of the trace factor are drawn in different styles so that they may be more easily distinguished.

DETAILS:
Lines will not be drawn to or from any points that involve a missing value.

SEE ALSO:
plot.factor , plot.design .

EXAMPLES:
attach(catalyst)
interaction.plot(Conc, Cat, Yield)
detach()
attach(guayule)
interaction.plot(variety, treatment, plants)