Least-significant difference (LSD) in R

How to apply LSD (as a kind of multiple comparisons after ANOVA) in R?

A dataset for typical one-way ANOVA is given:

y <- rnorm(40)
x <- gl(4,10)
m <- aov(y~x)

Applying LSD by using function pairwise.t.test:

pairwise.t.test(y,x,p.adj="none")

Applying LSD by using function LSD.test from package agricolae:

library(agricolae)
LSD.test(m,"x",group=T) # with grouping
LSD.test(m,"x",group=F) # without grouping

No comments:

Post a Comment