Plot a Function of Each Level of Factors or Terms

DESCRIPTION:
Produces a plot showing the value of the function for each level of each factor.

USAGE:
plot.design(x, y, fun = mean, ...)

REQUIRED ARGUMENTS:
x:
either a data frame containing the design factors and, optionally, the response, or a formula.

OPTIONAL ARGUMENTS:
y:
the response, if not given in x. See the DETAILS section below.
fun:
a function or the name of a function. It should be a summary function returning one number on each call. The plot shows this function of the response for each level of each factor.

Graphical parameters may also be supplied as arguments to this function (see par).


SIDE EFFECTS:
a plot is produced on the current graphics device.

DETAILS:
This function is a method for the generic function plot for class "design". It can be invoked by calling plot for an object of the appropriate class, or directly by calling plot.design regardless of the class of the object.

There are two basic styles for calling this method. If x is a design or data frame, then y can select a response variable from the design or, if y is a formula, it can define both terms and response, relative to the given design. Conversely, if x is not a design, it is assumed to be a formula or terms object, or something else from which a model frame can be computed. Then the design factors and response are determined from that model frame.

The function supplied in the fun argument will be called once for each level of each factor in the design. A plot will show these summary values. The levels for a particular factor are shown along a vertical line, and the overall value of fun() for the response is drawn as a horizontal line.


REFERENCES:
Freeny,A. E. and Landwehr, J. M. (1990). Displays for data from large designed experiments, Computer Science and Statistics: Proceedings of the 22nd Symposium on the Interface. pp 117-126, Springer Verlag.

SEE ALSO:
plot , plot.factor , design .

EXAMPLES:
# draw trimmed means
plot.design(catalyst, fun = function(x) mean(x, trim = .05),
   col = 2)
#choose which factors to include in the plot
plot.design(Yield ~ Conc + Cat, data = catalyst)