使用R进行ANOVA检验(单因素方差分析)

ANOVA is short for ANalysis Of VAriance. Though it seems that ANOVA is a test for variance, it is truly a test for the difference in means for more than two samples.

H0: The population means of the groups being compared are the same.

H1: At least one of the means differ from the other.

There are two important assumptions of ANOVA:

(1)Independence,Normality:Samples are randomly drawn from a normal distribution, and are independent to each other.

(2)Homogeneity of variances(方差相等):The variances for the different populations from which the samples are drawn are equal.

基于此,我们在使用ANOVA之前首先要判断方差是否相等,根据方差是否相等选择合适的ANOVA方法。(红色表示具体的检验方法,蓝色表示R中所使用的函数)


使用R进行ANOVA检验(单因素方差分析)_第1张图片

TukeyHSD

但是ANOVA的结果只能告诉我们所检测的多个样本的平均值是否存在差异,并不能告诉我们究竟是哪个样本或者是哪几个样本与其余样本不同。此时我们可以选择TukeyHSD方法进一步检测,得到更为具体的结果——任意两个样本间平均值比对的结果。

所以上述流程图可以进一步完善为:

使用R进行ANOVA检验(单因素方差分析)_第2张图片

你可能感兴趣的:(使用R进行ANOVA检验(单因素方差分析))