第 5 章 方差分析

5.1 单因素方差分析

library(dplyr)
data("iris")
head(iris)
##   Sepal.Length Sepal.Width Petal.Length Petal.Width Species
## 1          5.1         3.5          1.4         0.2  setosa
## 2          4.9         3.0          1.4         0.2  setosa
## 3          4.7         3.2          1.3         0.2  setosa
## 4          4.6         3.1          1.5         0.2  setosa
## 5          5.0         3.6          1.4         0.2  setosa
## 6          5.4         3.9          1.7         0.4  setosa
# 方差分析
aov_iris <- aov(Sepal.Width~Species, data = iris)
summary(aov_iris)
##              Df Sum Sq Mean Sq F value Pr(>F)    
## Species       2  11.35   5.672   49.16 <2e-16 ***
## Residuals   147  16.96   0.115                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

可以看出 Sepal.Width 在品种间程极显著,说明不同品种间Sepal.Width 差异显著。

接下来我们做一下多重比较,看一下Sepal.Width 在品种两两之间的差异显著性。以下是几种比较常见的多重比较方法。

#Tukey test 
require(DescTools)
## 载入需要的程辑包:DescTools
#Tukey's HSD test 
PostHocTest(aov_iris, method = "hsd")
## 
##   Posthoc multiple comparisons of means : Tukey HSD 
##     95% family-wise confidence level
## 
## $Species
##                        diff      lwr.ci     upr.ci    pval    
## versicolor-setosa    -0.658 -0.81885528 -0.4971447 3.1e-14 ***
## virginica-setosa     -0.454 -0.61485528 -0.2931447 1.4e-09 ***
## virginica-versicolor  0.204  0.04314472  0.3648553  0.0088 ** 
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#duncan test 
PostHocTest(aov_iris, method = "duncan")
## 
##   Posthoc multiple comparisons of means : Duncan's new multiple range test 
##     95% family-wise confidence level
## 
## $Species
##                        diff      lwr.ci     upr.ci    pval    
## versicolor-setosa    -0.658 -0.79931412 -0.5166859 1.6e-14 ***
## virginica-setosa     -0.454 -0.58826044 -0.3197396 4.5e-10 ***
## virginica-versicolor  0.204  0.06973956  0.3382604  0.0031 ** 
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
PostHocTest(aov_iris, method = "bonferroni")
## 
##   Posthoc multiple comparisons of means : Bonferroni 
##     95% family-wise confidence level
## 
## $Species
##                        diff      lwr.ci     upr.ci    pval    
## versicolor-setosa    -0.658 -0.82252342 -0.4934766 < 2e-16 ***
## virginica-setosa     -0.454 -0.61852342 -0.2894766 1.4e-09 ***
## virginica-versicolor  0.204  0.03947658  0.3685234  0.0094 ** 
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Fisher's LSD test 
PostHocTest(aov_iris, method = "lsd")
## 
##   Posthoc multiple comparisons of means : Fisher LSD 
##     95% family-wise confidence level
## 
## $Species
##                        diff      lwr.ci     upr.ci    pval    
## versicolor-setosa    -0.658 -0.79226044 -0.5237396 < 2e-16 ***
## virginica-setosa     -0.454 -0.58826044 -0.3197396 4.5e-10 ***
## virginica-versicolor  0.204  0.06973956  0.3382604  0.0031 ** 
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Scheffe test
PostHocTest(aov_iris, method = "scheffe")
## 
##   Posthoc multiple comparisons of means: Scheffe Test 
##     95% family-wise confidence level
## 
## $Species
##                        diff      lwr.ci     upr.ci    pval    
## versicolor-setosa    -0.658 -0.82600285 -0.4899971 < 2e-16 ***
## virginica-setosa     -0.454 -0.62200285 -0.2859971 3.4e-09 ***
## virginica-versicolor  0.204  0.03599715  0.3720029  0.0126 *  
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Newman-Keuls test
PostHocTest(aov_iris, method = "newmankeuls")
## 
##   Posthoc multiple comparisons of means : Newman-Keuls 
##     95% family-wise confidence level
## 
## $Species
##                        diff      lwr.ci     upr.ci    pval    
## versicolor-setosa    -0.658 -0.81885528 -0.4971447 3.1e-14 ***
## virginica-setosa     -0.454 -0.58826044 -0.3197396 4.5e-10 ***
## virginica-versicolor  0.204  0.06973956  0.3382604  0.0031 ** 
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

我们可以将方差分析的结果给plot出来, 如下图:

par(mfrow=c(2,2))
plot(aov_iris)

5.2 双因素方差分析

这里我们以 1.4 生成的数据为例,比如说我们想知道胸径子家系和地点之间是否有显著差异,以及家系和地点的相互作用对胸径有显著影响:

library(dplyr)
site <- rep(c('site1','site2', 'site3' ),each = 25,len=75)#每个地点5个家系5株树,所以每个家系25株数据,总共75株。
families  <- rep(c('f1', 'f2','f3','f4','f5'),each = 5,len=75) #每个家系5株树,总共75株。
dbh <- rep( sample(c(10:15,15:20,23:28, 10.5:20.5,20:30),size = 15),each=5, len=75) #随机一组数据 
height <- sample(x = 10.8:30.8, size  = 75, replace = TRUE) #随机一组数据 
zhi_height <- sample(x = 10.1:15.5, size  = 75, replace = TRUE) #随机一组数据 
## 整合这5个变量成为一个数据集
growth <- cbind.data.frame(site,families,dbh,height,zhi_height)
head(growth) # 查看前6列数据
##    site families dbh height zhi_height
## 1 site1       f1  19   28.8       13.1
## 2 site1       f1  19   16.8       12.1
## 3 site1       f1  19   24.8       13.1
## 4 site1       f1  19   19.8       14.1
## 5 site1       f1  19   13.8       14.1
## 6 site1       f2  17   10.8       11.1
tail(growth) # 查看后6列数据
##     site families dbh height zhi_height
## 70 site3       f4  15   19.8       12.1
## 71 site3       f5  29   11.8       15.1
## 72 site3       f5  29   10.8       12.1
## 73 site3       f5  29   17.8       10.1
## 74 site3       f5  29   22.8       11.1
## 75 site3       f5  29   26.8       10.1
str(growth) # 查看数据集形式
## 'data.frame':    75 obs. of  5 variables:
##  $ site      : chr  "site1" "site1" "site1" "site1" ...
##  $ families  : chr  "f1" "f1" "f1" "f1" ...
##  $ dbh       : num  19 19 19 19 19 17 17 17 17 17 ...
##  $ height    : num  28.8 16.8 24.8 19.8 13.8 10.8 23.8 27.8 28.8 10.8 ...
##  $ zhi_height: num  13.1 12.1 13.1 14.1 14.1 11.1 13.1 12.1 14.1 13.1 ...
# 方差分析
# *这个符号是表示我们要查看site,families 以及site × families 交互作用的影响,
#如果不想计算ite × families 交互作用的影响,而可以使用+号

aov_dbh <- aov(dbh~site*families, data = growth)
summary(aov_dbh)
##               Df Sum Sq Mean Sq   F value Pr(>F)    
## site           2  284.7  142.33 1.013e+30 <2e-16 ***
## families       4  294.7   73.67 5.245e+29 <2e-16 ***
## site:families  8 1705.3  213.17 1.518e+30 <2e-16 ***
## Residuals     60    0.0    0.00                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

从这个例子里我们可以得出,dbh在家系间差异极显著,在地点间无显著差异,地点×家系间显著不明显。同样的我们也可以做一下多重比较,查看各个家系、地点以及家系×地点间的的影响。

#Tukey test 
require(DescTools)
#Tukey's HSD test 
PostHocTest(aov_dbh, method = "hsd")
## 
##   Posthoc multiple comparisons of means : Tukey HSD 
##     95% family-wise confidence level
## 
## $site
##             diff lwr.ci upr.ci  pval    
## site2-site1  0.6    0.6    0.6 2e-11 ***
## site3-site1  4.4    4.4    4.4 2e-11 ***
## site3-site2  3.8    3.8    3.8 2e-11 ***
## 
## $families
##             diff     lwr.ci     upr.ci  pval    
## f2-f1 -0.8333333 -0.8333333 -0.8333333 2e-11 ***
## f3-f1  1.3333333  1.3333333  1.3333333 2e-11 ***
## f4-f1 -3.6666667 -3.6666667 -3.6666667 2e-11 ***
## f5-f1  2.0000000  2.0000000  2.0000000 2e-11 ***
## f3-f2  2.1666667  2.1666667  2.1666667 2e-11 ***
## f4-f2 -2.8333333 -2.8333333 -2.8333333 2e-11 ***
## f5-f2  2.8333333  2.8333333  2.8333333 2e-11 ***
## f4-f3 -5.0000000 -5.0000000 -5.0000000 2e-11 ***
## f5-f3  0.6666667  0.6666667  0.6666667 2e-11 ***
## f5-f4  5.6666667  5.6666667  5.6666667 2e-11 ***
## 
## $`site:families`
##                            diff        lwr.ci        upr.ci   pval    
## site2:f1-site1:f1 -4.000000e+00 -4.000000e+00 -4.000000e+00  2e-11 ***
## site3:f1-site1:f1  7.000000e+00  7.000000e+00  7.000000e+00  2e-11 ***
## site1:f2-site1:f1 -2.000000e+00 -2.000000e+00 -2.000000e+00  2e-11 ***
## site2:f2-site1:f1  4.000000e+00  4.000000e+00  4.000000e+00  2e-11 ***
## site3:f2-site1:f1 -1.500000e+00 -1.500000e+00 -1.500000e+00  2e-11 ***
## site1:f3-site1:f1  6.000000e+00  6.000000e+00  6.000000e+00  2e-11 ***
## site2:f3-site1:f1 -5.000000e+00 -5.000000e+00 -5.000000e+00  2e-11 ***
## site3:f3-site1:f1  6.000000e+00  6.000000e+00  6.000000e+00  2e-11 ***
## site1:f4-site1:f1  5.000000e-01  5.000000e-01  5.000000e-01  2e-11 ***
## site2:f4-site1:f1 -4.500000e+00 -4.500000e+00 -4.500000e+00  2e-11 ***
## site3:f4-site1:f1 -4.000000e+00 -4.000000e+00 -4.000000e+00  2e-11 ***
## site1:f5-site1:f1 -9.000000e+00 -9.000000e+00 -9.000000e+00  2e-11 ***
## site2:f5-site1:f1  8.000000e+00  8.000000e+00  8.000000e+00  2e-11 ***
## site3:f5-site1:f1  1.000000e+01  1.000000e+01  1.000000e+01  2e-11 ***
## site3:f1-site2:f1  1.100000e+01  1.100000e+01  1.100000e+01  2e-11 ***
## site1:f2-site2:f1  2.000000e+00  2.000000e+00  2.000000e+00  2e-11 ***
## site2:f2-site2:f1  8.000000e+00  8.000000e+00  8.000000e+00  2e-11 ***
## site3:f2-site2:f1  2.500000e+00  2.500000e+00  2.500000e+00  2e-11 ***
## site1:f3-site2:f1  1.000000e+01  1.000000e+01  1.000000e+01  2e-11 ***
## site2:f3-site2:f1 -1.000000e+00 -1.000000e+00 -1.000000e+00  2e-11 ***
## site3:f3-site2:f1  1.000000e+01  1.000000e+01  1.000000e+01  2e-11 ***
## site1:f4-site2:f1  4.500000e+00  4.500000e+00  4.500000e+00  2e-11 ***
## site2:f4-site2:f1 -5.000000e-01 -5.000000e-01 -5.000000e-01  2e-11 ***
## site3:f4-site2:f1 -1.776357e-15 -2.828308e-14  2.473036e-14 1.0000    
## site1:f5-site2:f1 -5.000000e+00 -5.000000e+00 -5.000000e+00  2e-11 ***
## site2:f5-site2:f1  1.200000e+01  1.200000e+01  1.200000e+01  2e-11 ***
## site3:f5-site2:f1  1.400000e+01  1.400000e+01  1.400000e+01  2e-11 ***
## site1:f2-site3:f1 -9.000000e+00 -9.000000e+00 -9.000000e+00  2e-11 ***
## site2:f2-site3:f1 -3.000000e+00 -3.000000e+00 -3.000000e+00  2e-11 ***
## site3:f2-site3:f1 -8.500000e+00 -8.500000e+00 -8.500000e+00  2e-11 ***
## site1:f3-site3:f1 -1.000000e+00 -1.000000e+00 -1.000000e+00  2e-11 ***
## site2:f3-site3:f1 -1.200000e+01 -1.200000e+01 -1.200000e+01  2e-11 ***
## site3:f3-site3:f1 -1.000000e+00 -1.000000e+00 -1.000000e+00  2e-11 ***
## site1:f4-site3:f1 -6.500000e+00 -6.500000e+00 -6.500000e+00  2e-11 ***
## site2:f4-site3:f1 -1.150000e+01 -1.150000e+01 -1.150000e+01  2e-11 ***
## site3:f4-site3:f1 -1.100000e+01 -1.100000e+01 -1.100000e+01  2e-11 ***
## site1:f5-site3:f1 -1.600000e+01 -1.600000e+01 -1.600000e+01  2e-11 ***
## site2:f5-site3:f1  1.000000e+00  1.000000e+00  1.000000e+00  2e-11 ***
## site3:f5-site3:f1  3.000000e+00  3.000000e+00  3.000000e+00  2e-11 ***
## site2:f2-site1:f2  6.000000e+00  6.000000e+00  6.000000e+00  2e-11 ***
## site3:f2-site1:f2  5.000000e-01  5.000000e-01  5.000000e-01  2e-11 ***
## site1:f3-site1:f2  8.000000e+00  8.000000e+00  8.000000e+00  2e-11 ***
## site2:f3-site1:f2 -3.000000e+00 -3.000000e+00 -3.000000e+00  2e-11 ***
## site3:f3-site1:f2  8.000000e+00  8.000000e+00  8.000000e+00  2e-11 ***
## site1:f4-site1:f2  2.500000e+00  2.500000e+00  2.500000e+00  2e-11 ***
## site2:f4-site1:f2 -2.500000e+00 -2.500000e+00 -2.500000e+00  2e-11 ***
## site3:f4-site1:f2 -2.000000e+00 -2.000000e+00 -2.000000e+00  2e-11 ***
## site1:f5-site1:f2 -7.000000e+00 -7.000000e+00 -7.000000e+00  2e-11 ***
## site2:f5-site1:f2  1.000000e+01  1.000000e+01  1.000000e+01  2e-11 ***
## site3:f5-site1:f2  1.200000e+01  1.200000e+01  1.200000e+01  2e-11 ***
## site3:f2-site2:f2 -5.500000e+00 -5.500000e+00 -5.500000e+00  2e-11 ***
## site1:f3-site2:f2  2.000000e+00  2.000000e+00  2.000000e+00  2e-11 ***
## site2:f3-site2:f2 -9.000000e+00 -9.000000e+00 -9.000000e+00  2e-11 ***
## site3:f3-site2:f2  2.000000e+00  2.000000e+00  2.000000e+00  2e-11 ***
## site1:f4-site2:f2 -3.500000e+00 -3.500000e+00 -3.500000e+00  2e-11 ***
## site2:f4-site2:f2 -8.500000e+00 -8.500000e+00 -8.500000e+00  2e-11 ***
## site3:f4-site2:f2 -8.000000e+00 -8.000000e+00 -8.000000e+00  2e-11 ***
## site1:f5-site2:f2 -1.300000e+01 -1.300000e+01 -1.300000e+01  2e-11 ***
## site2:f5-site2:f2  4.000000e+00  4.000000e+00  4.000000e+00  2e-11 ***
## site3:f5-site2:f2  6.000000e+00  6.000000e+00  6.000000e+00  2e-11 ***
## site1:f3-site3:f2  7.500000e+00  7.500000e+00  7.500000e+00  2e-11 ***
## site2:f3-site3:f2 -3.500000e+00 -3.500000e+00 -3.500000e+00  2e-11 ***
## site3:f3-site3:f2  7.500000e+00  7.500000e+00  7.500000e+00  2e-11 ***
## site1:f4-site3:f2  2.000000e+00  2.000000e+00  2.000000e+00  2e-11 ***
## site2:f4-site3:f2 -3.000000e+00 -3.000000e+00 -3.000000e+00  2e-11 ***
## site3:f4-site3:f2 -2.500000e+00 -2.500000e+00 -2.500000e+00  2e-11 ***
## site1:f5-site3:f2 -7.500000e+00 -7.500000e+00 -7.500000e+00  2e-11 ***
## site2:f5-site3:f2  9.500000e+00  9.500000e+00  9.500000e+00  2e-11 ***
## site3:f5-site3:f2  1.150000e+01  1.150000e+01  1.150000e+01  2e-11 ***
## site2:f3-site1:f3 -1.100000e+01 -1.100000e+01 -1.100000e+01  2e-11 ***
## site3:f3-site1:f3 -3.552714e-15 -3.005944e-14  2.295401e-14 1.0000    
## site1:f4-site1:f3 -5.500000e+00 -5.500000e+00 -5.500000e+00  2e-11 ***
## site2:f4-site1:f3 -1.050000e+01 -1.050000e+01 -1.050000e+01  2e-11 ***
## site3:f4-site1:f3 -1.000000e+01 -1.000000e+01 -1.000000e+01  2e-11 ***
## site1:f5-site1:f3 -1.500000e+01 -1.500000e+01 -1.500000e+01  2e-11 ***
## site2:f5-site1:f3  2.000000e+00  2.000000e+00  2.000000e+00  2e-11 ***
## site3:f5-site1:f3  4.000000e+00  4.000000e+00  4.000000e+00  2e-11 ***
## site3:f3-site2:f3  1.100000e+01  1.100000e+01  1.100000e+01  2e-11 ***
## site1:f4-site2:f3  5.500000e+00  5.500000e+00  5.500000e+00  2e-11 ***
## site2:f4-site2:f3  5.000000e-01  5.000000e-01  5.000000e-01  2e-11 ***
## site3:f4-site2:f3  1.000000e+00  1.000000e+00  1.000000e+00  2e-11 ***
## site1:f5-site2:f3 -4.000000e+00 -4.000000e+00 -4.000000e+00  2e-11 ***
## site2:f5-site2:f3  1.300000e+01  1.300000e+01  1.300000e+01  2e-11 ***
## site3:f5-site2:f3  1.500000e+01  1.500000e+01  1.500000e+01  2e-11 ***
## site1:f4-site3:f3 -5.500000e+00 -5.500000e+00 -5.500000e+00  2e-11 ***
## site2:f4-site3:f3 -1.050000e+01 -1.050000e+01 -1.050000e+01  2e-11 ***
## site3:f4-site3:f3 -1.000000e+01 -1.000000e+01 -1.000000e+01  2e-11 ***
## site1:f5-site3:f3 -1.500000e+01 -1.500000e+01 -1.500000e+01  2e-11 ***
## site2:f5-site3:f3  2.000000e+00  2.000000e+00  2.000000e+00  2e-11 ***
## site3:f5-site3:f3  4.000000e+00  4.000000e+00  4.000000e+00  2e-11 ***
## site2:f4-site1:f4 -5.000000e+00 -5.000000e+00 -5.000000e+00  2e-11 ***
## site3:f4-site1:f4 -4.500000e+00 -4.500000e+00 -4.500000e+00  2e-11 ***
## site1:f5-site1:f4 -9.500000e+00 -9.500000e+00 -9.500000e+00  2e-11 ***
## site2:f5-site1:f4  7.500000e+00  7.500000e+00  7.500000e+00  2e-11 ***
## site3:f5-site1:f4  9.500000e+00  9.500000e+00  9.500000e+00  2e-11 ***
## site3:f4-site2:f4  5.000000e-01  5.000000e-01  5.000000e-01  2e-11 ***
## site1:f5-site2:f4 -4.500000e+00 -4.500000e+00 -4.500000e+00  2e-11 ***
## site2:f5-site2:f4  1.250000e+01  1.250000e+01  1.250000e+01  2e-11 ***
## site3:f5-site2:f4  1.450000e+01  1.450000e+01  1.450000e+01  2e-11 ***
## site1:f5-site3:f4 -5.000000e+00 -5.000000e+00 -5.000000e+00  2e-11 ***
## site2:f5-site3:f4  1.200000e+01  1.200000e+01  1.200000e+01  2e-11 ***
## site3:f5-site3:f4  1.400000e+01  1.400000e+01  1.400000e+01  2e-11 ***
## site2:f5-site1:f5  1.700000e+01  1.700000e+01  1.700000e+01  2e-11 ***
## site3:f5-site1:f5  1.900000e+01  1.900000e+01  1.900000e+01  2e-11 ***
## site3:f5-site2:f5  2.000000e+00  2.000000e+00  2.000000e+00  2e-11 ***
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#duncan test 
PostHocTest(aov_dbh, method = "duncan")
## 
##   Posthoc multiple comparisons of means : Duncan's new multiple range test 
##     95% family-wise confidence level
## 
## $site
##             diff lwr.ci upr.ci    pval    
## site2-site1  0.6    0.6    0.6 2.0e-11 ***
## site3-site1  4.4    4.4    4.4 9.9e-12 ***
## site3-site2  3.8    3.8    3.8 2.0e-11 ***
## 
## $families
##             diff     lwr.ci     upr.ci    pval    
## f2-f1 -0.8333333 -0.8333333 -0.8333333 2.0e-11 ***
## f3-f1  1.3333333  1.3333333  1.3333333 2.0e-11 ***
## f4-f1 -3.6666667 -3.6666667 -3.6666667 9.9e-12 ***
## f5-f1  2.0000000  2.0000000  2.0000000 9.9e-12 ***
## f3-f2  2.1666667  2.1666667  2.1666667 9.9e-12 ***
## f4-f2 -2.8333333 -2.8333333 -2.8333333 2.0e-11 ***
## f5-f2  2.8333333  2.8333333  2.8333333 6.6e-12 ***
## f4-f3 -5.0000000 -5.0000000 -5.0000000 6.6e-12 ***
## f5-f3  0.6666667  0.6666667  0.6666667 2.0e-11 ***
## f5-f4  5.6666667  5.6666667  5.6666667 5.0e-12 ***
## 
## $`site:families`
##                            diff        lwr.ci        upr.ci    pval    
## site2:f1-site1:f1 -4.000000e+00 -4.000000e+00 -4.000000e+00 6.6e-12 ***
## site3:f1-site1:f1  7.000000e+00  7.000000e+00  7.000000e+00 4.0e-12 ***
## site1:f2-site1:f1 -2.000000e+00 -2.000000e+00 -2.000000e+00 9.9e-12 ***
## site2:f2-site1:f1  4.000000e+00  4.000000e+00  4.000000e+00 9.9e-12 ***
## site3:f2-site1:f1 -1.500000e+00 -1.500000e+00 -1.500000e+00 2.0e-11 ***
## site1:f3-site1:f1  6.000000e+00  6.000000e+00  6.000000e+00 5.0e-12 ***
## site2:f3-site1:f1 -5.000000e+00 -5.000000e+00 -5.000000e+00 3.3e-12 ***
## site3:f3-site1:f1  6.000000e+00  6.000000e+00  6.000000e+00 6.6e-12 ***
## site1:f4-site1:f1  5.000000e-01  5.000000e-01  5.000000e-01 2.0e-11 ***
## site2:f4-site1:f1 -4.500000e+00 -4.500000e+00 -4.500000e+00 4.0e-12 ***
## site3:f4-site1:f1 -4.000000e+00 -4.000000e+00 -4.000000e+00 5.0e-12 ***
## site1:f5-site1:f1 -9.000000e+00 -9.000000e+00 -9.000000e+00 2.8e-12 ***
## site2:f5-site1:f1  8.000000e+00  8.000000e+00  8.000000e+00 3.3e-12 ***
## site3:f5-site1:f1  1.000000e+01  1.000000e+01  1.000000e+01 2.8e-12 ***
## site3:f1-site2:f1  1.100000e+01  1.100000e+01  1.100000e+01 2.5e-12 ***
## site1:f2-site2:f1  2.000000e+00  2.000000e+00  2.000000e+00 2.0e-11 ***
## site2:f2-site2:f1  8.000000e+00  8.000000e+00  8.000000e+00 4.0e-12 ***
## site3:f2-site2:f1  2.500000e+00  2.500000e+00  2.500000e+00 9.9e-12 ***
## site1:f3-site2:f1  1.000000e+01  1.000000e+01  1.000000e+01 2.8e-12 ***
## site2:f3-site2:f1 -1.000000e+00 -1.000000e+00 -1.000000e+00 6.6e-12 ***
## site3:f3-site2:f1  1.000000e+01  1.000000e+01  1.000000e+01 3.3e-12 ***
## site1:f4-site2:f1  4.500000e+00  4.500000e+00  4.500000e+00 5.0e-12 ***
## site2:f4-site2:f1 -5.000000e-01 -5.000000e-01 -5.000000e-01 9.9e-12 ***
## site3:f4-site2:f1 -1.776357e-15 -1.676979e-14  1.321707e-14  0.8135    
## site1:f5-site2:f1 -5.000000e+00 -5.000000e+00 -5.000000e+00 5.0e-12 ***
## site2:f5-site2:f1  1.200000e+01  1.200000e+01  1.200000e+01 2.2e-12 ***
## site3:f5-site2:f1  1.400000e+01  1.400000e+01  1.400000e+01 2.0e-12 ***
## site1:f2-site3:f1 -9.000000e+00 -9.000000e+00 -9.000000e+00 2.8e-12 ***
## site2:f2-site3:f1 -3.000000e+00 -3.000000e+00 -3.000000e+00 6.6e-12 ***
## site3:f2-site3:f1 -8.500000e+00 -8.500000e+00 -8.500000e+00 3.3e-12 ***
## site1:f3-site3:f1 -1.000000e+00 -1.000000e+00 -1.000000e+00 2.0e-11 ***
## site2:f3-site3:f1 -1.200000e+01 -1.200000e+01 -1.200000e+01 1.8e-12 ***
## site3:f3-site3:f1 -1.000000e+00 -1.000000e+00 -1.000000e+00 9.9e-12 ***
## site1:f4-site3:f1 -6.500000e+00 -6.500000e+00 -6.500000e+00 5.0e-12 ***
## site2:f4-site3:f1 -1.150000e+01 -1.150000e+01 -1.150000e+01 2.0e-12 ***
## site3:f4-site3:f1 -1.100000e+01 -1.100000e+01 -1.100000e+01 2.2e-12 ***
## site1:f5-site3:f1 -1.600000e+01 -1.600000e+01 -1.600000e+01 1.7e-12 ***
## site2:f5-site3:f1  1.000000e+00  1.000000e+00  1.000000e+00 2.0e-11 ***
## site3:f5-site3:f1  3.000000e+00  3.000000e+00  3.000000e+00 9.9e-12 ***
## site2:f2-site1:f2  6.000000e+00  6.000000e+00  6.000000e+00 5.0e-12 ***
## site3:f2-site1:f2  5.000000e-01  5.000000e-01  5.000000e-01 2.0e-11 ***
## site1:f3-site1:f2  8.000000e+00  8.000000e+00  8.000000e+00 3.3e-12 ***
## site2:f3-site1:f2 -3.000000e+00 -3.000000e+00 -3.000000e+00 5.0e-12 ***
## site3:f3-site1:f2  8.000000e+00  8.000000e+00  8.000000e+00 4.0e-12 ***
## site1:f4-site1:f2  2.500000e+00  2.500000e+00  2.500000e+00 6.6e-12 ***
## site2:f4-site1:f2 -2.500000e+00 -2.500000e+00 -2.500000e+00 6.6e-12 ***
## site3:f4-site1:f2 -2.000000e+00 -2.000000e+00 -2.000000e+00 9.9e-12 ***
## site1:f5-site1:f2 -7.000000e+00 -7.000000e+00 -7.000000e+00 4.0e-12 ***
## site2:f5-site1:f2  1.000000e+01  1.000000e+01  1.000000e+01 2.5e-12 ***
## site3:f5-site1:f2  1.200000e+01  1.200000e+01  1.200000e+01 2.2e-12 ***
## site3:f2-site2:f2 -5.500000e+00 -5.500000e+00 -5.500000e+00 6.6e-12 ***
## site1:f3-site2:f2  2.000000e+00  2.000000e+00  2.000000e+00 9.9e-12 ***
## site2:f3-site2:f2 -9.000000e+00 -9.000000e+00 -9.000000e+00 2.5e-12 ***
## site3:f3-site2:f2  2.000000e+00  2.000000e+00  2.000000e+00 2.0e-11 ***
## site1:f4-site2:f2 -3.500000e+00 -3.500000e+00 -3.500000e+00 2.0e-11 ***
## site2:f4-site2:f2 -8.500000e+00 -8.500000e+00 -8.500000e+00 2.8e-12 ***
## site3:f4-site2:f2 -8.000000e+00 -8.000000e+00 -8.000000e+00 3.3e-12 ***
## site1:f5-site2:f2 -1.300000e+01 -1.300000e+01 -1.300000e+01 2.2e-12 ***
## site2:f5-site2:f2  4.000000e+00  4.000000e+00  4.000000e+00 5.0e-12 ***
## site3:f5-site2:f2  6.000000e+00  6.000000e+00  6.000000e+00 4.0e-12 ***
## site1:f3-site3:f2  7.500000e+00  7.500000e+00  7.500000e+00 4.0e-12 ***
## site2:f3-site3:f2 -3.500000e+00 -3.500000e+00 -3.500000e+00 4.0e-12 ***
## site3:f3-site3:f2  7.500000e+00  7.500000e+00  7.500000e+00 5.0e-12 ***
## site1:f4-site3:f2  2.000000e+00  2.000000e+00  2.000000e+00 9.9e-12 ***
## site2:f4-site3:f2 -3.000000e+00 -3.000000e+00 -3.000000e+00 5.0e-12 ***
## site3:f4-site3:f2 -2.500000e+00 -2.500000e+00 -2.500000e+00 6.6e-12 ***
## site1:f5-site3:f2 -7.500000e+00 -7.500000e+00 -7.500000e+00 3.3e-12 ***
## site2:f5-site3:f2  9.500000e+00  9.500000e+00  9.500000e+00 2.8e-12 ***
## site3:f5-site3:f2  1.150000e+01  1.150000e+01  1.150000e+01 2.5e-12 ***
## site2:f3-site1:f3 -1.100000e+01 -1.100000e+01 -1.100000e+01 2.0e-12 ***
## site3:f3-site1:f3 -3.552714e-15 -1.854614e-14  1.144072e-14  0.6372    
## site1:f4-site1:f3 -5.500000e+00 -5.500000e+00 -5.500000e+00 6.6e-12 ***
## site2:f4-site1:f3 -1.050000e+01 -1.050000e+01 -1.050000e+01 2.2e-12 ***
## site3:f4-site1:f3 -1.000000e+01 -1.000000e+01 -1.000000e+01 2.5e-12 ***
## site1:f5-site1:f3 -1.500000e+01 -1.500000e+01 -1.500000e+01 1.8e-12 ***
## site2:f5-site1:f3  2.000000e+00  2.000000e+00  2.000000e+00 9.9e-12 ***
## site3:f5-site1:f3  4.000000e+00  4.000000e+00  4.000000e+00 6.6e-12 ***
## site3:f3-site2:f3  1.100000e+01  1.100000e+01  1.100000e+01 2.2e-12 ***
## site1:f4-site2:f3  5.500000e+00  5.500000e+00  5.500000e+00 2.8e-12 ***
## site2:f4-site2:f3  5.000000e-01  5.000000e-01  5.000000e-01 2.0e-11 ***
## site3:f4-site2:f3  1.000000e+00  1.000000e+00  1.000000e+00 9.9e-12 ***
## site1:f5-site2:f3 -4.000000e+00 -4.000000e+00 -4.000000e+00 2.0e-11 ***
## site2:f5-site2:f3  1.300000e+01  1.300000e+01  1.300000e+01 1.7e-12 ***
## site3:f5-site2:f3  1.500000e+01  1.500000e+01  1.500000e+01 1.5e-12 ***
## site1:f4-site3:f3 -5.500000e+00 -5.500000e+00 -5.500000e+00 9.9e-12 ***
## site2:f4-site3:f3 -1.050000e+01 -1.050000e+01 -1.050000e+01 2.5e-12 ***
## site3:f4-site3:f3 -1.000000e+01 -1.000000e+01 -1.000000e+01 2.8e-12 ***
## site1:f5-site3:f3 -1.500000e+01 -1.500000e+01 -1.500000e+01 2.0e-12 ***
## site2:f5-site3:f3  2.000000e+00  2.000000e+00  2.000000e+00 6.6e-12 ***
## site3:f5-site3:f3  4.000000e+00  4.000000e+00  4.000000e+00 5.0e-12 ***
## site2:f4-site1:f4 -5.000000e+00 -5.000000e+00 -5.000000e+00 3.3e-12 ***
## site3:f4-site1:f4 -4.500000e+00 -4.500000e+00 -4.500000e+00 4.0e-12 ***
## site1:f5-site1:f4 -9.500000e+00 -9.500000e+00 -9.500000e+00 2.5e-12 ***
## site2:f5-site1:f4  7.500000e+00  7.500000e+00  7.500000e+00 4.0e-12 ***
## site3:f5-site1:f4  9.500000e+00  9.500000e+00  9.500000e+00 3.3e-12 ***
## site3:f4-site2:f4  5.000000e-01  5.000000e-01  5.000000e-01 2.0e-11 ***
## site1:f5-site2:f4 -4.500000e+00 -4.500000e+00 -4.500000e+00 9.9e-12 ***
## site2:f5-site2:f4  1.250000e+01  1.250000e+01  1.250000e+01 1.8e-12 ***
## site3:f5-site2:f4  1.450000e+01  1.450000e+01  1.450000e+01 1.7e-12 ***
## site1:f5-site3:f4 -5.000000e+00 -5.000000e+00 -5.000000e+00 6.6e-12 ***
## site2:f5-site3:f4  1.200000e+01  1.200000e+01  1.200000e+01 2.0e-12 ***
## site3:f5-site3:f4  1.400000e+01  1.400000e+01  1.400000e+01 1.8e-12 ***
## site2:f5-site1:f5  1.700000e+01  1.700000e+01  1.700000e+01 1.5e-12 ***
## site3:f5-site1:f5  1.900000e+01  1.900000e+01  1.900000e+01 1.4e-12 ***
## site3:f5-site2:f5  2.000000e+00  2.000000e+00  2.000000e+00 2.0e-11 ***
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
PostHocTest(aov_dbh, method = "bonferroni")
## 
##   Posthoc multiple comparisons of means : Bonferroni 
##     95% family-wise confidence level
## 
## $site
##             diff lwr.ci upr.ci   pval    
## site2-site1  0.6    0.6    0.6 <2e-16 ***
## site3-site1  4.4    4.4    4.4 <2e-16 ***
## site3-site2  3.8    3.8    3.8 <2e-16 ***
## 
## $families
##             diff     lwr.ci     upr.ci   pval    
## f2-f1 -0.8333333 -0.8333333 -0.8333333 <2e-16 ***
## f3-f1  1.3333333  1.3333333  1.3333333 <2e-16 ***
## f4-f1 -3.6666667 -3.6666667 -3.6666667 <2e-16 ***
## f5-f1  2.0000000  2.0000000  2.0000000 <2e-16 ***
## f3-f2  2.1666667  2.1666667  2.1666667 <2e-16 ***
## f4-f2 -2.8333333 -2.8333333 -2.8333333 <2e-16 ***
## f5-f2  2.8333333  2.8333333  2.8333333 <2e-16 ***
## f4-f3 -5.0000000 -5.0000000 -5.0000000 <2e-16 ***
## f5-f3  0.6666667  0.6666667  0.6666667 <2e-16 ***
## f5-f4  5.6666667  5.6666667  5.6666667 <2e-16 ***
## 
## $`site:families`
##                            diff        lwr.ci        upr.ci   pval    
## site2:f1-site1:f1 -4.000000e+00 -4.000000e+00 -4.000000e+00 <2e-16 ***
## site3:f1-site1:f1  7.000000e+00  7.000000e+00  7.000000e+00 <2e-16 ***
## site1:f2-site1:f1 -2.000000e+00 -2.000000e+00 -2.000000e+00 <2e-16 ***
## site2:f2-site1:f1  4.000000e+00  4.000000e+00  4.000000e+00 <2e-16 ***
## site3:f2-site1:f1 -1.500000e+00 -1.500000e+00 -1.500000e+00 <2e-16 ***
## site1:f3-site1:f1  6.000000e+00  6.000000e+00  6.000000e+00 <2e-16 ***
## site2:f3-site1:f1 -5.000000e+00 -5.000000e+00 -5.000000e+00 <2e-16 ***
## site3:f3-site1:f1  6.000000e+00  6.000000e+00  6.000000e+00 <2e-16 ***
## site1:f4-site1:f1  5.000000e-01  5.000000e-01  5.000000e-01 <2e-16 ***
## site2:f4-site1:f1 -4.500000e+00 -4.500000e+00 -4.500000e+00 <2e-16 ***
## site3:f4-site1:f1 -4.000000e+00 -4.000000e+00 -4.000000e+00 <2e-16 ***
## site1:f5-site1:f1 -9.000000e+00 -9.000000e+00 -9.000000e+00 <2e-16 ***
## site2:f5-site1:f1  8.000000e+00  8.000000e+00  8.000000e+00 <2e-16 ***
## site3:f5-site1:f1  1.000000e+01  1.000000e+01  1.000000e+01 <2e-16 ***
## site3:f1-site2:f1  1.100000e+01  1.100000e+01  1.100000e+01 <2e-16 ***
## site1:f2-site2:f1  2.000000e+00  2.000000e+00  2.000000e+00 <2e-16 ***
## site2:f2-site2:f1  8.000000e+00  8.000000e+00  8.000000e+00 <2e-16 ***
## site3:f2-site2:f1  2.500000e+00  2.500000e+00  2.500000e+00 <2e-16 ***
## site1:f3-site2:f1  1.000000e+01  1.000000e+01  1.000000e+01 <2e-16 ***
## site2:f3-site2:f1 -1.000000e+00 -1.000000e+00 -1.000000e+00 <2e-16 ***
## site3:f3-site2:f1  1.000000e+01  1.000000e+01  1.000000e+01 <2e-16 ***
## site1:f4-site2:f1  4.500000e+00  4.500000e+00  4.500000e+00 <2e-16 ***
## site2:f4-site2:f1 -5.000000e-01 -5.000000e-01 -5.000000e-01 <2e-16 ***
## site3:f4-site2:f1 -1.776357e-15 -2.947982e-14  2.592711e-14 1.0000    
## site1:f5-site2:f1 -5.000000e+00 -5.000000e+00 -5.000000e+00 <2e-16 ***
## site2:f5-site2:f1  1.200000e+01  1.200000e+01  1.200000e+01 <2e-16 ***
## site3:f5-site2:f1  1.400000e+01  1.400000e+01  1.400000e+01 <2e-16 ***
## site1:f2-site3:f1 -9.000000e+00 -9.000000e+00 -9.000000e+00 <2e-16 ***
## site2:f2-site3:f1 -3.000000e+00 -3.000000e+00 -3.000000e+00 <2e-16 ***
## site3:f2-site3:f1 -8.500000e+00 -8.500000e+00 -8.500000e+00 <2e-16 ***
## site1:f3-site3:f1 -1.000000e+00 -1.000000e+00 -1.000000e+00 <2e-16 ***
## site2:f3-site3:f1 -1.200000e+01 -1.200000e+01 -1.200000e+01 <2e-16 ***
## site3:f3-site3:f1 -1.000000e+00 -1.000000e+00 -1.000000e+00 <2e-16 ***
## site1:f4-site3:f1 -6.500000e+00 -6.500000e+00 -6.500000e+00 <2e-16 ***
## site2:f4-site3:f1 -1.150000e+01 -1.150000e+01 -1.150000e+01 <2e-16 ***
## site3:f4-site3:f1 -1.100000e+01 -1.100000e+01 -1.100000e+01 <2e-16 ***
## site1:f5-site3:f1 -1.600000e+01 -1.600000e+01 -1.600000e+01 <2e-16 ***
## site2:f5-site3:f1  1.000000e+00  1.000000e+00  1.000000e+00 <2e-16 ***
## site3:f5-site3:f1  3.000000e+00  3.000000e+00  3.000000e+00 <2e-16 ***
## site2:f2-site1:f2  6.000000e+00  6.000000e+00  6.000000e+00 <2e-16 ***
## site3:f2-site1:f2  5.000000e-01  5.000000e-01  5.000000e-01 <2e-16 ***
## site1:f3-site1:f2  8.000000e+00  8.000000e+00  8.000000e+00 <2e-16 ***
## site2:f3-site1:f2 -3.000000e+00 -3.000000e+00 -3.000000e+00 <2e-16 ***
## site3:f3-site1:f2  8.000000e+00  8.000000e+00  8.000000e+00 <2e-16 ***
## site1:f4-site1:f2  2.500000e+00  2.500000e+00  2.500000e+00 <2e-16 ***
## site2:f4-site1:f2 -2.500000e+00 -2.500000e+00 -2.500000e+00 <2e-16 ***
## site3:f4-site1:f2 -2.000000e+00 -2.000000e+00 -2.000000e+00 <2e-16 ***
## site1:f5-site1:f2 -7.000000e+00 -7.000000e+00 -7.000000e+00 <2e-16 ***
## site2:f5-site1:f2  1.000000e+01  1.000000e+01  1.000000e+01 <2e-16 ***
## site3:f5-site1:f2  1.200000e+01  1.200000e+01  1.200000e+01 <2e-16 ***
## site3:f2-site2:f2 -5.500000e+00 -5.500000e+00 -5.500000e+00 <2e-16 ***
## site1:f3-site2:f2  2.000000e+00  2.000000e+00  2.000000e+00 <2e-16 ***
## site2:f3-site2:f2 -9.000000e+00 -9.000000e+00 -9.000000e+00 <2e-16 ***
## site3:f3-site2:f2  2.000000e+00  2.000000e+00  2.000000e+00 <2e-16 ***
## site1:f4-site2:f2 -3.500000e+00 -3.500000e+00 -3.500000e+00 <2e-16 ***
## site2:f4-site2:f2 -8.500000e+00 -8.500000e+00 -8.500000e+00 <2e-16 ***
## site3:f4-site2:f2 -8.000000e+00 -8.000000e+00 -8.000000e+00 <2e-16 ***
## site1:f5-site2:f2 -1.300000e+01 -1.300000e+01 -1.300000e+01 <2e-16 ***
## site2:f5-site2:f2  4.000000e+00  4.000000e+00  4.000000e+00 <2e-16 ***
## site3:f5-site2:f2  6.000000e+00  6.000000e+00  6.000000e+00 <2e-16 ***
## site1:f3-site3:f2  7.500000e+00  7.500000e+00  7.500000e+00 <2e-16 ***
## site2:f3-site3:f2 -3.500000e+00 -3.500000e+00 -3.500000e+00 <2e-16 ***
## site3:f3-site3:f2  7.500000e+00  7.500000e+00  7.500000e+00 <2e-16 ***
## site1:f4-site3:f2  2.000000e+00  2.000000e+00  2.000000e+00 <2e-16 ***
## site2:f4-site3:f2 -3.000000e+00 -3.000000e+00 -3.000000e+00 <2e-16 ***
## site3:f4-site3:f2 -2.500000e+00 -2.500000e+00 -2.500000e+00 <2e-16 ***
## site1:f5-site3:f2 -7.500000e+00 -7.500000e+00 -7.500000e+00 <2e-16 ***
## site2:f5-site3:f2  9.500000e+00  9.500000e+00  9.500000e+00 <2e-16 ***
## site3:f5-site3:f2  1.150000e+01  1.150000e+01  1.150000e+01 <2e-16 ***
## site2:f3-site1:f3 -1.100000e+01 -1.100000e+01 -1.100000e+01 <2e-16 ***
## site3:f3-site1:f3 -3.552714e-15 -3.125618e-14  2.415075e-14 1.0000    
## site1:f4-site1:f3 -5.500000e+00 -5.500000e+00 -5.500000e+00 <2e-16 ***
## site2:f4-site1:f3 -1.050000e+01 -1.050000e+01 -1.050000e+01 <2e-16 ***
## site3:f4-site1:f3 -1.000000e+01 -1.000000e+01 -1.000000e+01 <2e-16 ***
## site1:f5-site1:f3 -1.500000e+01 -1.500000e+01 -1.500000e+01 <2e-16 ***
## site2:f5-site1:f3  2.000000e+00  2.000000e+00  2.000000e+00 <2e-16 ***
## site3:f5-site1:f3  4.000000e+00  4.000000e+00  4.000000e+00 <2e-16 ***
## site3:f3-site2:f3  1.100000e+01  1.100000e+01  1.100000e+01 <2e-16 ***
## site1:f4-site2:f3  5.500000e+00  5.500000e+00  5.500000e+00 <2e-16 ***
## site2:f4-site2:f3  5.000000e-01  5.000000e-01  5.000000e-01 <2e-16 ***
## site3:f4-site2:f3  1.000000e+00  1.000000e+00  1.000000e+00 <2e-16 ***
## site1:f5-site2:f3 -4.000000e+00 -4.000000e+00 -4.000000e+00 <2e-16 ***
## site2:f5-site2:f3  1.300000e+01  1.300000e+01  1.300000e+01 <2e-16 ***
## site3:f5-site2:f3  1.500000e+01  1.500000e+01  1.500000e+01 <2e-16 ***
## site1:f4-site3:f3 -5.500000e+00 -5.500000e+00 -5.500000e+00 <2e-16 ***
## site2:f4-site3:f3 -1.050000e+01 -1.050000e+01 -1.050000e+01 <2e-16 ***
## site3:f4-site3:f3 -1.000000e+01 -1.000000e+01 -1.000000e+01 <2e-16 ***
## site1:f5-site3:f3 -1.500000e+01 -1.500000e+01 -1.500000e+01 <2e-16 ***
## site2:f5-site3:f3  2.000000e+00  2.000000e+00  2.000000e+00 <2e-16 ***
## site3:f5-site3:f3  4.000000e+00  4.000000e+00  4.000000e+00 <2e-16 ***
## site2:f4-site1:f4 -5.000000e+00 -5.000000e+00 -5.000000e+00 <2e-16 ***
## site3:f4-site1:f4 -4.500000e+00 -4.500000e+00 -4.500000e+00 <2e-16 ***
## site1:f5-site1:f4 -9.500000e+00 -9.500000e+00 -9.500000e+00 <2e-16 ***
## site2:f5-site1:f4  7.500000e+00  7.500000e+00  7.500000e+00 <2e-16 ***
## site3:f5-site1:f4  9.500000e+00  9.500000e+00  9.500000e+00 <2e-16 ***
## site3:f4-site2:f4  5.000000e-01  5.000000e-01  5.000000e-01 <2e-16 ***
## site1:f5-site2:f4 -4.500000e+00 -4.500000e+00 -4.500000e+00 <2e-16 ***
## site2:f5-site2:f4  1.250000e+01  1.250000e+01  1.250000e+01 <2e-16 ***
## site3:f5-site2:f4  1.450000e+01  1.450000e+01  1.450000e+01 <2e-16 ***
## site1:f5-site3:f4 -5.000000e+00 -5.000000e+00 -5.000000e+00 <2e-16 ***
## site2:f5-site3:f4  1.200000e+01  1.200000e+01  1.200000e+01 <2e-16 ***
## site3:f5-site3:f4  1.400000e+01  1.400000e+01  1.400000e+01 <2e-16 ***
## site2:f5-site1:f5  1.700000e+01  1.700000e+01  1.700000e+01 <2e-16 ***
## site3:f5-site1:f5  1.900000e+01  1.900000e+01  1.900000e+01 <2e-16 ***
## site3:f5-site2:f5  2.000000e+00  2.000000e+00  2.000000e+00 <2e-16 ***
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Fisher's LSD test 
PostHocTest(aov_dbh, method = "lsd")
## 
##   Posthoc multiple comparisons of means : Fisher LSD 
##     95% family-wise confidence level
## 
## $site
##             diff lwr.ci upr.ci   pval    
## site2-site1  0.6    0.6    0.6 <2e-16 ***
## site3-site1  4.4    4.4    4.4 <2e-16 ***
## site3-site2  3.8    3.8    3.8 <2e-16 ***
## 
## $families
##             diff     lwr.ci     upr.ci   pval    
## f2-f1 -0.8333333 -0.8333333 -0.8333333 <2e-16 ***
## f3-f1  1.3333333  1.3333333  1.3333333 <2e-16 ***
## f4-f1 -3.6666667 -3.6666667 -3.6666667 <2e-16 ***
## f5-f1  2.0000000  2.0000000  2.0000000 <2e-16 ***
## f3-f2  2.1666667  2.1666667  2.1666667 <2e-16 ***
## f4-f2 -2.8333333 -2.8333333 -2.8333333 <2e-16 ***
## f5-f2  2.8333333  2.8333333  2.8333333 <2e-16 ***
## f4-f3 -5.0000000 -5.0000000 -5.0000000 <2e-16 ***
## f5-f3  0.6666667  0.6666667  0.6666667 <2e-16 ***
## f5-f4  5.6666667  5.6666667  5.6666667 <2e-16 ***
## 
## $`site:families`
##                            diff        lwr.ci        upr.ci   pval    
## site2:f1-site1:f1 -4.000000e+00 -4.000000e+00 -4.000000e+00 <2e-16 ***
## site3:f1-site1:f1  7.000000e+00  7.000000e+00  7.000000e+00 <2e-16 ***
## site1:f2-site1:f1 -2.000000e+00 -2.000000e+00 -2.000000e+00 <2e-16 ***
## site2:f2-site1:f1  4.000000e+00  4.000000e+00  4.000000e+00 <2e-16 ***
## site3:f2-site1:f1 -1.500000e+00 -1.500000e+00 -1.500000e+00 <2e-16 ***
## site1:f3-site1:f1  6.000000e+00  6.000000e+00  6.000000e+00 <2e-16 ***
## site2:f3-site1:f1 -5.000000e+00 -5.000000e+00 -5.000000e+00 <2e-16 ***
## site3:f3-site1:f1  6.000000e+00  6.000000e+00  6.000000e+00 <2e-16 ***
## site1:f4-site1:f1  5.000000e-01  5.000000e-01  5.000000e-01 <2e-16 ***
## site2:f4-site1:f1 -4.500000e+00 -4.500000e+00 -4.500000e+00 <2e-16 ***
## site3:f4-site1:f1 -4.000000e+00 -4.000000e+00 -4.000000e+00 <2e-16 ***
## site1:f5-site1:f1 -9.000000e+00 -9.000000e+00 -9.000000e+00 <2e-16 ***
## site2:f5-site1:f1  8.000000e+00  8.000000e+00  8.000000e+00 <2e-16 ***
## site3:f5-site1:f1  1.000000e+01  1.000000e+01  1.000000e+01 <2e-16 ***
## site3:f1-site2:f1  1.100000e+01  1.100000e+01  1.100000e+01 <2e-16 ***
## site1:f2-site2:f1  2.000000e+00  2.000000e+00  2.000000e+00 <2e-16 ***
## site2:f2-site2:f1  8.000000e+00  8.000000e+00  8.000000e+00 <2e-16 ***
## site3:f2-site2:f1  2.500000e+00  2.500000e+00  2.500000e+00 <2e-16 ***
## site1:f3-site2:f1  1.000000e+01  1.000000e+01  1.000000e+01 <2e-16 ***
## site2:f3-site2:f1 -1.000000e+00 -1.000000e+00 -1.000000e+00 <2e-16 ***
## site3:f3-site2:f1  1.000000e+01  1.000000e+01  1.000000e+01 <2e-16 ***
## site1:f4-site2:f1  4.500000e+00  4.500000e+00  4.500000e+00 <2e-16 ***
## site2:f4-site2:f1 -5.000000e-01 -5.000000e-01 -5.000000e-01 <2e-16 ***
## site3:f4-site2:f1 -1.776357e-15 -1.676979e-14  1.321707e-14 0.8135    
## site1:f5-site2:f1 -5.000000e+00 -5.000000e+00 -5.000000e+00 <2e-16 ***
## site2:f5-site2:f1  1.200000e+01  1.200000e+01  1.200000e+01 <2e-16 ***
## site3:f5-site2:f1  1.400000e+01  1.400000e+01  1.400000e+01 <2e-16 ***
## site1:f2-site3:f1 -9.000000e+00 -9.000000e+00 -9.000000e+00 <2e-16 ***
## site2:f2-site3:f1 -3.000000e+00 -3.000000e+00 -3.000000e+00 <2e-16 ***
## site3:f2-site3:f1 -8.500000e+00 -8.500000e+00 -8.500000e+00 <2e-16 ***
## site1:f3-site3:f1 -1.000000e+00 -1.000000e+00 -1.000000e+00 <2e-16 ***
## site2:f3-site3:f1 -1.200000e+01 -1.200000e+01 -1.200000e+01 <2e-16 ***
## site3:f3-site3:f1 -1.000000e+00 -1.000000e+00 -1.000000e+00 <2e-16 ***
## site1:f4-site3:f1 -6.500000e+00 -6.500000e+00 -6.500000e+00 <2e-16 ***
## site2:f4-site3:f1 -1.150000e+01 -1.150000e+01 -1.150000e+01 <2e-16 ***
## site3:f4-site3:f1 -1.100000e+01 -1.100000e+01 -1.100000e+01 <2e-16 ***
## site1:f5-site3:f1 -1.600000e+01 -1.600000e+01 -1.600000e+01 <2e-16 ***
## site2:f5-site3:f1  1.000000e+00  1.000000e+00  1.000000e+00 <2e-16 ***
## site3:f5-site3:f1  3.000000e+00  3.000000e+00  3.000000e+00 <2e-16 ***
## site2:f2-site1:f2  6.000000e+00  6.000000e+00  6.000000e+00 <2e-16 ***
## site3:f2-site1:f2  5.000000e-01  5.000000e-01  5.000000e-01 <2e-16 ***
## site1:f3-site1:f2  8.000000e+00  8.000000e+00  8.000000e+00 <2e-16 ***
## site2:f3-site1:f2 -3.000000e+00 -3.000000e+00 -3.000000e+00 <2e-16 ***
## site3:f3-site1:f2  8.000000e+00  8.000000e+00  8.000000e+00 <2e-16 ***
## site1:f4-site1:f2  2.500000e+00  2.500000e+00  2.500000e+00 <2e-16 ***
## site2:f4-site1:f2 -2.500000e+00 -2.500000e+00 -2.500000e+00 <2e-16 ***
## site3:f4-site1:f2 -2.000000e+00 -2.000000e+00 -2.000000e+00 <2e-16 ***
## site1:f5-site1:f2 -7.000000e+00 -7.000000e+00 -7.000000e+00 <2e-16 ***
## site2:f5-site1:f2  1.000000e+01  1.000000e+01  1.000000e+01 <2e-16 ***
## site3:f5-site1:f2  1.200000e+01  1.200000e+01  1.200000e+01 <2e-16 ***
## site3:f2-site2:f2 -5.500000e+00 -5.500000e+00 -5.500000e+00 <2e-16 ***
## site1:f3-site2:f2  2.000000e+00  2.000000e+00  2.000000e+00 <2e-16 ***
## site2:f3-site2:f2 -9.000000e+00 -9.000000e+00 -9.000000e+00 <2e-16 ***
## site3:f3-site2:f2  2.000000e+00  2.000000e+00  2.000000e+00 <2e-16 ***
## site1:f4-site2:f2 -3.500000e+00 -3.500000e+00 -3.500000e+00 <2e-16 ***
## site2:f4-site2:f2 -8.500000e+00 -8.500000e+00 -8.500000e+00 <2e-16 ***
## site3:f4-site2:f2 -8.000000e+00 -8.000000e+00 -8.000000e+00 <2e-16 ***
## site1:f5-site2:f2 -1.300000e+01 -1.300000e+01 -1.300000e+01 <2e-16 ***
## site2:f5-site2:f2  4.000000e+00  4.000000e+00  4.000000e+00 <2e-16 ***
## site3:f5-site2:f2  6.000000e+00  6.000000e+00  6.000000e+00 <2e-16 ***
## site1:f3-site3:f2  7.500000e+00  7.500000e+00  7.500000e+00 <2e-16 ***
## site2:f3-site3:f2 -3.500000e+00 -3.500000e+00 -3.500000e+00 <2e-16 ***
## site3:f3-site3:f2  7.500000e+00  7.500000e+00  7.500000e+00 <2e-16 ***
## site1:f4-site3:f2  2.000000e+00  2.000000e+00  2.000000e+00 <2e-16 ***
## site2:f4-site3:f2 -3.000000e+00 -3.000000e+00 -3.000000e+00 <2e-16 ***
## site3:f4-site3:f2 -2.500000e+00 -2.500000e+00 -2.500000e+00 <2e-16 ***
## site1:f5-site3:f2 -7.500000e+00 -7.500000e+00 -7.500000e+00 <2e-16 ***
## site2:f5-site3:f2  9.500000e+00  9.500000e+00  9.500000e+00 <2e-16 ***
## site3:f5-site3:f2  1.150000e+01  1.150000e+01  1.150000e+01 <2e-16 ***
## site2:f3-site1:f3 -1.100000e+01 -1.100000e+01 -1.100000e+01 <2e-16 ***
## site3:f3-site1:f3 -3.552714e-15 -1.854614e-14  1.144072e-14 0.6372    
## site1:f4-site1:f3 -5.500000e+00 -5.500000e+00 -5.500000e+00 <2e-16 ***
## site2:f4-site1:f3 -1.050000e+01 -1.050000e+01 -1.050000e+01 <2e-16 ***
## site3:f4-site1:f3 -1.000000e+01 -1.000000e+01 -1.000000e+01 <2e-16 ***
## site1:f5-site1:f3 -1.500000e+01 -1.500000e+01 -1.500000e+01 <2e-16 ***
## site2:f5-site1:f3  2.000000e+00  2.000000e+00  2.000000e+00 <2e-16 ***
## site3:f5-site1:f3  4.000000e+00  4.000000e+00  4.000000e+00 <2e-16 ***
## site3:f3-site2:f3  1.100000e+01  1.100000e+01  1.100000e+01 <2e-16 ***
## site1:f4-site2:f3  5.500000e+00  5.500000e+00  5.500000e+00 <2e-16 ***
## site2:f4-site2:f3  5.000000e-01  5.000000e-01  5.000000e-01 <2e-16 ***
## site3:f4-site2:f3  1.000000e+00  1.000000e+00  1.000000e+00 <2e-16 ***
## site1:f5-site2:f3 -4.000000e+00 -4.000000e+00 -4.000000e+00 <2e-16 ***
## site2:f5-site2:f3  1.300000e+01  1.300000e+01  1.300000e+01 <2e-16 ***
## site3:f5-site2:f3  1.500000e+01  1.500000e+01  1.500000e+01 <2e-16 ***
## site1:f4-site3:f3 -5.500000e+00 -5.500000e+00 -5.500000e+00 <2e-16 ***
## site2:f4-site3:f3 -1.050000e+01 -1.050000e+01 -1.050000e+01 <2e-16 ***
## site3:f4-site3:f3 -1.000000e+01 -1.000000e+01 -1.000000e+01 <2e-16 ***
## site1:f5-site3:f3 -1.500000e+01 -1.500000e+01 -1.500000e+01 <2e-16 ***
## site2:f5-site3:f3  2.000000e+00  2.000000e+00  2.000000e+00 <2e-16 ***
## site3:f5-site3:f3  4.000000e+00  4.000000e+00  4.000000e+00 <2e-16 ***
## site2:f4-site1:f4 -5.000000e+00 -5.000000e+00 -5.000000e+00 <2e-16 ***
## site3:f4-site1:f4 -4.500000e+00 -4.500000e+00 -4.500000e+00 <2e-16 ***
## site1:f5-site1:f4 -9.500000e+00 -9.500000e+00 -9.500000e+00 <2e-16 ***
## site2:f5-site1:f4  7.500000e+00  7.500000e+00  7.500000e+00 <2e-16 ***
## site3:f5-site1:f4  9.500000e+00  9.500000e+00  9.500000e+00 <2e-16 ***
## site3:f4-site2:f4  5.000000e-01  5.000000e-01  5.000000e-01 <2e-16 ***
## site1:f5-site2:f4 -4.500000e+00 -4.500000e+00 -4.500000e+00 <2e-16 ***
## site2:f5-site2:f4  1.250000e+01  1.250000e+01  1.250000e+01 <2e-16 ***
## site3:f5-site2:f4  1.450000e+01  1.450000e+01  1.450000e+01 <2e-16 ***
## site1:f5-site3:f4 -5.000000e+00 -5.000000e+00 -5.000000e+00 <2e-16 ***
## site2:f5-site3:f4  1.200000e+01  1.200000e+01  1.200000e+01 <2e-16 ***
## site3:f5-site3:f4  1.400000e+01  1.400000e+01  1.400000e+01 <2e-16 ***
## site2:f5-site1:f5  1.700000e+01  1.700000e+01  1.700000e+01 <2e-16 ***
## site3:f5-site1:f5  1.900000e+01  1.900000e+01  1.900000e+01 <2e-16 ***
## site3:f5-site2:f5  2.000000e+00  2.000000e+00  2.000000e+00 <2e-16 ***
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Scheffe test
PostHocTest(aov_dbh, method = "scheffe")
## 
##   Posthoc multiple comparisons of means: Scheffe Test 
##     95% family-wise confidence level
## 
## $site
##             diff lwr.ci upr.ci   pval    
## site2-site1  0.6    0.6    0.6 <2e-16 ***
## site3-site1  4.4    4.4    4.4 <2e-16 ***
## site3-site2  3.8    3.8    3.8 <2e-16 ***
## 
## $families
##             diff     lwr.ci     upr.ci   pval    
## f2-f1 -0.8333333 -0.8333333 -0.8333333 <2e-16 ***
## f3-f1  1.3333333  1.3333333  1.3333333 <2e-16 ***
## f4-f1 -3.6666667 -3.6666667 -3.6666667 <2e-16 ***
## f5-f1  2.0000000  2.0000000  2.0000000 <2e-16 ***
## f3-f2  2.1666667  2.1666667  2.1666667 <2e-16 ***
## f4-f2 -2.8333333 -2.8333333 -2.8333333 <2e-16 ***
## f5-f2  2.8333333  2.8333333  2.8333333 <2e-16 ***
## f4-f3 -5.0000000 -5.0000000 -5.0000000 <2e-16 ***
## f5-f3  0.6666667  0.6666667  0.6666667 <2e-16 ***
## f5-f4  5.6666667  5.6666667  5.6666667 <2e-16 ***
## 
## $`site:families`
##                            diff        lwr.ci        upr.ci   pval    
## site2:f1-site1:f1 -4.000000e+00 -4.000000e+00 -4.000000e+00 <2e-16 ***
## site3:f1-site1:f1  7.000000e+00  7.000000e+00  7.000000e+00 <2e-16 ***
## site1:f2-site1:f1 -2.000000e+00 -2.000000e+00 -2.000000e+00 <2e-16 ***
## site2:f2-site1:f1  4.000000e+00  4.000000e+00  4.000000e+00 <2e-16 ***
## site3:f2-site1:f1 -1.500000e+00 -1.500000e+00 -1.500000e+00 <2e-16 ***
## site1:f3-site1:f1  6.000000e+00  6.000000e+00  6.000000e+00 <2e-16 ***
## site2:f3-site1:f1 -5.000000e+00 -5.000000e+00 -5.000000e+00 <2e-16 ***
## site3:f3-site1:f1  6.000000e+00  6.000000e+00  6.000000e+00 <2e-16 ***
## site1:f4-site1:f1  5.000000e-01  5.000000e-01  5.000000e-01 <2e-16 ***
## site2:f4-site1:f1 -4.500000e+00 -4.500000e+00 -4.500000e+00 <2e-16 ***
## site3:f4-site1:f1 -4.000000e+00 -4.000000e+00 -4.000000e+00 <2e-16 ***
## site1:f5-site1:f1 -9.000000e+00 -9.000000e+00 -9.000000e+00 <2e-16 ***
## site2:f5-site1:f1  8.000000e+00  8.000000e+00  8.000000e+00 <2e-16 ***
## site3:f5-site1:f1  1.000000e+01  1.000000e+01  1.000000e+01 <2e-16 ***
## site3:f1-site2:f1  1.100000e+01  1.100000e+01  1.100000e+01 <2e-16 ***
## site1:f2-site2:f1  2.000000e+00  2.000000e+00  2.000000e+00 <2e-16 ***
## site2:f2-site2:f1  8.000000e+00  8.000000e+00  8.000000e+00 <2e-16 ***
## site3:f2-site2:f1  2.500000e+00  2.500000e+00  2.500000e+00 <2e-16 ***
## site1:f3-site2:f1  1.000000e+01  1.000000e+01  1.000000e+01 <2e-16 ***
## site2:f3-site2:f1 -1.000000e+00 -1.000000e+00 -1.000000e+00 <2e-16 ***
## site3:f3-site2:f1  1.000000e+01  1.000000e+01  1.000000e+01 <2e-16 ***
## site1:f4-site2:f1  4.500000e+00  4.500000e+00  4.500000e+00 <2e-16 ***
## site2:f4-site2:f1 -5.000000e-01 -5.000000e-01 -5.000000e-01 <2e-16 ***
## site3:f4-site2:f1 -1.776357e-15 -4.002844e-14  3.647573e-14 1.0000    
## site1:f5-site2:f1 -5.000000e+00 -5.000000e+00 -5.000000e+00 <2e-16 ***
## site2:f5-site2:f1  1.200000e+01  1.200000e+01  1.200000e+01 <2e-16 ***
## site3:f5-site2:f1  1.400000e+01  1.400000e+01  1.400000e+01 <2e-16 ***
## site1:f2-site3:f1 -9.000000e+00 -9.000000e+00 -9.000000e+00 <2e-16 ***
## site2:f2-site3:f1 -3.000000e+00 -3.000000e+00 -3.000000e+00 <2e-16 ***
## site3:f2-site3:f1 -8.500000e+00 -8.500000e+00 -8.500000e+00 <2e-16 ***
## site1:f3-site3:f1 -1.000000e+00 -1.000000e+00 -1.000000e+00 <2e-16 ***
## site2:f3-site3:f1 -1.200000e+01 -1.200000e+01 -1.200000e+01 <2e-16 ***
## site3:f3-site3:f1 -1.000000e+00 -1.000000e+00 -1.000000e+00 <2e-16 ***
## site1:f4-site3:f1 -6.500000e+00 -6.500000e+00 -6.500000e+00 <2e-16 ***
## site2:f4-site3:f1 -1.150000e+01 -1.150000e+01 -1.150000e+01 <2e-16 ***
## site3:f4-site3:f1 -1.100000e+01 -1.100000e+01 -1.100000e+01 <2e-16 ***
## site1:f5-site3:f1 -1.600000e+01 -1.600000e+01 -1.600000e+01 <2e-16 ***
## site2:f5-site3:f1  1.000000e+00  1.000000e+00  1.000000e+00 <2e-16 ***
## site3:f5-site3:f1  3.000000e+00  3.000000e+00  3.000000e+00 <2e-16 ***
## site2:f2-site1:f2  6.000000e+00  6.000000e+00  6.000000e+00 <2e-16 ***
## site3:f2-site1:f2  5.000000e-01  5.000000e-01  5.000000e-01 <2e-16 ***
## site1:f3-site1:f2  8.000000e+00  8.000000e+00  8.000000e+00 <2e-16 ***
## site2:f3-site1:f2 -3.000000e+00 -3.000000e+00 -3.000000e+00 <2e-16 ***
## site3:f3-site1:f2  8.000000e+00  8.000000e+00  8.000000e+00 <2e-16 ***
## site1:f4-site1:f2  2.500000e+00  2.500000e+00  2.500000e+00 <2e-16 ***
## site2:f4-site1:f2 -2.500000e+00 -2.500000e+00 -2.500000e+00 <2e-16 ***
## site3:f4-site1:f2 -2.000000e+00 -2.000000e+00 -2.000000e+00 <2e-16 ***
## site1:f5-site1:f2 -7.000000e+00 -7.000000e+00 -7.000000e+00 <2e-16 ***
## site2:f5-site1:f2  1.000000e+01  1.000000e+01  1.000000e+01 <2e-16 ***
## site3:f5-site1:f2  1.200000e+01  1.200000e+01  1.200000e+01 <2e-16 ***
## site3:f2-site2:f2 -5.500000e+00 -5.500000e+00 -5.500000e+00 <2e-16 ***
## site1:f3-site2:f2  2.000000e+00  2.000000e+00  2.000000e+00 <2e-16 ***
## site2:f3-site2:f2 -9.000000e+00 -9.000000e+00 -9.000000e+00 <2e-16 ***
## site3:f3-site2:f2  2.000000e+00  2.000000e+00  2.000000e+00 <2e-16 ***
## site1:f4-site2:f2 -3.500000e+00 -3.500000e+00 -3.500000e+00 <2e-16 ***
## site2:f4-site2:f2 -8.500000e+00 -8.500000e+00 -8.500000e+00 <2e-16 ***
## site3:f4-site2:f2 -8.000000e+00 -8.000000e+00 -8.000000e+00 <2e-16 ***
## site1:f5-site2:f2 -1.300000e+01 -1.300000e+01 -1.300000e+01 <2e-16 ***
## site2:f5-site2:f2  4.000000e+00  4.000000e+00  4.000000e+00 <2e-16 ***
## site3:f5-site2:f2  6.000000e+00  6.000000e+00  6.000000e+00 <2e-16 ***
## site1:f3-site3:f2  7.500000e+00  7.500000e+00  7.500000e+00 <2e-16 ***
## site2:f3-site3:f2 -3.500000e+00 -3.500000e+00 -3.500000e+00 <2e-16 ***
## site3:f3-site3:f2  7.500000e+00  7.500000e+00  7.500000e+00 <2e-16 ***
## site1:f4-site3:f2  2.000000e+00  2.000000e+00  2.000000e+00 <2e-16 ***
## site2:f4-site3:f2 -3.000000e+00 -3.000000e+00 -3.000000e+00 <2e-16 ***
## site3:f4-site3:f2 -2.500000e+00 -2.500000e+00 -2.500000e+00 <2e-16 ***
## site1:f5-site3:f2 -7.500000e+00 -7.500000e+00 -7.500000e+00 <2e-16 ***
## site2:f5-site3:f2  9.500000e+00  9.500000e+00  9.500000e+00 <2e-16 ***
## site3:f5-site3:f2  1.150000e+01  1.150000e+01  1.150000e+01 <2e-16 ***
## site2:f3-site1:f3 -1.100000e+01 -1.100000e+01 -1.100000e+01 <2e-16 ***
## site3:f3-site1:f3 -3.552714e-15 -4.180480e-14  3.469937e-14 1.0000    
## site1:f4-site1:f3 -5.500000e+00 -5.500000e+00 -5.500000e+00 <2e-16 ***
## site2:f4-site1:f3 -1.050000e+01 -1.050000e+01 -1.050000e+01 <2e-16 ***
## site3:f4-site1:f3 -1.000000e+01 -1.000000e+01 -1.000000e+01 <2e-16 ***
## site1:f5-site1:f3 -1.500000e+01 -1.500000e+01 -1.500000e+01 <2e-16 ***
## site2:f5-site1:f3  2.000000e+00  2.000000e+00  2.000000e+00 <2e-16 ***
## site3:f5-site1:f3  4.000000e+00  4.000000e+00  4.000000e+00 <2e-16 ***
## site3:f3-site2:f3  1.100000e+01  1.100000e+01  1.100000e+01 <2e-16 ***
## site1:f4-site2:f3  5.500000e+00  5.500000e+00  5.500000e+00 <2e-16 ***
## site2:f4-site2:f3  5.000000e-01  5.000000e-01  5.000000e-01 <2e-16 ***
## site3:f4-site2:f3  1.000000e+00  1.000000e+00  1.000000e+00 <2e-16 ***
## site1:f5-site2:f3 -4.000000e+00 -4.000000e+00 -4.000000e+00 <2e-16 ***
## site2:f5-site2:f3  1.300000e+01  1.300000e+01  1.300000e+01 <2e-16 ***
## site3:f5-site2:f3  1.500000e+01  1.500000e+01  1.500000e+01 <2e-16 ***
## site1:f4-site3:f3 -5.500000e+00 -5.500000e+00 -5.500000e+00 <2e-16 ***
## site2:f4-site3:f3 -1.050000e+01 -1.050000e+01 -1.050000e+01 <2e-16 ***
## site3:f4-site3:f3 -1.000000e+01 -1.000000e+01 -1.000000e+01 <2e-16 ***
## site1:f5-site3:f3 -1.500000e+01 -1.500000e+01 -1.500000e+01 <2e-16 ***
## site2:f5-site3:f3  2.000000e+00  2.000000e+00  2.000000e+00 <2e-16 ***
## site3:f5-site3:f3  4.000000e+00  4.000000e+00  4.000000e+00 <2e-16 ***
## site2:f4-site1:f4 -5.000000e+00 -5.000000e+00 -5.000000e+00 <2e-16 ***
## site3:f4-site1:f4 -4.500000e+00 -4.500000e+00 -4.500000e+00 <2e-16 ***
## site1:f5-site1:f4 -9.500000e+00 -9.500000e+00 -9.500000e+00 <2e-16 ***
## site2:f5-site1:f4  7.500000e+00  7.500000e+00  7.500000e+00 <2e-16 ***
## site3:f5-site1:f4  9.500000e+00  9.500000e+00  9.500000e+00 <2e-16 ***
## site3:f4-site2:f4  5.000000e-01  5.000000e-01  5.000000e-01 <2e-16 ***
## site1:f5-site2:f4 -4.500000e+00 -4.500000e+00 -4.500000e+00 <2e-16 ***
## site2:f5-site2:f4  1.250000e+01  1.250000e+01  1.250000e+01 <2e-16 ***
## site3:f5-site2:f4  1.450000e+01  1.450000e+01  1.450000e+01 <2e-16 ***
## site1:f5-site3:f4 -5.000000e+00 -5.000000e+00 -5.000000e+00 <2e-16 ***
## site2:f5-site3:f4  1.200000e+01  1.200000e+01  1.200000e+01 <2e-16 ***
## site3:f5-site3:f4  1.400000e+01  1.400000e+01  1.400000e+01 <2e-16 ***
## site2:f5-site1:f5  1.700000e+01  1.700000e+01  1.700000e+01 <2e-16 ***
## site3:f5-site1:f5  1.900000e+01  1.900000e+01  1.900000e+01 <2e-16 ***
## site3:f5-site2:f5  2.000000e+00  2.000000e+00  2.000000e+00 <2e-16 ***
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Newman-Keuls test
PostHocTest(aov_dbh, method = "newmankeuls")
## 
##   Posthoc multiple comparisons of means : Newman-Keuls 
##     95% family-wise confidence level
## 
## $site
##             diff lwr.ci upr.ci  pval    
## site2-site1  0.6    0.6    0.6 2e-11 ***
## site3-site1  4.4    4.4    4.4 2e-11 ***
## site3-site2  3.8    3.8    3.8 2e-11 ***
## 
## $families
##             diff     lwr.ci     upr.ci  pval    
## f2-f1 -0.8333333 -0.8333333 -0.8333333 2e-11 ***
## f3-f1  1.3333333  1.3333333  1.3333333 2e-11 ***
## f4-f1 -3.6666667 -3.6666667 -3.6666667 2e-11 ***
## f5-f1  2.0000000  2.0000000  2.0000000 2e-11 ***
## f3-f2  2.1666667  2.1666667  2.1666667 2e-11 ***
## f4-f2 -2.8333333 -2.8333333 -2.8333333 2e-11 ***
## f5-f2  2.8333333  2.8333333  2.8333333 2e-11 ***
## f4-f3 -5.0000000 -5.0000000 -5.0000000 2e-11 ***
## f5-f3  0.6666667  0.6666667  0.6666667 2e-11 ***
## f5-f4  5.6666667  5.6666667  5.6666667 2e-11 ***
## 
## $`site:families`
##                            diff        lwr.ci        upr.ci   pval    
## site2:f1-site1:f1 -4.000000e+00 -4.000000e+00 -4.000000e+00  2e-11 ***
## site3:f1-site1:f1  7.000000e+00  7.000000e+00  7.000000e+00  2e-11 ***
## site1:f2-site1:f1 -2.000000e+00 -2.000000e+00 -2.000000e+00  2e-11 ***
## site2:f2-site1:f1  4.000000e+00  4.000000e+00  4.000000e+00  2e-11 ***
## site3:f2-site1:f1 -1.500000e+00 -1.500000e+00 -1.500000e+00  2e-11 ***
## site1:f3-site1:f1  6.000000e+00  6.000000e+00  6.000000e+00  2e-11 ***
## site2:f3-site1:f1 -5.000000e+00 -5.000000e+00 -5.000000e+00  2e-11 ***
## site3:f3-site1:f1  6.000000e+00  6.000000e+00  6.000000e+00  2e-11 ***
## site1:f4-site1:f1  5.000000e-01  5.000000e-01  5.000000e-01  2e-11 ***
## site2:f4-site1:f1 -4.500000e+00 -4.500000e+00 -4.500000e+00  2e-11 ***
## site3:f4-site1:f1 -4.000000e+00 -4.000000e+00 -4.000000e+00  2e-11 ***
## site1:f5-site1:f1 -9.000000e+00 -9.000000e+00 -9.000000e+00  2e-11 ***
## site2:f5-site1:f1  8.000000e+00  8.000000e+00  8.000000e+00  2e-11 ***
## site3:f5-site1:f1  1.000000e+01  1.000000e+01  1.000000e+01  2e-11 ***
## site3:f1-site2:f1  1.100000e+01  1.100000e+01  1.100000e+01  2e-11 ***
## site1:f2-site2:f1  2.000000e+00  2.000000e+00  2.000000e+00  2e-11 ***
## site2:f2-site2:f1  8.000000e+00  8.000000e+00  8.000000e+00  2e-11 ***
## site3:f2-site2:f1  2.500000e+00  2.500000e+00  2.500000e+00  2e-11 ***
## site1:f3-site2:f1  1.000000e+01  1.000000e+01  1.000000e+01  2e-11 ***
## site2:f3-site2:f1 -1.000000e+00 -1.000000e+00 -1.000000e+00  2e-11 ***
## site3:f3-site2:f1  1.000000e+01  1.000000e+01  1.000000e+01  2e-11 ***
## site1:f4-site2:f1  4.500000e+00  4.500000e+00  4.500000e+00  2e-11 ***
## site2:f4-site2:f1 -5.000000e-01 -5.000000e-01 -5.000000e-01  2e-11 ***
## site3:f4-site2:f1 -1.776357e-15 -1.676979e-14  1.321707e-14 0.8135    
## site1:f5-site2:f1 -5.000000e+00 -5.000000e+00 -5.000000e+00  2e-11 ***
## site2:f5-site2:f1  1.200000e+01  1.200000e+01  1.200000e+01  2e-11 ***
## site3:f5-site2:f1  1.400000e+01  1.400000e+01  1.400000e+01  2e-11 ***
## site1:f2-site3:f1 -9.000000e+00 -9.000000e+00 -9.000000e+00  2e-11 ***
## site2:f2-site3:f1 -3.000000e+00 -3.000000e+00 -3.000000e+00  2e-11 ***
## site3:f2-site3:f1 -8.500000e+00 -8.500000e+00 -8.500000e+00  2e-11 ***
## site1:f3-site3:f1 -1.000000e+00 -1.000000e+00 -1.000000e+00  2e-11 ***
## site2:f3-site3:f1 -1.200000e+01 -1.200000e+01 -1.200000e+01  2e-11 ***
## site3:f3-site3:f1 -1.000000e+00 -1.000000e+00 -1.000000e+00  2e-11 ***
## site1:f4-site3:f1 -6.500000e+00 -6.500000e+00 -6.500000e+00  2e-11 ***
## site2:f4-site3:f1 -1.150000e+01 -1.150000e+01 -1.150000e+01  2e-11 ***
## site3:f4-site3:f1 -1.100000e+01 -1.100000e+01 -1.100000e+01  2e-11 ***
## site1:f5-site3:f1 -1.600000e+01 -1.600000e+01 -1.600000e+01  2e-11 ***
## site2:f5-site3:f1  1.000000e+00  1.000000e+00  1.000000e+00  2e-11 ***
## site3:f5-site3:f1  3.000000e+00  3.000000e+00  3.000000e+00  2e-11 ***
## site2:f2-site1:f2  6.000000e+00  6.000000e+00  6.000000e+00  2e-11 ***
## site3:f2-site1:f2  5.000000e-01  5.000000e-01  5.000000e-01  2e-11 ***
## site1:f3-site1:f2  8.000000e+00  8.000000e+00  8.000000e+00  2e-11 ***
## site2:f3-site1:f2 -3.000000e+00 -3.000000e+00 -3.000000e+00  2e-11 ***
## site3:f3-site1:f2  8.000000e+00  8.000000e+00  8.000000e+00  2e-11 ***
## site1:f4-site1:f2  2.500000e+00  2.500000e+00  2.500000e+00  2e-11 ***
## site2:f4-site1:f2 -2.500000e+00 -2.500000e+00 -2.500000e+00  2e-11 ***
## site3:f4-site1:f2 -2.000000e+00 -2.000000e+00 -2.000000e+00  2e-11 ***
## site1:f5-site1:f2 -7.000000e+00 -7.000000e+00 -7.000000e+00  2e-11 ***
## site2:f5-site1:f2  1.000000e+01  1.000000e+01  1.000000e+01  2e-11 ***
## site3:f5-site1:f2  1.200000e+01  1.200000e+01  1.200000e+01  2e-11 ***
## site3:f2-site2:f2 -5.500000e+00 -5.500000e+00 -5.500000e+00  2e-11 ***
## site1:f3-site2:f2  2.000000e+00  2.000000e+00  2.000000e+00  2e-11 ***
## site2:f3-site2:f2 -9.000000e+00 -9.000000e+00 -9.000000e+00  2e-11 ***
## site3:f3-site2:f2  2.000000e+00  2.000000e+00  2.000000e+00  2e-11 ***
## site1:f4-site2:f2 -3.500000e+00 -3.500000e+00 -3.500000e+00  2e-11 ***
## site2:f4-site2:f2 -8.500000e+00 -8.500000e+00 -8.500000e+00  2e-11 ***
## site3:f4-site2:f2 -8.000000e+00 -8.000000e+00 -8.000000e+00  2e-11 ***
## site1:f5-site2:f2 -1.300000e+01 -1.300000e+01 -1.300000e+01  2e-11 ***
## site2:f5-site2:f2  4.000000e+00  4.000000e+00  4.000000e+00  2e-11 ***
## site3:f5-site2:f2  6.000000e+00  6.000000e+00  6.000000e+00  2e-11 ***
## site1:f3-site3:f2  7.500000e+00  7.500000e+00  7.500000e+00  2e-11 ***
## site2:f3-site3:f2 -3.500000e+00 -3.500000e+00 -3.500000e+00  2e-11 ***
## site3:f3-site3:f2  7.500000e+00  7.500000e+00  7.500000e+00  2e-11 ***
## site1:f4-site3:f2  2.000000e+00  2.000000e+00  2.000000e+00  2e-11 ***
## site2:f4-site3:f2 -3.000000e+00 -3.000000e+00 -3.000000e+00  2e-11 ***
## site3:f4-site3:f2 -2.500000e+00 -2.500000e+00 -2.500000e+00  2e-11 ***
## site1:f5-site3:f2 -7.500000e+00 -7.500000e+00 -7.500000e+00  2e-11 ***
## site2:f5-site3:f2  9.500000e+00  9.500000e+00  9.500000e+00  2e-11 ***
## site3:f5-site3:f2  1.150000e+01  1.150000e+01  1.150000e+01  2e-11 ***
## site2:f3-site1:f3 -1.100000e+01 -1.100000e+01 -1.100000e+01  2e-11 ***
## site3:f3-site1:f3 -3.552714e-15 -1.854614e-14  1.144072e-14 0.6372    
## site1:f4-site1:f3 -5.500000e+00 -5.500000e+00 -5.500000e+00  2e-11 ***
## site2:f4-site1:f3 -1.050000e+01 -1.050000e+01 -1.050000e+01  2e-11 ***
## site3:f4-site1:f3 -1.000000e+01 -1.000000e+01 -1.000000e+01  2e-11 ***
## site1:f5-site1:f3 -1.500000e+01 -1.500000e+01 -1.500000e+01  2e-11 ***
## site2:f5-site1:f3  2.000000e+00  2.000000e+00  2.000000e+00  2e-11 ***
## site3:f5-site1:f3  4.000000e+00  4.000000e+00  4.000000e+00  2e-11 ***
## site3:f3-site2:f3  1.100000e+01  1.100000e+01  1.100000e+01  2e-11 ***
## site1:f4-site2:f3  5.500000e+00  5.500000e+00  5.500000e+00  2e-11 ***
## site2:f4-site2:f3  5.000000e-01  5.000000e-01  5.000000e-01  2e-11 ***
## site3:f4-site2:f3  1.000000e+00  1.000000e+00  1.000000e+00  2e-11 ***
## site1:f5-site2:f3 -4.000000e+00 -4.000000e+00 -4.000000e+00  2e-11 ***
## site2:f5-site2:f3  1.300000e+01  1.300000e+01  1.300000e+01  2e-11 ***
## site3:f5-site2:f3  1.500000e+01  1.500000e+01  1.500000e+01  2e-11 ***
## site1:f4-site3:f3 -5.500000e+00 -5.500000e+00 -5.500000e+00  2e-11 ***
## site2:f4-site3:f3 -1.050000e+01 -1.050000e+01 -1.050000e+01  2e-11 ***
## site3:f4-site3:f3 -1.000000e+01 -1.000000e+01 -1.000000e+01  2e-11 ***
## site1:f5-site3:f3 -1.500000e+01 -1.500000e+01 -1.500000e+01  2e-11 ***
## site2:f5-site3:f3  2.000000e+00  2.000000e+00  2.000000e+00  2e-11 ***
## site3:f5-site3:f3  4.000000e+00  4.000000e+00  4.000000e+00  2e-11 ***
## site2:f4-site1:f4 -5.000000e+00 -5.000000e+00 -5.000000e+00  2e-11 ***
## site3:f4-site1:f4 -4.500000e+00 -4.500000e+00 -4.500000e+00  2e-11 ***
## site1:f5-site1:f4 -9.500000e+00 -9.500000e+00 -9.500000e+00  2e-11 ***
## site2:f5-site1:f4  7.500000e+00  7.500000e+00  7.500000e+00  2e-11 ***
## site3:f5-site1:f4  9.500000e+00  9.500000e+00  9.500000e+00  2e-11 ***
## site3:f4-site2:f4  5.000000e-01  5.000000e-01  5.000000e-01  2e-11 ***
## site1:f5-site2:f4 -4.500000e+00 -4.500000e+00 -4.500000e+00  2e-11 ***
## site2:f5-site2:f4  1.250000e+01  1.250000e+01  1.250000e+01  2e-11 ***
## site3:f5-site2:f4  1.450000e+01  1.450000e+01  1.450000e+01  2e-11 ***
## site1:f5-site3:f4 -5.000000e+00 -5.000000e+00 -5.000000e+00  2e-11 ***
## site2:f5-site3:f4  1.200000e+01  1.200000e+01  1.200000e+01  2e-11 ***
## site3:f5-site3:f4  1.400000e+01  1.400000e+01  1.400000e+01  2e-11 ***
## site2:f5-site1:f5  1.700000e+01  1.700000e+01  1.700000e+01  2e-11 ***
## site3:f5-site1:f5  1.900000e+01  1.900000e+01  1.900000e+01  2e-11 ***
## site3:f5-site2:f5  2.000000e+00  2.000000e+00  2.000000e+00  2e-11 ***
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

我们可以用ggplot将多重比较的结果作图,这里我们用Tukey test为例:

require(DescTools)
hsd <- PostHocTest(aov_dbh, method = "hsd")

fam_hsd = data.frame(hsd$families)
fam_hsd$Comparison = row.names(fam_hsd)
library(ggplot2)
ggplot(fam_hsd, aes(Comparison, y = diff, ymin = lwr.ci, ymax = upr.ci)) +
  geom_pointrange() + ylab("Difference in Mean Delivery Time by families") +
  coord_flip()
Tukey test 多重比较作图

图5.1: Tukey test 多重比较作图

5.3 多因素方差分析

多因子方差分析,与双因子方差分析类似,比如我们还想增加一下种源对dbh的影响,这里我们增加一个种源的因子其在R中的结构可以是如下:

library(tidyverse)

growth2 <- growth %>% mutate(souce = rep(c('sou1', 'sou2','sou3','sou4','sou5'),each = 3,len=75)  )
growth2$souce <- as.factor(growth2$souce)
head(growth2) # 查看前6列数据
##    site families dbh height zhi_height souce
## 1 site1       f1  19   28.8       13.1  sou1
## 2 site1       f1  19   16.8       12.1  sou1
## 3 site1       f1  19   24.8       13.1  sou1
## 4 site1       f1  19   19.8       14.1  sou2
## 5 site1       f1  19   13.8       14.1  sou2
## 6 site1       f2  17   10.8       11.1  sou2
tail(growth2) # 查看后6列数据
##     site families dbh height zhi_height souce
## 70 site3       f4  15   19.8       12.1  sou4
## 71 site3       f5  29   11.8       15.1  sou4
## 72 site3       f5  29   10.8       12.1  sou4
## 73 site3       f5  29   17.8       10.1  sou5
## 74 site3       f5  29   22.8       11.1  sou5
## 75 site3       f5  29   26.8       10.1  sou5
str(growth2) # 查看数据集形式
## 'data.frame':    75 obs. of  6 variables:
##  $ site      : chr  "site1" "site1" "site1" "site1" ...
##  $ families  : chr  "f1" "f1" "f1" "f1" ...
##  $ dbh       : num  19 19 19 19 19 17 17 17 17 17 ...
##  $ height    : num  28.8 16.8 24.8 19.8 13.8 10.8 23.8 27.8 28.8 10.8 ...
##  $ zhi_height: num  13.1 12.1 13.1 14.1 14.1 11.1 13.1 12.1 14.1 13.1 ...
##  $ souce     : Factor w/ 5 levels "sou1","sou2",..: 1 1 1 2 2 2 3 3 3 4 ...