Learn R Programming

qualityTools (version 1.49)

mvPlot: Multi-Vari Charts

Description

Draws a Multi-Vari Chart for 2, 3 or 4 factors.

Usage

mvPlot(y, factor1, factor2, factor3, factor4, fun = mean, points = TRUE, connect = TRUE, col = c(1, 2, 3, 4), pch = c(1, 2, 3, 4), 
       xlim, ylim, main, main.sub, horiz = FALSE, lwd.b = 1, lwd.w = 1, pch.b = 15, pch.w = 17, col.w = 2, col.b = 1, ...)

Arguments

y
the values of the response in a vector.
factor1
vector providing factor 1 as shown in the example.
factor2
vector providing factor 2 as shown in the example.
factor3
vector providing factor 3 as shown in the example.
factor4
vector providing factor 4 as shown in the example.
fun
function to be used for calculation of y for unique settings of the factors e.g. the mean (default setting).
points
logical value deciding whether the points will be shown or not. By default points is set to TRUE.
connect
logical value specifying whether the means of each factor will be connected or not. By default connect is set to TRUE.
col
graphical parameter. Vector containing numerical values or character strings giving the colors for the different factors. By default col is set to c(1,2,3,4).
pch
graphical parameter. Vector containing numerical values or single characters giving plotting points for the different factors. See points for possible values and their interpretation. Note that only integers
xlim
graphical parameter. The x limits (x1, x2) of the plot. Note that x1 > x2 is allowed and leads to a reversed axis.
ylim
graphical parameter. The y limits of the plot.
main
graphical parameter. A main title for the plot, see also title.
main.sub
graphical parameter. A sub title for the plot (character string).
horiz
logical value specifying where the legend will be plotted. If set to TRUE the legend will appear above the main plot, if FALSE (default) the legend will be placed next to the main plot at the right side.
lwd.b
numerical value giving the width of the line between the mean values of all groups.
lwd.w
numerical value giving the width of the line within the mean of the values of one group.
pch.b
numerical value or single character giving the type of point for the mean values of all groups.
pch.w
numerical value or single character giving the type of point for the mean values of the single groups.
col.w
numerical value or character string giving the color of points for the mean values of the single groups.
col.b
numerical value or character string giving the color of points for the mean values of all groups.
...
further graphical parameters see par.

See Also

http://www.user.tu-berlin.de/kalicete/qualityTools

Examples

Run this code
#generate some data
factor1 = c(rep(1, 9), rep(2, 9), rep(3,9))
factor2 = c(rep(1,9), rep(2,9), rep(3,9))
temp = expand.grid(c(1,2,3), c(1,2,3))
temp = as.data.frame(rbind(temp, temp, temp))
temp = cbind(temp, rnorm(27, 20, 2))
names(temp) = c("factor1", "factor2", "response")

#have a look at the design matrix
temp

mvPlot(y = temp[,3], factor1 = temp[,1], factor2 = temp[,2], col.b = "red3", horiz = FALSE)

Run the code above in your browser using DataLab