plot.SK: Plot SK objects

View source: R/plot.SK.R

plot.SKR Documentation

Plot SK objects

Description

S3 method to plot SK objects.

Usage

## S3 method for class 'SK'
plot(x,
     result         = TRUE,
     replicates     = TRUE,
     pch            = 19,
     col            = NULL,
     xlab           = NULL,
     ylab           = NULL,
     xlim           = NULL,
     ylim           = NULL,
     axisx          = TRUE,
     axisy          = TRUE,
     id.lab         = NULL,
     id.las         = 1,
     yl             = TRUE,
     yl.lty         = 3,
     yl.col         = 'gray',
     dispersion     = c('mm','sd','ci','cip'),
     d.lty          = 1,
     d.col          = 'black',
     title          = '', ...)

Arguments

x

A SK object.

result

The result of the test (letters) should be visible.

replicates

The number of replicates should be visible.

pch

A vector of plotting symbols or characters.

col

A vector of colors for the means representation.

xlab

A label for the ‘⁠x⁠’ axis.

ylab

A label for the ‘⁠y⁠’ axis.

xlim

The ‘⁠x⁠’ limits of the plot.

ylim

The ‘⁠y⁠’ limits of the plot.

axisx

If TRUE, the x axis is drawn using defaults; set to FALSE to suppress it.

axisy

If TRUE, the y axis is drawn using defaults; set to FALSE to suppress it.

id.lab

Factor level names at ‘⁠x⁠’ axis.

id.las

Factor level names written either horizontally or vertically.

yl

Horizontal (reference) line connecting the circle to the ‘⁠y⁠’ axis.

yl.lty

Line type of ‘⁠yl⁠’.

yl.col

Line color of ‘⁠yl⁠’.

dispersion

Type of dispersion bar drawn through each mean point. Options: ‘⁠mm⁠’ (min-max range), ‘⁠sd⁠’ (standard deviation), ‘⁠ci⁠’ (individual confidence interval), ‘⁠cip⁠’ (pooled confidence interval). Default is ‘⁠mm⁠’.

d.lty

Line type of dispersion.

d.col

A vector of colors for the line type of dispersion.

title

A title for the plot.

...

Optional plotting parameters.

Details

The plot.SK function is an S3 method for plotting SK objects. It generates a series of points representing the treatment means, optionally with vertical dispersion bars. The ‘⁠ci⁠’ option is calculated using each treatment's own variance as an estimate of the population variance. The ‘⁠cip⁠’ option is calculated using the mean square error (MSE) as an estimate of the population variance.

Author(s)

Faria, J. C. (joseclaudio.faria@gmail.com)
Jelihovschi, E. G. (eniojelihovs@gmail.com)
Allaman, I. B. (ivanalaman@gmail.com)

References

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

See Also

plot

Examples

##
## Examples: Completely Randomized Design (CRD)
## More details: demo(package='ScottKnott')
##

library(ScottKnott)
data(CRD2)

## From: formula
sk1 <- with(CRD2,
            SK(y ~ x,
               data=dfm,
               which='x'))

old.par <- par(mar=c(6, 3, 6, 2))
plot(sk1,
     id.las=2)

plot(sk1,
     yl=FALSE,
     dispersion='sd',
     id.las=2)

## From: aov
av <- with(CRD2,
           aov(y ~ x,
               data=dfm))
summary(av)

sk2 <- SK(x=av,
          which='x')

col=c(rep(2, 6),
      rep(3, 36),
      rep(4, 1),
      rep(5, 2))

plot(sk2,
     dispersion='sd',
     yl=FALSE,
     id.las=2,
     col=col,
     d.col=col)

## From: lm
av_lm <- with(CRD2,
           lm(y ~ x,
              data=dfm))

sk3 <- SK(x=av_lm,
          which='x')

par(mfrow=c(2, 1))
plot(sk2,
     dispersion='ci',
     yl=FALSE,
     id.las=2,
     col=col,
     d.col=col)

plot(sk2,
     dispersion='cip',
     yl=FALSE,
     id.las=2,
     col=col,
     d.col=col)

par(mfrow=c(1, 1))
par(old.par)

ScottKnott documentation built on May 24, 2026, 5:06 p.m.