英文:
metaMDS() using a dist as function of metadata
问题
有没有一种方法可以使用metaMDS()
执行嵌套/受限的NMDS排序?例如,我想用元数据变量“location”和“Glacier”来限制我的距离矩阵,我认为代码会类似于这样:
ord <- metaMDS(dist ~ location*Glacier, data=metadata)
其中,dist是我从标准ASV表上使用vegdist()
获得的输出。
英文:
Is there a way to perform a nested/constrained NMDS ordination with metaMDS()
? For example, I'd like to constrain my distance matrix with the metadata variables "location" and "Glacier" and I thought the code would look something like this:
ord <- metaMDS(dist ~ location*Glacier, data=metadata)
Where dist is my output from vegdist()
on a standard ASV table.
答案1
得分: 1
我会为您翻译代码部分:
据我所知,目前尚未发明受限制的NMDS(但请参阅本消息的第二章)。此外,它不会做您期望的事情。受限制的度量排序(CCA,RDA,dbRDA)首先通过拟合类型为 `y ~ location*Glacier` 的线性模型,然后将拟合值提交给排序。因此,在这些模型中,所有具有相同位置和冰川的取样单元将是相同的,并且将在排序中重叠在同一点上。我们通过所谓的WA得分在CCA、RDA、dbRDA中解决了这个问题,这些得分是来自群落组成的单一位置的预测。我们称这些为加权平均或WA得分(尽管对于RDA和dbRDA,它们更确切地是加权和得分)。沿着这些线路,您可以通过首先找到您的群落的平均值(例如 `fcomm <- fitted(lm(comm ~ location*Glacier))`,或者对于连续变量,可以使用 `fcomm <- fitted(gam(comm ~ ...)`)并将这些作为输入提交给NMDS来进行受限制的排序。然而,很难实现获得原始观察的散点(尽管**vegan**的开发版本在github上有一个未合并的分支,用于在NMDS排序中添加新点)。
如果您真的感兴趣,极端的**natto**包在 https://github.com/jarioksa/natto 中有一个名为 `distconstrain` 的函数,可以直接计算受限制的异质性,就像 `vegan:::dbrda` 中一样(尽管对于非度量和半度量的异质性可能会失败)。将这些提交给NMDS将得到具有与上述方法相同问题的受限制的NMDS:相同的约束组合将产生相同的异质性。或许更有趣的是,您可以使用这些来获得部分NMDS(也是一种不存在的方法,但我们在一篇发表的文章中使用过),或者在去除这些变量的影响后进行NMDS。
英文:
As far as I know, constrained NMDS has not been invented yet (but see the second chapter in this message). Moreover, it wouldn't do what you expect it to do. Constrained metric ordination (CCA, RDA, dbRDA) work by first fitting the linear model of type y ~ location*Glacier
and then submitting the fit[ted] values to ordination. So in these models all sampling units with the same location & Glacier will be identical, and will fall in the same point over each other in ordination. We get over this in CCA, RDA, dbRDA using the so-called WA scores which are the predictions for these single locations from community composition. We call these weighted average or WA scores (although for RDA & dbRDA they rather are weighted sum scores). Along these lines, you can have constrained ordination with first finding the averaged (or fit[ted]) values of your community (such as fcomm <- fitted(lm(comm ~ location*Glacier))
, or fcomm <- fitted(gam(comm ~ ...)
for continuous variables) and using these as input to NMDS. However, getting the scatter of original observations cannot be easily achieved (although the development version of vegan in github has a non-merged branch for adding new points in NMDS ordination).
If you really are interested, the extreme-vegan package natto in https://github.com/jarioksa/natto has function distconstrain
that can directly calculate constrained dissimilarities as in vegan:::dbrda
(although for non-metric and semi-metric dissimilarities these may fail). Submitting these to NMDS will give constrained NMDS with same problems as the approach outlined above: identical combinations of constraints will give identical dissimilarities. Perhaps more interestingly, you can use these to get partial NMDS (also a method that does not exist, but we have used that in one publication), or NMDS after removing the effect of these variables.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论