Learn R Programming

agricolae (version 1.0-4)

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, std = TRUE, horiz = FALSE, ...)

Arguments

x
object or comparisons the LSD.test, HSD.test,...,etc
std
Standard deviation or standar error
horiz
Horizontal or vertical bars
...
Parameters of the function barplot()

Value

  • xobject
  • stdTRUE or FALSE
  • horizTRUE or FALSE
  • ...Parameters of the function barplot()

Details

x: data frame formed by 5 columns: name of the bars, height, level replications and standard error of the bar. std = T : standard deviation. std = F : standard error.

See Also

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

Examples

Run this code
library(agricolae)
data(sweetpotato)
attach(sweetpotato)
model<-aov(yield~virus)
df<-df.residual(model)
MSerror<-deviance(model)/df
Fc<-anova(model)[1,4]
comparison <- waller.test(yield,virus,df, MSerror, Fc,
main="Yield of sweetpotato
dealt with different virus")
# std = F (default) is standard error 
#startgraph
par(mfrow=c(2,2))
par(cex=1)
bar.err(comparison,horiz=TRUE,xlim=c(0,45),angle=125,density=6,
 main="Standard deviation")
bar.err(comparison,std=FALSE,horiz=TRUE,xlim=c(0,45),density=8,
 col="brown",main="Standard error")
bar.err(comparison,ylim=c(0,45),density=4,angle=125,col="green",
 main="Standard deviation")
bar.err(comparison,std=FALSE,ylim=c(0,45),density=10,col="blue",
 main="Standard error")
#endgraph

Run the code above in your browser using DataLab