plot.SK {ScottKnott}R Documentation

Plot SK and SK.nest Objects

Description

Those are S3 methods for objects of class SK and SK.nest.

Usage

  ## S3 method for class 'SK':
  plot(x, inches=TRUE, col=NULL, xlab=NULL, ylab=NULL,
    title="Groups of means divided by colors", ...)
  ## S3 method for class 'SK.nest':
  plot(x, inches=TRUE, col=NULL, xlab=NULL, ylab=NULL,
    title="Groups of means divided by colors", ...)

Arguments

x A SK or SK.nest object.
inches 'TRUE', 'FALSE' or a positive number.See symbols-package:graghics
col A vector of colors for the thermometers representation. See symbols-package:graghics.
xlab A label for the x axis.
ylab A label for the y axis.
title A title for the graphics.
... Other graphical parameters may also be passed as arguments to this function.

Details

The plot.SK and plot.SK.nest functions generates a series of thermometers where the means are marked by a line in the midle, and the groups are diferentiated by diferent colors.

Author(s)

Enio Jelihovschi (eniojelihovs@gmail.com)
Jose Claudio Faria (joseclaudio.faria@gmail.com)
Sergio Oliveira (solive@uesc.br)

References

Murrell, P. (2005) R Graphics. Chapman & Hall/CRC Press.

See Also

plot

Examples

  ##
  ## Example: Factorial Experiment (FE)
  ##

  yeld <- c(53, 27, 40, 45, 43, 45, 32, 12,
            45, 57, 29, 69, 42, 32, 61, 54,
            95, 27, 24, 60, 60, 98, 11, 26)
  labs     <- factor(rep(1:2, 12))
  runs     <- factor(sort(rep(1:12, 2)))
  pressure <- gl(2, 12)
  catalyst <- factor(rep(sort(rep(1:2, 2)), 6))
  dm       <- data.frame(pressure, catalyst, labs) # Design matrix (a data.frame object)
  dfm      <- data.frame(labs, pressure, catalyst, yeld)

  ## PARAMETERS ARE THE DESIGN MATRIX AND THE RESPONSE VARIABLE
  ## MAIN FACTOR ANALYSIS
  ## Main factor = catalyst
  sk1 <- SK(x=dm, y=yeld, model='yeld ~ labs * catalyst * pressure',
            which='catalyst')
  summary(sk1)
  plot(sk1, title='catalyst')

  ## Main factor = pressure
  sk2 <- SK(x=dm, y=yeld, model='yeld ~ labs * catalyst * pressure',
            which='pressure')
  summary(sk2)
  plot(sk2, title='pressure')

  ## NESTED ANALYSIS
  ## Nested catalyst/pressure=1 -> SK.nest
  nsk1 <- SK.nest(x=dm, y=yeld, model='yeld ~ labs * catalyst * pressure',
                  which='catalyst:pressure', fl2=1)
  summary(nsk1)
  plot(nsk1, title='catalyst/pressure=1')

  ## Nested catalyst/pressure=2 -> SK.nest
  nsk2 <- SK.nest(x=dm, y=yeld, model='yeld ~ labs * catalyst * pressure',
                  which='catalyst:pressure', fl2=2)
  summary(nsk2)
  plot(nsk2, title = 'catalyst/pressure=2')

  ## Nested catalyst/pressure=2/labs=1 -> SK.nest
  nsk3 <- SK.nest(x=dm, y=yeld, model='yeld ~ labs * catalyst * pressure',
                  which='labs:catalyst:pressure', fl2=2, fl3=1)
  summary(nsk3)
  plot(nsk3, title='catalyst/pressure=2/labs=1')

[Package ScottKnott version 1.0.0 Index]