interactionPlot {r6qualitytools} | R Documentation |
interactionPlot
Description
Creates an interaction plot for the factors in a factorial design to visualize the interaction effects between them.
Usage
interactionPlot(dfac, response = NULL, fun = mean, main, col = 1:2)
Arguments
dfac |
An object of class |
response |
Response variable. If the response data frame of fdo consists of more then one responses, this variable can be used to choose just one column of the response data frame.
|
fun |
Function to use for the calculation of the interactions (e.g., |
main |
Character string: title of the plot. |
col |
Vector of colors for the plot. Single colors can be given as character strings or numeric values. Default is |
Details
interactionPlot()
displays interactions for an object of class facDesign
(i.e. 2^k full or 2^k-p fractional factorial design).
Parts of the original interactionPlot were integrated.
Value
Return an interaction plot for the factors in a factorial design.
See Also
Examples
# Example 1
# Create the facDesign object
dfac <- facDesign(k = 3, centerCube = 4)
dfac$names(c('Factor 1', 'Factor 2', 'Factor 3'))
# Assign performance to the factorial design
rend <- c(simProc(120,140,1), simProc(80,140,1), simProc(120,140,2),
simProc(120,120,1), simProc(90,130,1.5), simProc(90,130,1.5),
simProc(80,120,2), simProc(90,130,1.5), simProc(90,130,1.5),
simProc(120,120,2), simProc(80,140,2), simProc(80,120,1))
dfac$.response(rend)
# Create an interaction plot
interactionPlot(dfac, fun = mean, col = c("purple", "red"))
# Example 2
vp <- fracDesign(k=3, replicates = 2)
y <- 4*vp$get(j=1) -7*vp$get(j=2) + 2*vp$get(j=2)*vp$get(j=1) +
0.2*vp$get(j=3) + rnorm(16)
vp$.response(y)
interactionPlot(vp)