典范对应分析(canonical correspondence analusis, CCA),是基于对应分析(CA)发展而来的一种排序方法,将对应分析与多元回归分析相结合,每一步计算均与环境因子进行回归,又称多元直接梯度分析。其基本思路是在对应分析的迭代过程中,每次得到的样方排序坐标值均与环境因子进行多元线性回归。CCA要求两个数据矩阵,一个是物种数据矩阵,一个是环境数据矩阵。 首先计算出一组样方排序值和种类排序值(同对应分析),然后将样方排序值与环境因子用回归分析方法结合起来,这样得到的样方排序值即反映了样方种类组成及生态重要值对群落的作用,同时也反映了环境因子的影响,再用样方排序值加权平均求种类排序值,使种类排序坐标值值也简介地与环境因子相联系。其算法可由Canoco软件快速实现。
最大优点:CCA是一种基于单峰模型的排序方法,样方排序与对象排序对应分析,而且在排序过程中结合多个环境因子,因此可以把样方、对象与环境因子的排序结果表示在同一排序图上。
缺点:存在“弓形效应”。克服弓形效应可以采用除趋势典范对应分析(detrended canonical correspondence, DCCA).稀有物种对排序的影响很大,做CCA是有必要剔除稀有物种。
结果可信性:查看累计贡献率及环境与研究对象前两个排序轴之间的相关性。
# 载入所需程序包
library(ade4)
library(vegan)
#library(packfor)
rm(list = ls())
setwd("D:\\Users\\Administrator\\Desktop\\RStudio\\数量生态学\\DATA")
# 此程序包可以从 https://r-forge.r-project.org/R/?group_id=195 下载
# 如果是MacOS X系统,packfor程序包内forward.sel函数的运行需要加载
# gfortran程序包。用户必须从"cran.r-project.org"网站内选择"MacOS X",
# 然后选择"tools"安装gfortran程序包。
library(MASS)
library(ellipse)
library(FactoMineR)
# 附加函数
source("evplot.R")
source("hcoplot.R")
# 导入CSV数据文件
spe <- read.csv("DoubsSpe.csv", row.names=1)
env <- read.csv("DoubsEnv.csv", row.names=1)
spa <- read.csv("DoubsSpa.csv", row.names=1)
# 删除没有数据的样方8
spe <- spe[-8, ]
env <- env[-8, ]
spa <- spa[-8, ]
# 提取环境变量das(离源头距离)以备用
das <- env[, 1]
# 从环境变量矩阵剔除das变量
env <- env[, -1]
# 将slope变量(pen)转化为因子(定性)变量
pen2 <- rep("very_steep", nrow(env))
pen2[env$pen <= quantile(env$pen)[4]] = "steep"
pen2[env$pen <= quantile(env$pen)[3]] = "moderate"
pen2[env$pen <= quantile(env$pen)[2]] = "low"
pen2 <- factor(pen2, levels=c("low", "moderate", "steep", "very_steep"))
table(pen2)
# 生成一个含定性坡度变量的环境变量数据框env2
env2 <- env
env2$pen <- pen2
# 将所有解释变量分为两个解释变量子集
# 地形变量(上下游梯度)子集
envtopo <- env[, c(1:3)]
names(envtopo)
#水体化学属性变量子集
envchem <- env[, c(4:10)]
names(envchem)
# 物种数据Hellinger转化
spe.hel <- decostand(spe, "hellinger")
> # 典范对应分析(CCA)
> # *******************
> # 原始鱼类数据的CCA分析,解释变量为env2中所有环境变量
> spe.cca <- cca(spe ~ ., env2)
> spe.cca
Call: cca(formula = spe ~ alt + pen + deb + pH + dur + pho + nit + amm + oxy + dbo, data = env2)
Inertia Proportion Rank
Total 1.1669 1.0000
Constrained 0.8456 0.7246 12
Unconstrained 0.3214 0.2754 16
Inertia is scaled Chi-square
Eigenvalues for constrained axes:
CCA1 CCA2 CCA3 CCA4 CCA5 CCA6 CCA7 CCA8 CCA9 CCA10 CCA11 CCA12
0.5252 0.1282 0.0699 0.0437 0.0315 0.0140 0.0117 0.0085 0.0055 0.0032 0.0027 0.0015
Eigenvalues for unconstrained axes:
CA1 CA2 CA3 CA4 CA5 CA6 CA7 CA8 CA9 CA10 CA11 CA12 CA13 CA14 CA15 CA16
0.11014 0.06092 0.03997 0.03193 0.01844 0.01643 0.01210 0.00796 0.00735 0.00435 0.00370 0.00326 0.00207 0.00161 0.00073 0.00038
> summary(spe.cca) #2型标尺(默认)
Call:
cca(formula = spe ~ alt + pen + deb + pH + dur + pho + nit + amm + oxy + dbo, data = env2)
Partitioning of scaled Chi-square:
Inertia Proportion
Total 1.1669 1.0000
Constrained 0.8456 0.7246
Unconstrained 0.3214 0.2754
Eigenvalues, and their contribution to the scaled Chi-square
Importance of components:
CCA1 CCA2 CCA3 CCA4 CCA5 CCA6 CCA7 CCA8 CCA9 CCA10 CCA11 CCA12 CA1
Eigenvalue 0.5252 0.1282 0.06987 0.04368 0.03151 0.01399 0.01167 0.008508 0.005541 0.003231 0.002714 0.001479 0.11014
Proportion Explained 0.4501 0.1098 0.05988 0.03743 0.02700 0.01199 0.01000 0.007291 0.004749 0.002769 0.002326 0.001268 0.09438
Cumulative Proportion 0.4501 0.5599 0.61978 0.65721 0.68422 0.69620 0.70621 0.713498 0.718247 0.721016 0.723342 0.724610 0.81899
CA2 CA3 CA4 CA5 CA6 CA7 CA8 CA9 CA10 CA11 CA12 CA13
Eigenvalue 0.06092 0.03997 0.03193 0.01844 0.01643 0.01210 0.007962 0.007348 0.004352 0.003702 0.003262 0.002073
Proportion Explained 0.05221 0.03425 0.02737 0.01580 0.01408 0.01037 0.006823 0.006297 0.003730 0.003172 0.002795 0.001777
Cumulative Proportion 0.87120 0.90545 0.93282 0.94862 0.96270 0.97307 0.979895 0.986192 0.989922 0.993094 0.995889 0.997666
CA14 CA15 CA16
Eigenvalue 0.001605 0.0007339 0.0003844
Proportion Explained 0.001376 0.0006289 0.0003294
Cumulative Proportion 0.999042 0.9996706 1.0000000
Accumulated constrained eigenvalues
Importance of components:
CCA1 CCA2 CCA3 CCA4 CCA5 CCA6 CCA7 CCA8 CCA9 CCA10 CCA11 CCA12
Eigenvalue 0.5252 0.1282 0.06987 0.04368 0.03151 0.01399 0.01167 0.008508 0.005541 0.003231 0.002714 0.001479
Proportion Explained 0.6211 0.1516 0.08263 0.05166 0.03727 0.01654 0.01380 0.010062 0.006554 0.003821 0.003210 0.001750
Cumulative Proportion 0.6211 0.7727 0.85534 0.90699 0.94426 0.96080 0.97460 0.984666 0.991219 0.995040 0.998250 1.000000
Scaling 2 for species and site scores
* Species are scaled proportional to eigenvalues
* Sites are unscaled: weighted dispersion equal on all dimensions
Species scores
CCA1 CCA2 CCA3 CCA4 CCA5 CCA6
CHA 1.261678 1.4158366 -0.085786 -0.20143 0.094648 -0.02677
TRU 1.504797 -0.3320131 0.282996 -0.21081 -0.176047 0.10795
VAI 1.208961 -0.2596707 0.023637 0.02879 -0.070803 -0.03587
LOC 0.973409 -0.3409895 -0.061427 0.15259 -0.011633 -0.13148
OMB 1.328671 1.5556705 -0.072503 -0.45466 0.050675 -0.02058
BLA 0.873681 1.2261631 -0.080933 0.10384 0.197282 0.01477
HOT -0.475732 0.1250027 -0.139786 0.30679 -0.280342 -0.10467
TOX -0.148301 0.3058896 0.009010 0.68134 -0.174313 0.15396
VAN 0.092658 -0.0340649 -0.146678 0.12207 0.203783 0.21616
CHE -0.003922 -0.1311604 -0.413736 -0.03670 0.245616 -0.12013
BAR -0.315829 0.2718098 0.096591 0.20386 -0.098290 -0.14380
SPI -0.353697 0.1875624 0.105413 0.46952 -0.206659 0.14247
GOU -0.266529 0.0099043 -0.114884 -0.01462 -0.119793 0.01753
BRO -0.162828 -0.2341955 0.053037 -0.20602 0.162875 0.07056
PER -0.118632 -0.1655123 0.086275 0.12926 0.243372 0.16869
BOU -0.575139 0.0906277 0.289683 0.10153 -0.077073 -0.05231
PSO -0.614472 0.0699223 0.201495 0.00211 -0.031527 -0.04785
ROT -0.514263 -0.1041699 0.060815 -0.20060 0.096014 0.38350
CAR -0.579312 0.1027586 0.402974 0.02702 0.030612 0.04315
TAN -0.287583 -0.1616479 0.059330 0.03100 0.167535 -0.14051
BCO -0.698013 0.0321769 0.404047 -0.14486 0.006662 -0.11877
PCH -0.775819 0.0157553 0.671552 -0.36865 0.140552 0.07338
GRE -0.758973 -0.0414595 0.005259 -0.24140 -0.085200 -0.08040
GAR -0.367796 -0.1312913 -0.358758 0.02278 0.246773 0.01138
BBO -0.737390 0.0006554 0.277727 -0.12787 -0.007756 -0.13028
ABL -0.661692 -0.0095693 -0.554817 -0.26868 -0.408397 0.06374
ANG -0.649835 0.0506313 0.366951 -0.02018 -0.015048 -0.03998
Site scores (weighted averages of species scores)
CCA1 CCA2 CCA3 CCA4 CCA5 CCA6
1 2.86516 -2.59066 4.05021 -4.826604 -5.58660 7.71807
2 2.42446 -2.42001 1.58057 -0.918030 -3.16897 0.01074
3 2.17451 -2.38845 1.14412 -0.505450 -2.24026 -1.01203
4 1.43346 -2.01154 0.51275 -0.120191 -0.01589 -0.57736
5 0.20438 -1.25912 -0.93175 -0.015989 3.95388 4.37473
6 1.16155 -1.81341 -0.37717 0.313660 1.04841 -1.75006
7 2.06058 -2.22818 0.57425 -0.129673 -1.53156 -0.73792
9 0.31971 -1.46318 -3.68534 0.695299 5.16124 -5.75036
10 1.37976 -1.70281 -1.12847 1.097003 0.61929 -1.79702
11 2.23464 0.32959 0.40345 -2.201068 -1.24639 -0.77088
12 2.26686 0.75825 0.42419 -2.133660 -1.18774 -1.36845
13 2.38226 2.59163 0.64732 -2.607810 -0.87122 0.04395
14 1.93354 2.71503 0.06047 -2.015351 -0.01347 -1.17389
15 1.41204 1.91477 -0.63545 -0.276029 1.16205 -1.16234
16 0.76700 1.26883 -0.34890 2.546875 1.08426 1.84264
17 0.32385 0.74875 -0.31264 2.787811 -0.61836 1.50271
18 0.07295 0.60039 -0.42274 2.152349 -0.31135 0.66423
19 -0.19188 -0.07590 -0.69505 1.939538 -0.69206 -0.01086
20 -0.60257 -0.08977 -0.56318 0.965541 -0.54272 0.02997
21 -0.71044 -0.07645 0.08221 0.252679 -0.31072 0.06655
22 -0.76633 -0.04558 0.25028 0.006645 0.12494 -0.41067
23 -0.80688 -0.54931 -6.73420 -3.155390 -2.57362 0.33479
24 -0.97282 -0.23418 -3.89665 -2.575868 -3.52670 -1.54857
25 -0.73275 -0.48608 -3.50548 -2.862183 -1.71625 4.59772
26 -0.82998 -0.20084 -0.27426 -1.057951 -0.49139 -1.16438
27 -0.81893 -0.12557 0.33310 -0.746664 0.07753 -1.51194
28 -0.85623 -0.09559 0.73686 -0.834190 0.26166 -0.81421
29 -0.66360 0.19062 0.80184 -0.298560 0.09427 0.09045
30 -0.87011 -0.02528 1.25611 -0.336810 0.37055 1.53167
Site constraints (linear combinations of constraining variables)
CCA1 CCA2 CCA3 CCA4 CCA5 CCA6
1 2.671850 -2.26482 1.80435 -0.56685 -2.852842 -0.14452
2 1.281867 -2.52663 1.45188 0.89289 -0.317875 2.54599
3 1.859244 -2.58114 1.14232 -1.57862 -1.351692 -1.01721
4 1.677665 -2.22498 0.14065 0.83717 0.149822 -0.29860
5 0.895226 -1.04180 -1.11299 -0.65716 3.028801 1.56249
6 1.916851 -2.07499 0.51830 -1.11674 -1.491776 -1.29123
7 1.957789 -1.30249 -0.43778 0.02795 1.047682 -0.44908
9 -0.111247 -1.29880 -2.36810 1.03231 4.012764 -0.80970
10 0.867895 -1.76313 -0.49974 0.94590 -0.975148 -0.99702
11 1.638770 0.15817 0.69128 -0.93572 -0.473693 -1.46543
12 1.578971 1.18069 0.28615 0.23539 -0.711147 1.62760
13 1.643799 1.81111 -0.09861 -0.11361 0.335045 1.45434
14 2.015272 2.80890 -0.35320 -1.84593 0.566969 -1.45950
15 1.219675 1.51054 -0.20338 -0.34066 0.055113 -0.78885
16 0.431998 0.61433 0.33463 0.83470 0.754972 0.63088
17 0.161081 0.40391 -0.65631 1.57864 -0.864660 0.72063
18 0.110948 0.50487 -0.69639 0.98240 0.134082 -0.33742
19 0.365219 0.60496 -0.24852 1.29758 -1.026162 0.07655
20 -0.270013 0.08774 -0.22311 1.25604 -0.877224 0.26017
21 -0.720535 -0.12414 -0.50600 1.16107 -0.203352 -1.26368
22 -0.349171 0.33354 0.20892 -0.29165 -0.167930 0.04679
23 -0.003888 1.08795 -4.14171 -5.08185 -2.767769 0.14878
24 -1.554517 -0.66678 -3.53631 -0.56359 -0.621847 -0.23822
25 -0.939029 -0.92455 -4.17659 -3.12602 -2.984041 4.24895
26 -0.889361 -0.16753 -0.60043 -0.56858 0.181986 -0.94925
27 -1.250040 -0.39096 0.08349 -0.85453 0.107236 -1.36249
28 -0.818089 0.07686 0.89013 -0.01778 0.489098 0.19495
29 -0.570505 0.21670 1.11695 -0.51018 0.003451 0.57101
30 -0.884028 -0.08146 1.09427 -0.56835 0.238317 0.65925
Biplot scores for constraining variables
CCA1 CCA2 CCA3 CCA4 CCA5 CCA6
alt 0.8018 -0.52239 -0.14017 0.018567 0.21787 0.01726
penmoderate -0.2679 0.16128 -0.06306 0.057887 0.02486 -0.34503
pensteep 0.2458 0.09696 0.02842 0.007148 0.27906 0.42602
penvery_steep 0.5761 -0.60060 0.10263 -0.097034 -0.19935 -0.28801
deb -0.6934 0.24753 0.42947 -0.256793 -0.06713 0.15872
pH 0.1555 0.29190 0.12935 -0.236003 0.18527 -0.10038
dur -0.5500 0.49608 0.11327 -0.225097 0.20199 0.18792
pho -0.4300 -0.02905 -0.47075 -0.475127 -0.22835 0.26150
nit -0.6905 0.17930 -0.21398 0.014408 -0.25128 0.04097
amm -0.4152 -0.11060 -0.59275 -0.296873 -0.29368 0.35065
oxy 0.7863 0.34602 0.26535 0.349153 -0.14604 -0.04738
dbo -0.4590 -0.16791 -0.58402 -0.546341 -0.12570 0.09982
Centroids for factor constraints
CCA1 CCA2 CCA3 CCA4 CCA5 CCA6
penlow -0.4094 0.1886 -0.03455 -0.003447 -0.17752 0.2389
penmoderate -0.3614 0.2176 -0.08508 0.078099 0.03353 -0.4655
pensteep 0.5006 0.1975 0.05788 0.014560 0.56840 0.8677
penvery_steep 1.7132 -1.7860 0.30521 -0.288555 -0.59281 -0.8565
# CCA三序图(使用拟合的样方坐标)
# ***********************************
# 1型标尺:物种坐标等比例于相对特征根
# 样方坐标是物种坐标的加权平均
plot(spe.cca, scaling=1, display=c("sp","lc","cn"), main="CCA三序图:spe~env2 - 1型标尺")
# 2型标尺(默认):样方坐标等比例于相对特征根
# 物种坐标是样方坐标的加权平均
plot(spe.cca, display=c("sp","lc","cn"), main="CCA三序图:spe~env2 - 2型标尺")
# CCA无物种的双序图(1型标尺)(拟合的样方坐标)
# ***********************************************************
plot(spe.cca, scaling=1, display=c("lc", "cn"),
main="CCA双序图:spe~env2 - 1型标尺")
# CCA无样方的双序图(2型标尺)
# **********************************
plot(spe.cca, scaling=2, display=c("sp", "cn"),
main="CCA双序图:spe~env2 - 2型标尺")
# CCA结果的置换检验
# *******************
# 全模型置换检验
> anova(spe.cca, step=1000)
Permutation test for cca under reduced model
Permutation: free
Number of permutations: 999
Model: cca(formula = spe ~ alt + pen + deb + pH + dur + pho + nit + amm + oxy + dbo, data = env2)
Df ChiSquare F Pr(>F)
Model 12 0.84556 3.5083 0.001 ***
Residual 16 0.32136
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
> # 每轴置换检验
> anova(spe.cca, by="axis", step=1000)
Permutation test for cca under reduced model
Forward tests for axes
Permutation: free
Number of permutations: 999
Model: cca(formula = spe ~ alt + pen + deb + pH + dur + pho + nit + amm + oxy + dbo, data = env2)
Df ChiSquare F Pr(>F)
CCA1 1 0.52521 26.1494 0.001 ***
CCA2 1 0.12816 6.3808 0.002 **
CCA3 1 0.06987 3.4788 0.354
CCA4 1 0.04368 2.1746 0.907
CCA5 1 0.03151 1.5690 0.980
CCA6 1 0.01399 0.6964 1.000
CCA7 1 0.01167 0.5812 1.000
CCA8 1 0.00851 0.4236 1.000
CCA9 1 0.00554 0.2759 1.000
CCA10 1 0.00323 0.1609 1.000
CCA11 1 0.00271 0.1351 1.000
CCA12 1 0.00148 0.0737 1.000
Residual 16 0.32136
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>
> # 使用vegan包ordistep()函数对CCA模型的解释变量进行筛选#****************************************************
> # ordistep()函数允许使用因子变量,例如env2中的"pen"因子变量
> cca.step.forward <- ordistep(cca(spe ~ 1, data=env2), scope=formula(spe.cca),
+ direction="forward", pstep=1000)
Start: spe ~ 1
Df AIC F Pr(>F)
+ alt 1 99.999 12.8184 0.005 **
+ oxy 1 100.885 11.6211 0.005 **
+ deb 1 103.362 8.4593 0.005 **
+ nit 1 103.912 7.7930 0.005 **
+ dur 1 105.857 5.5355 0.005 **
+ pen 3 106.490 2.9447 0.005 **
+ dbo 1 107.219 4.0431 0.005 **
+ amm 1 107.962 3.2577 0.010 **
+ pho 1 107.941 3.2800 0.020 *
+ pH 1 110.469 0.7517 0.600
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Step: spe ~ alt
Df AIC F Pr(>F)
+ oxy 1 93.479 8.8800 0.005 **
+ dbo 1 98.304 3.5339 0.015 *
+ amm 1 99.291 2.5456 0.050 *
+ pho 1 99.884 1.9675 0.085 .
+ nit 1 100.321 1.5487 0.110
+ deb 1 100.268 1.5992 0.140
+ pH 1 100.860 1.0414 0.330
+ dur 1 101.086 0.8321 0.475
+ pen 3 103.841 0.6180 0.885
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Step: spe ~ alt + oxy
Df AIC F Pr(>F)
+ dbo 1 91.265 3.9094 0.005 **
+ pho 1 92.644 2.5675 0.015 *
+ deb 1 93.510 1.7560 0.045 *
+ amm 1 93.478 1.7854 0.085 .
+ dur 1 94.030 1.2802 0.185
+ pen 3 96.484 0.8340 0.640
+ pH 1 94.655 0.7200 0.680
+ nit 1 94.778 0.6115 0.755
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Step: spe ~ alt + oxy + dbo
Df AIC F Pr(>F)
+ deb 1 91.293 1.6892 0.105
+ dur 1 91.564 1.4498 0.215
+ pH 1 92.156 0.9355 0.415
+ pen 3 93.888 0.9058 0.545
+ amm 1 92.389 0.7361 0.650
+ nit 1 92.584 0.5704 0.835
+ pho 1 92.678 0.4913 0.860
> # 仅使用alt、oxy和dbo三个解释变量的简约CCA分析
> # *******************************************
> (spe.cca.pars <- cca(spe ~ alt + oxy + dbo, data=env2))
Call: cca(formula = spe ~ alt + oxy + dbo, data = env2)
Inertia Proportion Rank
Total 1.1669 1.0000
Constrained 0.6569 0.5629 3
Unconstrained 0.5101 0.4371 25
Inertia is scaled Chi-square
Eigenvalues for constrained axes:
CCA1 CCA2 CCA3
0.5054 0.1013 0.0502
Eigenvalues for unconstrained axes:
CA1 CA2 CA3 CA4 CA5 CA6 CA7 CA8
0.14907 0.09735 0.06110 0.05328 0.03529 0.02617 0.01888 0.01489
(Showed only 8 of all 25 unconstrained eigenvalues)
> anova.cca(spe.cca.pars, step=1000)
Permutation test for cca under reduced model
Permutation: free
Number of permutations: 999
Model: cca(formula = spe ~ alt + oxy + dbo, data = env2)
Df ChiSquare F Pr(>F)
Model 3 0.65686 10.732 0.001 ***
Residual 25 0.51005
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
> anova.cca(spe.cca.pars, step=1000, by="axis")
Permutation test for cca under reduced model
Forward tests for axes
Permutation: free
Number of permutations: 999
Model: cca(formula = spe ~ alt + oxy + dbo, data = env2)
Df ChiSquare F Pr(>F)
CCA1 1 0.50541 24.7725 0.001 ***
CCA2 1 0.10128 4.9640 0.001 ***
CCA3 1 0.05017 2.4591 0.007 **
Residual 25 0.51005
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
> vif.cca(spe.cca)
alt penmoderate pensteep penvery_steep deb pH dur pho nit
13.426976 2.355253 2.770819 3.081368 9.607265 1.529026 3.568034 10.980633 11.629711
amm oxy dbo
14.062674 6.354635 10.098034
> vif.cca(spe.cca.pars)
alt oxy dbo
1.206623 3.345063 3.002496
# 可人机交互的三维排序图
# ***********************
# 样方排序图(wa坐标)
# ***********************
library(vegan3d)
ordirgl(spe.cca.pars, type="t", scaling=1)
#使用鼠标的右键和滑轮可以缩放三维图的大小,使用左键可以转动三维图。
# 将加权平均的坐标连接到线性组合坐标
orglspider(spe.cca.pars, scaling=1, col="purple")
#紫色的连接线显示CCA模型的拟合数据的好坏。连接线越短,拟合越好。
# 附带聚类分析结果的样方(wa坐标)三维排序图
# *******************************************
# 样方编号不同颜色代表不同的聚类簇
gr <- cutree(hclust(vegdist(spe.hel, "euc"), "ward.D"), 4)
ordirgl(spe.cca.pars, type="t", scaling=1, ax.col="black", col=gr+1)
# 将样方连接到聚类簇的形心
orglspider(spe.cca.pars, gr, scaling=1)
#样方沿着主要生态梯度很好被聚类。需要牢记当前是基于鱼类数据的分析。
# 完整的三维CCA三序图
# ***********************
ordirgl(spe.cca.pars, type="t", scaling=2)
orgltext(spe.cca.pars, display="species", type="t", scaling=2, col="cyan")
# 绘制物种组(使用Jaccard相似系数进行分组)
# ***********************************************************
gs <- cutree(hclust(vegdist(t(spe), method="jaccard"), "ward.D"), 4)
ordirgl(spe.cca.pars, display="species", type="t", col=gs+1)
参考
排序--4--典范对应分析(CCA)
典型相关分析(CCA)
典范对应分析(CCA)|sciencenet
cca.pdf
Multivariate statistics