找回密码
 注册
查看: 2271|回复: 0

R语言 vegan包 capscale()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-10-1 15:04:14 | 显示全部楼层 |阅读模式
capscale(vegan)
capscale()所属R语言包:vegan

                                        [Partial] Constrained Analysis of Principal Coordinates or
                                         [部分]约束的主坐标分析

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

Constrained Analysis of Principal Coordinates (CAP) is an ordination method similar to Redundancy Analysis (rda), but it allows non-Euclidean dissimilarity indices, such as Manhattan or Bray–Curtis distance. Despite this non-Euclidean feature, the analysis is strictly linear and metric. If called with Euclidean distance, the results are identical to rda, but capscale will be much more inefficient. Function capscale is a constrained version of metric scaling, a.k.a. principal coordinates analysis, which is based on the Euclidean distance but can be used, and is more useful, with other dissimilarity measures. The function can also perform unconstrained principal coordinates analysis, optionally using extended dissimilarities.
主坐标的约束分析(CAP)是一个协调的方法类似冗余分析(rda),但它允许非欧几里德的差异性指标,如曼哈顿或布雷柯蒂斯距离的。分析尽管此非欧几里德的功能,是严格线性和度量。如果欧氏距离,其结果是相同的rda,但capscale会更加低效的。函数capscale是一个约束版本的度量缩放,又名主坐标分析,它是基于欧几里德距离,但也可以使用,并且是更有用的,与其他的相异措施。功能,也可以进行无约束的主坐标分析,可以使用扩展的异同。


用法----------Usage----------


capscale(formula, data, distance = "euclidean", sqrt.dist = FALSE,
    comm = NULL, add = FALSE,  dfun = vegdist, metaMDSdist = FALSE,
    na.action = na.fail, subset = NULL, ...)



参数----------Arguments----------

参数:formula
Model formula. The function can be called only with the formula interface. Most usual features of formula hold, especially as defined in cca and rda. The LHS must be either a community data matrix or a dissimilarity matrix, e.g., from vegdist or dist. If the LHS is a data matrix, function vegdist will be used to find the dissimilarities. The RHS defines the constraints. The constraints can be continuous variables or factors, they can be transformed within the formula, and they can have interactions as in a typical formula. The RHS can have a special term Condition that defines variables to be “partialled out” before constraints, just like in rda or cca. This allows the use of partial CAP.
模型公式。也可以调用函数的公式接口。最常用的功能formula,尤其是中定义的cca和rda。 LHS必须是一个社区数据矩阵或相异度矩阵,例如,从vegdist或dist。如果LHS是数据矩阵,函数vegdist将被用来找到异同。 RHS定义的约束。约束可以是连续的变量或因子,它们可以被转化式内,他们可以在一个典型的formula有相互作用。 RHS可以有一个专用名词Condition定义变量,以“partialled”约束之前,就像在rda或cca。这允许使用的部分CAP。


参数:data
Data frame containing the variables on the right hand side of the model formula.  
数据框包含的变量,在右手侧的模型公式。


参数:distance
The name of the dissimilarity (or distance) index if the LHS of the formula is a data frame instead of dissimilarity matrix.
如果LHS的formula是一个数据框,而不是相异度矩阵的相异指数(或距离)的名称。


参数:sqrt.dist
Take square roots of dissimilarities. See section Notes below.
以平方根相异。见节“Notes下面。


参数:comm
Community data frame which will be used for finding species scores when the LHS of the formula was a dissimilarity matrix. This is not used if the LHS is a data frame. If this is not supplied, the “species scores” are the axes of initial metric scaling (cmdscale) and may be confusing.
社区数据框将被用于发现物种的分数时,左的formula一个相异度矩阵。如果LHS是一个数据框,这是不使用。如果不提供,“种分数”的轴初始公制缩放(cmdscale),可能会造成混乱。


参数:add
Logical indicating if an additive constant should be computed, and added to the non-diagonal dissimilarities such that all eigenvalues are non-negative in the underlying Principal Co-ordinates Analysis (see cmdscale  for details). This implements “correction method 2” of Legendre & Legendre (1998, p. 434). The negative eigenvalues are caused by using semi-metric or non-metric dissimilarities with basically metric cmdscale. They are harmless and ignored in capscale, but you also can avoid warnings with this option.  
逻辑表明,如果加常数的计算,添加到非对角线上的异同等,所有的特征值都是非负的,底层的主要坐标分析(见cmdscale的详细信息)。这样就实现“矫正方法2”的勒让德勒让德(1998年,第434页)。使用半度量或非公制的不同点基本上公吨cmdscale负的特征值所造成的。他们是无害的,在capscale忽略,但你也可以使用此选项避免警告。


参数:dfun
Distance or dissimilarity function used. Any function returning standard "dist" and taking the index name as the first argument can be used.  
距离或不相似的功能。可用于任何函数返回标准"dist"走索引的名称作为第一个参数。


参数:metaMDSdist
Use metaMDSdist similarly as in metaMDS. This means automatic data transformation and using extended flexible shortest path dissimilarities (function stepacross) when there are many dissimilarities based on no shared species.
metaMDSdist类似的metaMDS使用。这意味着自动数据转换和使用扩展的灵活的最短路径的不同点(函数stepacross)时,也有许多不同点的基础上没有共享的物种。


参数:na.action
Handling of missing values in constraints or conditions. The default (na.fail) is to stop with missing values. Choices na.omit and na.exclude delete rows with missing values, but differ in representation of results. With na.omit only non-missing site scores are shown, but na.exclude gives NA for scores of missing observations. Unlike in rda, no WA scores are available for missing constraints or conditions.
处理缺失值的限制或条件。的默认(na.fail)是具有缺失值的停止。选择na.omit和na.exclude删除具有缺失值的行,但表示结果有所不同。用na.omit唯一的非缺失#显示,但na.exclude给NA缺少观察的分数。不同的rda,没有WA分数的为失踪的限制或条件。


参数:subset
Subset of data rows. This can be a logical vector which is TRUE for kept observations, or a logical expression which can contain variables in the working environment, data or species names of the community data (if given in the formula or as comm argument).
数据行的子集。这是一个逻辑向量,这是TRUE保持观察,或一个逻辑表达式,它可以包含在工作环境中的变量,data或社会数据的物种名称(如果给定的公式或comm参数)。


参数:...
Other parameters passed to rda or to metaMDSdist.   
其他参数传递给rda或metaMDSdist。


Details

详细信息----------Details----------

Canonical Analysis of Principal Coordinates (CAP) is simply a Redundancy Analysis of results of Metric (Classical) Multidimensional Scaling (Anderson & Willis 2003). Function capscale uses two steps: (1) it ordinates the dissimilarity matrix using cmdscale and (2) analyses these results using rda. If the user supplied a community data frame instead of dissimilarities, the function will find the needed dissimilarity matrix using vegdist with specified distance. However, the method will accept dissimilarity matrices from vegdist, dist, or any other method producing similar matrices. The constraining variables can be continuous or factors or both, they can have interaction terms, or they can be transformed in the call. Moreover, there can be a special term Condition just like in rda and cca so that “partial” CAP can be performed.
典型相关分析的主要坐标(CAP)是一个简单的冗余分析的结果度量(古典)多维标度(2003年安德森和威利斯)。功能capscale采用两个步骤:(1)协调相异度矩阵使用cmdscale和(2)分析这些结果使用rda。如果用户提供的一个社区,而不是相异的数据框,该函数将使用vegdist指定了distance找到所需要的相异度矩阵。然而,该方法将接受相异矩阵vegdist,dist,或任何其他方法相似矩阵。约束的变量可以是连续的或因素或两个,它们可以具有交互项,或者它们可被转化中的呼叫。此外,也可以是一个专用名词Condition就像在rda和cca“这样说,”部分“CAP可以进行。

The current implementation  differs from the method suggested by Anderson & Willis (2003) in three major points which actually make it similar to distance-based redundancy analysis (Legendre & Anderson 1999):
目前的实现有所不同从安德森·威利斯(2003)提出的方法,在3个重点,这实际上使基于距离的冗余分析(勒让德和安德森,1999):

Anderson & Willis used the orthonormal solution of cmdscale, whereas capscale uses axes weighted by corresponding eigenvalues, so that the ordination distances are the best approximations of original dissimilarities. In the original method, later “noise” axes are just as important as first major axes.
安德森&威利斯使用的标准正交溶液cmdscale,而capscale使用由相应的特征值加权的轴,从而使协调距离最佳逼近原始异同。在原来的方法,后来的“噪音”轴作为第一大轴是同样重要的。

Anderson & Willis take only a subset of axes, whereas  capscale uses all axes with positive eigenvalues. The use of subset is necessary with orthonormal axes to chop off some “noise”, but the use of all axes guarantees that the results are the best approximation of original dissimilarities.
安德森和威利斯只有一小部分的轴,而capscale使用所有轴的正的特征值。使用子集的标准正交轴砍掉一些“噪音”,是必要的,但使用的所有轴,保证结果的最佳逼近原来的异同。

Function capscale adds species scores as weighted sums of (residual) community matrix (if the matrix is available), whereas Anderson & Willis have no fixed method for adding species scores.
功能capscale增加了种分数的加权和(剩余)社区矩阵(如果矩阵是可用的),而安德森和威利斯有没有固定的方法,为增加物种的分数。

With these definitions, function capscale with Euclidean distances will be identical to rda in eigenvalues and in site, species and biplot scores (except for possible sign reversal).  However, it makes no sense to use capscale with Euclidean distances, since direct use of rda is much more efficient. Even with non-Euclidean dissimilarities, the rest of the analysis will be metric and linear.
有了这些定义,函数capscale欧氏距离将是相同的rda的特征值和网站,物种和的双标图分数(除了可能的迹象逆转)。然而,这是没有意义的,使用capscale欧氏距离,因为直接使用rda的是更有效的。即使与非欧几里德的异同,将余下的分析度量的和线性的。

The function can be also used to perform ordinary metric scaling a.k.a. principal coordinates analysis by using a formula with only a constant on the left hand side, or comm ~ 1. With metaMDSdist = TRUE, the function can do automatic data standardization and use extended dissimilarities using function stepacross similarly as in non-metric multidimensional scaling with metaMDS.
该函数也可以使用只有一个恒定的左手侧上,或comm ~ 1通过使用一个公式来执行普通度量缩放又名主坐标分析。 metaMDSdist = TRUE,该功能可以自动做数据的标准化和使用扩展的异同使用功能stepacross同样作为非度量多维尺度与metaMDS。


值----------Value----------

The function returns an object of class capscale which is identical to the result of rda. At the moment, capscale does not have specific methods, but it uses cca and rda methods plot.cca, scores.rda  etc. Moreover, you can use anova.cca for permutation tests of “significance” of the results.
该函数返回一个对象类capscale的rda的结果是相同的。目前,capscale不具有具体的方法,但它使用cca和rda方法plot.cca,scores.rda等,此外,你可以使用anova.cca的排列测试“意义”的结果。


注意----------Note----------

The function produces negative eigenvalues with non-Euclidean dissimilarity indices. The non-Euclidean component of inertia is given under the title Imaginary in the printed output. The Total inertia is the sum of all eigenvalues, but the sum of all non-negative eigenvalues is given as Real Total (which is higher than the Total). The ordination is based only on the real dimensions with positive eigenvalues, and therefore the proportions of inertia components only apply to the Real   Total and ignore the Imaginary component. Permutation tests with anova.cca use only the real solution of positive eigenvalues. Function adonis gives similar significance tests, but it also handles the imaginary dimensions (negative eigenvalues) and therefore its results may differ from permutation test results of capscale.
的功能产生负的特征值与非欧几里德相异指数。惯性下的非欧几里德的组成部分的标题Imaginary在打印输出。 Total惯性的所有特征值的总和,但所有非负本征值的总和Real Total(这是高于Total)。协调是仅基于与正的特征值的实际尺寸,因此惯性成分的比例,只适用于Real   Total忽略Imaginary组件。置换试验anova.cca正的特征值只使用真正的解决办法。函数adonis给出了类似的显着性检验,但它也处理的虚尺寸(负本征值),因此其结果可能会有所不同排列测试结果capscale。

If the negative eigenvalues are disturbing, you can use argument add = TRUE passed to cmdscale, or, preferably, a distance measure that does not cause these warnings. Alternatively, after square root transformation of distances (argument sqrt.dist = TRUE) many indices do not produce negative eigenvalues.
如果负的特征值是令人不安的,你可以使用参数add = TRUE传递给cmdscale,或者,最好是,距离测量,不会引起这些警告。另外,平方根变换后的距离(参数sqrt.dist = TRUE)许多指标不产生负的特征值。

The inertia is named after the dissimilarity index as defined in the dissimilarity data, or as unknown distance if such an information is missing.  Function rda usually divides the ordination scores by number of sites minus one. In this way, the inertia is variance instead of sum of squares, and the eigenvalues sum up to variance. Many dissimilarity measures are in the range 0 to 1, so they have already made a similar division. If the largest original dissimilarity is less than or equal to 4 (allowing for stepacross), this division is undone in capscale and original dissimilarities are used. Keyword mean is added to the inertia in cases where division was made, e.g. in Euclidean and Manhattan distances.  Inertia is based on squared index, and keyword squared is added to the name of distance, unless data were square root transformed (argument sqrt.dist = TRUE). If an additive constant was used, keyword euclidified is added to the the name of inertia (argument add = TRUE).
的惯性被命名后的相异指数中所定义的相异数据,或unknown distance,如果这样的信息丢失。功能rda通常把统筹分数的网站数减一。在这种方式中,转动惯量是方差,而不是平方和,和特征值总结方差。许多相异措施是在0到1的范围内,所以他们已经作出了类似的部门。如果最大原稿的差异性是小于或等于4(允许stepacross),该部门被撤消capscale和使用原来的异同。关键字mean被添加到的惯量的情况下,分裂,例如在欧几里德和曼哈顿距离。转动惯量是基于平方的指数,并包含squared被添加到的距离的名称,除非数据转变平方根(参数sqrt.dist = TRUE)。如果使用的添加剂常数,关键字euclidified的名称的惯性(参数add = TRUE)被添加到。


(作者)----------Author(s)----------


Jari Oksanen



参考文献----------References----------

coordinates: a useful method of constrained ordination for ecology. Ecology 84, 511–525.
distance matrices. Linear Algebra and its Applications 67, 81–97.
analysis: testing multispecies responses in multifactorial ecological experiments. Ecological Monographs 69, 1–24.
Edition. Elsevier

参见----------See Also----------

rda, cca, plot.cca, anova.cca, vegdist,
rda,cca,plot.cca,anova.cca,vegdist,


实例----------Examples----------


data(varespec)
data(varechem)
## Basic Analysis[#基本分析]
vare.cap <- capscale(varespec ~ N + P + K + Condition(Al), varechem,
                     dist="bray")
vare.cap
plot(vare.cap)
anova(vare.cap)
## Avoid negative eigenvalues with additive constant[#避免负的特征值加常数。]
capscale(varespec ~ N + P + K + Condition(Al), varechem,
                     dist="bray", add =TRUE)
## Avoid negative eigenvalues by taking square roots of dissimilarities[#避免负本征值的平方根的异同]
capscale(varespec ~ N + P + K + Condition(Al), varechem,
                     dist = "bray", sqrt.dist= TRUE)
## Principal coordinates analysis with extended dissimilarities[#主坐标分析与扩展的异同]
capscale(varespec ~ 1, dist="bray", metaMDS = TRUE)

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2024-11-27 04:30 , Processed in 0.019807 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表