LSD檢驗
是t檢驗的簡單變形,對多組間的均數(shù)做檢驗。
用法:加載agricolae包,使用LSD.test。語法為:LSD.test(y, trt, DFerror, MSerror, alpha = 0.05, p.adj=c("none","holm","hommel", "hochberg", "bonferroni", "BH", "BY", "fdr"), …)
實例:
library(agricolae)
model <- aov(jinzhongpin ~ group, data.yazhou) # 先進行方差分析
summary(model)
out <- LSD.test(model, "group", p.adj = "none" ) #?進行多重比較,不矯正P值
out$groups # 查看每個組的label
plot(out) # 可視化展示
.?Dunnett檢驗
適用于多個試驗組于一個對照組的比較。
用法:加載multcomp包, 使用glht()函數(shù)。語法為:glht(model, linfct, alternative = c("two.sided", "less", "greater"), ...)
其中l(wèi)infct可以設(shè)置比較的分組變量以及檢驗方法。
實例:
# Dunnett test
library(multcomp)
model <- aov(D ~ group, data.yazhou)
rht <- glht(model, linfct = mcp(group = 'Dunnett'), alternative = 'two.side')
summary(rht)
Turkey檢驗
使用t test進行組間所有成對比較。
用法:TukeyHSD函數(shù),語法:TukeyHSD(model)
實例:
model <- aov(D ~ group, data.yazhou)
tuk <- TukeyHSD(model)
tuk
plot(tuk)
SNK法(Student-Newman-Keuls)
實質(zhì)上是根據(jù)預(yù)先制定的準(zhǔn)則將各組均數(shù)分為多個子集, 利用Studentized Range分布來進行假設(shè)檢驗。推薦優(yōu)先用Tukey檢驗
SNK法可用agricolae包中的SNK.test()函數(shù)實現(xiàn),其調(diào)用格式為:
SNK.test(y, trt, alpha = 0.05, …)?
其中y為方差分析對象,trt為要進行多重比較的分組變量
實例
library(agricolae)?
data(sweetpotato)?
model <- aov(D ~ group, data.yazhou)
out <- snk.test(model,"group")
out$group?
plot(out)?
程序運行結(jié)果與LSD.test類似。
Duncan法(新復(fù)極差法)(SSR)
指定一系列的“range”值,逐步進行計算比較得出結(jié)論。
Duncan法可用agricolae包中的duncan.test()函數(shù)實現(xiàn),語法為:
duncan.test(y, trt, …)?
實例:
model <- aov(D ~ group, data.yazhou)
out <-duncan.test (model,"group")
out$group?
plot(out)?
程序運行結(jié)果與LSD.test類似。
Scheffe檢驗
為均值的所有可能的成對組合執(zhí)行并發(fā)的聯(lián)合成對比較。使用F取樣分布??捎脕頇z查組均值的所有可能的線性組合,而非僅限于成對組合。Scheffe檢驗特點:
各組樣本數(shù)相等或不等均可以,但是以各組樣本數(shù)不相等使用較多;
如果比較的次數(shù)明顯地大于均數(shù)的個數(shù)時,Scheffe法的檢驗功效可能優(yōu)于Bonferroni法
Scheffe法可用agricolae包中的scheffe.test()函數(shù)實現(xiàn),語法為:
duncan.test(y, trt, …)?
實例:
out <-scheffe.test (model,"virus")
out$group?
plot(out)?








暫無數(shù)據(jù)