Learn R Programming

agricolae (version 1.1-8)

bar.err: Plotting the standard error or standard deviance of a multiple comparison of means

Description

It plots bars of the averages of treatments and standard error or standard deviance. It uses the objects generated by a procedure of comparison like LSD, HSD, Kruskal and Waller-Duncan.

Usage

bar.err(x,variation=c("SE","SD","range"),horiz=FALSE, bar=TRUE,...)

Arguments

x
object means of the comparisons the LSD.test, HSD.test,...,etc
variation
SE=standard error or range=Max-Min
horiz
Horizontal or vertical bars
bar
paint bar
...
Parameters of the function barplot()

Value

  • xobject
  • variationcharacter std, SE or range
  • horizTRUE or FALSE
  • barTRUE or FALSE
  • ...Parameters of the function barplot()

Details

x: data frame formed by 5 columns: name of the bars, height, level out: LSD.test, HSD, waller.test, scheffe.test, duncan.test, SNK.test, friedman, kruskal, waerden.test. x: out$means

See Also

LSD.test, HSD.test, waller.test, kruskal, bar.group

Examples

Run this code
library(agricolae)
data(sweetpotato)
model<-aov(yield~virus,data=sweetpotato)
out <- waller.test(model,"virus", console=TRUE,
main="Yield of sweetpotato
dealt with different virus")
par(mfrow=c(2,2),cex=1)
bar.err(out$means,variation="range",horiz=TRUE,xlim=c(0,45),angle=125,density=6,
 main="range")
bar.err(out$means,variation="SD",ylim=c(0,45),col=colors()[30],
 main="Standard deviation",density=8)
bar.err(out$means,variation="SE",horiz=TRUE,xlim=c(0,45),density=8,
 col="brown",main="Standard error")
bar.err(out$means,variation="range",ylim=c(0,45),bar=FALSE,col="green",
 main="range")
par(mfrow=c(1,2),cex=1)
bar.err(out$means,variation="range",ylim=c(0,45),bar=FALSE,col=0)
abline(h=0)
# horiz = TRUE
bar.err(out$means,variation="SE",horiz=TRUE,xlim=c(0,45),bar=FALSE,col=0)
#startgraph
par(mfrow=c(1,1))
#endgraph

Run the code above in your browser using DataLab