library(agricolae)
data(sweetpotato)
model<-aov(yield~virus, data=sweetpotato)
comparison <- LSD.test(model,"virus", p.adj="bonferroni",
main="Yield of sweetpotato
dealt with different virus")
#stargraph
bar.group(comparison,ylim=c(0,45),density=4,border="blue")
#endgraph
# Old version LSD.test()
attach(sweetpotato)
df<-df.residual(model)
MSerror<-deviance(model)/df
comparison <- LSD.test(yield,virus,df,MSerror, p.adj="bonferroni", group=FALSE,
main="Yield of sweetpotato
dealt with different virus")
detach(sweetpotato)
#stargraph
bar.err(comparison,std=TRUE,ylim=c(0,45),density=4,border="red")
#endgraph
LSD.test(model,"virus",p.adj="bon")
Run the code above in your browser using DataLab