- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试重现该列(FactoMineR::PCA
中的“variable”,vegan::rda
中的“species”)contribution percentages to axes from the FactoMineR
包装在 vegan
中。这些贡献被编码在 FactoMiner::PCA
对象中:
library(FactoMineR)
library(vegan)
data(dune)
fm <- FactoMineR::PCA(dune, scale.unit = FALSE, graph = FALSE)
head(round(sort(fm$var$contrib[,1], decreasing = TRUE), 3))
# Lolipere Agrostol Eleopalu Planlanc Poaprat Poatriv
# 17.990 16.020 13.866 7.088 6.861 4.850
通过查看 FactoMiner::PCA
的代码,我发现贡献的计算方法是轴坐标平方除以轴特征值再乘以 100%:
head(round(sort(100*fm$var$coord[,1]^2/fm$eig[1], decreasing = TRUE), 3))
# Lolipere Agrostol Eleopalu Planlanc Poaprat Poatriv
# 17.990 16.020 13.866 7.088 6.861 4.850
我无法使用 vegan::rda
对象复制上述计算:
vg <- rda(dune)
head(round(sort(100*scores(vg, choices = 1, display = "sp",
scaling = 0)[,1]^2/vg$CA$eig[1], decreasing = TRUE), 3))
# Lolipere Agrostol Eleopalu Planlanc Poaprat Poatriv
# 0.726 0.646 0.559 0.286 0.277 0.196
我显然做错了什么,差异可能是由于这两个包计算列坐标的方式不同,因为轴的特征值非常相似(与我的实际数据集相同),但坐标不是:
# vegan eigenvalue for axis 1
vg$CA$eig[1]
# PC1
# 24.79532
# FactoMineR eigenvalue for axis 1
fm$eig[1]
# [1] 23.55555
# vegan column coordinates for axis 1
head(round(scores(vg, choices = 1, display = "sp", scaling = 0)[,1], 3))
# Achimill Agrostol Airaprae Alopgeni Anthodor Bellpere
# -0.176 0.400 0.007 0.155 -0.163 -0.097
#FactoMineR, column coordinates for axis 1
head(round(fm$var$coord[,1], 3))
# Achimill Agrostol Airaprae Alopgeni Anthodor Bellpere
# 0.854 -1.943 -0.033 -0.751 0.791 0.472
# Sum of column coordinates for vegan axis 1 to illustrate the difference
sum(scores(vg, choices = 1, display = "sp", scaling = 0)[,1])
# [1] -0.796912
# Sum of column coordinates for FactoMineR axis 1 to illustrate the difference
sum(fm$var$coord[,1])
# [1] 3.867738
如何使用 vegan
rda 计算列/物种对排序轴的贡献百分比
对象?
最佳答案
vegan 中的未缩放分数在(正常)意义上未缩放,即它们的平方和为 1 -- 独立于特征值:
> colSums(scores(vg, choices=1:4,dis="sp", scaling=0)^2)
PC1 PC2 PC3 PC4
1 1 1 1
我认为这是有记录的。如果您想将这些平方项称为贡献,那对我来说没问题。 cca
也是如此,但是您需要研究加权平方和。此外,站点 (dis = "si"
) 的未缩放 分数将具有相同的单位平方和:这就是未缩放的概念。如果您缩放物种或地点,那么相同的关系将不再适用于另一组分数。通常,未缩放意味着分数是正交的,因此它们的叉积是单位矩阵(对角线或平方和 1 和非对角线元素 0)。对于 scaled 分数,这些平方和与特征值成正比(但阅读 vegan vignette on design decisions for const
ant scaling of of分数)。
vegan 函数 goodness
和 inertcomp
可能(也可能不会)为您提供您正在寻找的信息。
关于r - 如何计算素食 rda/cca 对象的物种贡献百分比?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50177409/
最近研究了CCA的概念,想在MATLAB中实现。但是有一个现有的 matlab 命令 canoncorr当前的。我想写我自己的代码。我对其进行了广泛研究,发现了三种方法: 1: Hardoon: 该方
我是 Microsoft CRM CCA 的新手。目前我面临一些问题。我创建了一个 winform 并将其托管在我的 Agent Desktop 中。 winform 应该在 winform 的文本区
我对文件进行二分查找。该文件充满了日志消息,其中每一行都以日期开头(日期或根据事件发生排序) 例子: 2011-09-18 09.38.20.123 2011-09-18 09.38.20.245 2
我正在尝试重现该列(FactoMineR::PCA 中的“variable”,vegan::rda 中的“species”)contribution percentages to axes from
在适用于 Python 的 scikit-learn 中,有一个模块调用 cross_decomposition,其中包含典型相关分析 (CCA) 类。我一直在试图弄清楚如何给出形状为 (n,m) 的
我最近在我的 mac 上更新了一些依赖项,之前一段时间没有做太多的 cca 开发,现在“cca run android”命令不再在我的机器上工作。 我收到以下奇怪的错误: BUILD FAILED /
我已经使用 Polymer 构建了一个 Chrome 应用程序,并希望将其安装在 Android 平台上。我已成功按照此处列出的步骤进行操作,编译并部署了一个 SDK: https://github.
后台权限很重要。没有它,你如何创建窗口? chrome.app.window.create(...) 我有一个具有以下 list 的应用: { "manifest_version": 2,
我正在使用 cca 工具链制作 Chrome/Android/iOS 应用。我正在使用 chrome.identity API 获取 access_token 以与 Google API 交互。 当我
试验移动 Chrome 应用程序 API:( https://github.com/MobileChromeApps/mobile-chrome-apps ) 我想要实现的是注册我的 chrome 警
我正在尝试使用 cordova chrome app(cca) 从 chrome 打包的应用程序中制作安卓应用程序.问题是 weinre 客户端看不到我在 android 选项卡上运行的应用程序。 相
我正在使用 Cardinal Cruise Hybrid 进行 3D 安全。我遵循了 Cardinal Cruise 提供的文档.我用 PHP 创建了 JWT。我正在使用 Cardinal Cruis
我正在按照这里的指南 https://github.com/MobileChromeApps/mobile-chrome-apps/blob/master/docs/Installation.md创建
以下是我在移动版 Chrome 应用程序中设置 Ionic 所做的工作: 创建了一个 Chrome 移动应用程序项目 - cca create projectname 创建了一个 Ionic 项目 i
我是一名优秀的程序员,十分优秀!