library(agricolae)
data(sweetpotato)
attach(sweetpotato)
model<-aov(yield~virus)
df<-df.residual(model)
MSerror<-deviance(model)/df
comparison <- HSD.group(yield,virus,df,MSerror, main="Yield of sweetpotato. Dealt with different virus")
#stargraph
bar.err(comparison,std=TRUE, horiz=TRUE, xlim=c(0,45),density=4)
#endgraph
Run the code above in your browser using DataLab