当我尝试制作 CCA 图时,仅显示 25 个向量中的 4 个。
所以,我首先加载我的数据......
#Load package and Data
library(vegan)
Species <- read.csv("D:/R/Code/TestSpiders.csv", head = TRUE, row.names = 1)
Plants <- read.csv("D:/R/Code/Plants.csv", head = TRUE, row.names = 1)
然后,我使用以下代码来制作 CCA 并绘制它。
#Making the CCA
CCA.Plants <- cca(Species, Plants)
plot(CCA.Plants)
尽管我的植物数据有超过 4 列(有 25 列),但生成的 CCA 图中仅显示 4 个向量。这 4 个向量代表我的 Plants 数据帧的前 4 列。当我使用 CCA 示例(varespec 和 varechem)中使用的数据时,不会发生这种情况。我看不出 varechem 和我的植物数据的格式有任何差异。
这是我输入CCA.Plants时的结果
Call: cca(X = Species, Y = Plants)
Inertia Proportion Rank
Total 1.0904 1.0000
Constrained 0.4789 0.4392 4
Unconstrained 0.6115 0.5608 15
Inertia is mean squared contingency coefficient
Some constraints were aliased because they were collinear (redundant)
Eigenvalues for constrained axes:
CCA1 CCA2 CCA3 CCA4
0.19122 0.16817 0.06850 0.05101
Eigenvalues for unconstrained axes:
CA1 CA2 CA3 CA4 CA5 CA6 CA7 CA8 CA9 CA10 CA11 CA12
0.16984 0.12046 0.06941 0.05250 0.04174 0.03349 0.02291 0.02206 0.02015 0.01970 0.01504 0.00957
CA13 CA14 CA15
0.00802 0.00428 0.00228
欢迎任何意见。
线索在这里:
Some constraints were aliased because they were collinear (redundant)
换句话说,
Plants
的其他 21 列可以创建为图中显示的四种植物物种的线性组合。这 21 种植物不包含额外信息,因此从分析中删除。
我也不认为您在这里使用的方法是好的方法。为什么蜘蛛应对植物的线性梯度做出单峰反应?
相反,我建议对此类问题使用协同对应分析(Co-CA)。如果您不希望任何一组物种发挥预测因子或响应,则可以选择对称版本;如果您确实想使用植物物种组成来预测蜘蛛,则可以选择预测版本。
此方法(两个版本)是通过我的 cocorresp 包在 R 中实现的,该包位于 CRAN 上,并且基于作为介绍 Co-CA 的论文的补充信息提供的原始 Matlab 例程(ter Braak & Schaffers,2004 年) ).
例如:
## symmetric CoCA
data(beetles)
## log transform the beetle data
beetles <- log1p(beetles)
data(plants)
## fit the model
bp.sym <- coca(beetles ~ ., data = plants, method = "symmetric")
bp.sym
给予:
Symmetric Co-Correspondence Analysis
Call: symcoca(y = y, x = x, n.axes = n.axes, R0 = weights, symmetric =
symmetric, nam.dat = nam.dat)
Eigenvalues:
COCA 1 COCA 2 COCA 3 COCA 4 COCA 5 COCA 6 COCA 7 COCA 8
0.2534 0.1289 0.0811 0.0741 0.0585 0.0474 0.0373 0.0320
COCA 9 COCA 10 COCA 11 COCA 12 COCA 13 COCA 14 COCA 15 COCA 16
0.0308 0.0233 0.0207 0.0184 0.0172 0.0161 0.0144 0.0118
COCA 17 COCA 18 COCA 19 COCA 20 COCA 21 COCA 22 COCA 23 COCA 24
0.0106 0.0100 0.0087 0.0085 0.0066 0.0063 0.0050 0.0044
COCA 25 COCA 26 COCA 27 COCA 28 COCA 29
0.0043 0.0034 0.0022 0.0010 0.0006
Inertia:
beetles plants
Total: 3.98833 5.757
Explained: 3.97079 5.740
Residual: 0.01754 0.018
和
layout(matrix(1:2, ncol = 2))
plot(bp.sym, which = "response", main = "Beetles")
plot(bp.sym, which = "predictor", main = "Plants")
layout(1)
请注意,在此对称分析中,两组组合均不发挥响应或预测作用,但这就是绘图方法根据哪个组合位于图中
~
的左侧或右侧来选择绘制哪个组合的方式。公式。
预测 Co-CA 的工作原理类似。
ter Braak, C.J.F 和 Schaffers, A.P. (2004) 协同对应分析:一种关联两个群落组成的新排序方法。 生态学85(3),834–846
嗨,您可以在CCA上强制显示别名向量吗?