library(agricolae)
data(sweetpotato)
model<-aov(yield~virus, data=sweetpotato)
out <- LSD.test(model,"virus", p.adj="bonferroni",
main="Yield of sweetpotato
dealt with different virus")
#stargraph
bar.group(out$groups,ylim=c(0,45),density=4,border="blue")
#endgraph
# Old version LSD.test()
attach(sweetpotato)
df<-df.residual(model)
MSerror<-deviance(model)/df
out <- LSD.test(yield,virus,df,MSerror, p.adj="bonferroni", group=FALSE,
main="Yield of sweetpotato
dealt with different virus")
detach(sweetpotato)
#stargraph
# Variation rank: Max. - Min.
bar.err(out$means,variation="rank",ylim=c(0,44),bar=FALSE,col=0)
#endgraph
LSD.test(model,"virus",p.adj="bon")Run the code above in your browser using DataLab