Learn R Programming

qualityTools (version 1.55)

wirePlot3: function to create a ternary plot (3D wire plot) for an object of class mixDesign

Description

This function creates a ternary plot for mixture designs (i.e. object of class mixDesign).

Usage

wirePlot3(x, y, z, response, data = NULL, main, xlab, ylab, zlab, form = "linear", phi, theta, col = 1, steps, factors)

Arguments

x
factor 1 of the mixDesign object.
y
factor 2 of the mixDesign object.
z
factor 3 of the mixDesign object.
response
the response of the mixDesign object.
data
the mixDesign object from which x,y,z and the response are taken.
main
giving an overall title for the plot: see title.
xlab
giving a title for the x axis : see title.
ylab
giving a title for the y axis : see title.
zlab
giving a title for the z axis : see title.
form
a character string or a formula with the syntax “y ~ A + B +C”. If form is a character string it has to be one out of the following:
  • “linear”
  • “quadratic”
  • “fullCubic”
  • “specialCubic”
How the form influences the output is described in the reference listed below. By default form is set as “linear”.
phi
numerical value specifying the angle (in degree) through which the plot is rotated about an imagined horizontal line. By default phi is set as ‘30’.
theta
numerical value specifying the angle (in degree) through which the plot is rotated about an imagined vertical line. By default phi is set as ‘30’.
col
a predefined (1, 2, 3 or 4) or self defined colorRampPalette.
steps
resolution of the plot (number of rows for the square matrix), also number of grid points per factor. By default steps = 25.
factors
list of factors for categorizing with setting in case there are more than 3 factors (not yet implemented).

Value

wirPlot3 returns an invisible matrix containing the response values as NA's and numerics.

References

  • CORNELL: Experiments with Mixtures - 3rd Ed. New Jersey: Wiley, 2011.
  • MYERS, Raymond H.; MONTGOMERY, Douglas C.; ANDERSON-COOK, Christine M.: Response Surface Methodology. New York: WILEY ,2009.

See Also

contourPlot3 http://www.r-qualitytools.org/html/Improve.html

Examples

Run this code
#yarn elongation example p.564 Response Surface Methodology
mdo = mixDesign(3,2, center = FALSE, axial = FALSE, randomize = FALSE, 
                replicates  = c(1,1,2,3))
names(mdo) = c("polyethylene", "polystyrene", "polypropylene")
units(mdo) = "percent"
elongation = c(11.0, 12.4, 15.0, 14.8, 16.1, 17.7, 16.4, 16.6, 8.8, 10.0, 10.0,
               9.7, 11.8, 16.8, 16.0)
response(mdo) = elongation

dev.new(14,14); par(mfrow = c(2,2))
wirePlot3(A, B, C, elongation, data = mdo, form = "linear")
wirePlot3(A, B, C, elongation, data = mdo, form = "quadratic", col = 2)
wirePlot3(A, B, C, elongation, data = mdo, 
          form = "elongation ~ I(A^2) - B:A + I(C^2)", col = 3)
wirePlot3(A, B, C, elongation, data = mdo, form = "quadratic", 
          col = colorRampPalette(c("yellow", "white", "red")))

Run the code above in your browser using DataLab