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

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

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

                                        Prediction Tools for [Constrained] Ordination (CCA,
                                         [约束]排序的预测工具(CCA,

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

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

Function predict can be used to find site and species scores or estimates of the response data with new data sets, Function calibrate estimates values of constraints with new data set. Functions fitted and residuals return estimates of response data.
函数predict可以用来找到的网站和物种的分数或响应数据与新的数据集的估计,功能calibrate估计值与新的数据集的约束。功能fitted和residuals返回的响应数据的估计。


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


## S3 method for class 'cca'
fitted(object, model = c("CCA", "CA"),
    type =  c("response", "working"), ...)
## S3 method for class 'capscale'
fitted(object, model = c("CCA", "CA", "Imaginary"),
    type = c("response", "working"), ...)
## S3 method for class 'cca'
residuals(object, ...)
## S3 method for class 'cca'
predict(object, newdata, type = c("response", "wa", "sp", "lc", "working"),
    rank = "full", model = c("CCA", "CA"), scaling = FALSE, ...)
## S3 method for class 'cca'
calibrate(object, newdata, rank = "full", ...)
## S3 method for class 'cca'
coef(object, ...)
## S3 method for class 'decorana'
predict(object, newdata, type = c("response", "sites", "species"),
    rank = 4, ...)



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

参数:object
A result object from cca, rda, capscale or decorana.  
一个结果对象cca,rda,capscale或decorana。


参数:model
Show constrained ("CCA") or unconstrained ("CA") results. For capscale this can also be  "Imaginary" for imaginary components with negative eigenvalues.  
显示限制("CCA")或无约束("CA")结果。对于capscale这也可以是"Imaginary"负本征值的虚数部分。


参数:newdata
New data frame to be used in prediction or in calibration.  Usually this a new community data frame, but with type = "lc" and for constrained component with type =     "response" and type = "working" it must be an environment data frame.  The newdata must have the same number of rows as the original community data for a cca result with type = "response" or type = "working".  If the original model had row or column names, then new data must contain rows or columns with the same names (row names for species scores, column names for "wa" scores and constraint names of "lc" scores). In other cases the rows or columns must match directly.  
新的数据框的预测中使用,或在校准。通常这是一个新的社区数据框,但type = "lc"和type =     "response"和type = "working"“”它必须是一个环境数据框的约束成分。 newdata必须具有相同的行数,原有的社区数据的ccatype = "response"或type = "working"。如果原始模型的行或列名,则必须包含新的数据行或列具有相同的名称(列名物种的成绩,列名"wa"成绩和约束名称"lc"分数)。在其他情况下的行或列必须直接匹配。


参数:type
The type of prediction, fitted values or residuals: "response" scales results so that the same ordination gives the same results, and "working" gives the values used internally, that is after Chi-square standardization in cca and scaling and centring in rda. In capscale the "response" gives the dissimilarities, and "working" the scaled scores that produce the dissimilarities as Euclidean distances. Alternative "wa" gives the site scores as weighted averages of the community data, "lc" the site scores as linear combinations of environmental data, and "sp" the species scores. In predict.decorana the alternatives are scores for "sites" or "species".
类型的预测,拟合值和残差:"response"尺度的结果,同样的配合给出了相同的结果,"working"给出了内部使用的值后,卡方标准化,这是<X >的缩放和围绕在cca。在rda,capscale给的异同,和"response"量表分数产生相异的欧氏距离。替代"working"给出的现场评分的加权平均值社会数据,"wa"#环境数据的线性组合,和"lc"种分数。在"sp"的替代品是分数predict.decorana或"sites"。


参数:rank
The rank or the number of axes used in the approximation. The default is to use all axes (full rank) of the "model" or all available four axes in predict.decorana.
职级或数轴,用于在逼近。默认值是使用所有的轴(满级),"model"或所有可用的4轴predict.decorana。


参数:scaling
Scaling or predicted scores with the same  meaning as in cca, rda and capscale.
缩放或预测分数具有相同的含义,在cca,rda和capscale。


参数:...
Other parameters to the functions.
功能的其他参数。


Details

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

Function fitted gives the approximation of the original data matrix or dissimilarities from the ordination result either in the  scale of the response or as scaled internally by the function.  Function residuals gives the approximation of the original data from the unconstrained ordination.  With argument type = "response" the fitted.cca and residuals.cca function  both give the same marginal totals as the original data matrix, and their entries do not add up to the original data.  Functions fitted.capscale and residuals.capscale give the dissimilarities with type = "response", but these are not additive, but the "working" scores are additive.  All variants of fitted and residuals are defined so that for model mod <- cca(y ~ x), cca(fitted(mod)) is equal to constrained ordination, and cca(residuals(mod)) is equal to unconstrained part of the ordination.
函数fitted给出的近似的原始数据矩阵或相异的协调结果,无论是在规模的反应,或由该函数内部缩放。函数residuals给出了近似的原始数据从不受约束的协调。参数type = "response"fitted.cca和residuals.cca功能相同的边际总数的原始数据矩阵,和他们的作品加起来也不到原始数据。功能fitted.capscale和residuals.capscale给的异同与type = "response",但这些都不是添加剂,但"working"分数添加剂。 fitted和residuals定义的所有变体的模型mod <- cca(y ~ x),cca(fitted(mod))等于约束的协调,cca(residuals(mod))等于为无约束的部分协调。

Function predict can find the estimate of the original data matrix or dissimilarities (type = "response") with any rank. With rank = "full" it is identical to fitted.  In addition, the function can find the species scores or site scores from the community data matrix for cca or rda. The function can be used with new data, and it can be used to add new species or site scores to existing ordinations.  The function returns (weighted) orthonormal scores by default, and you must specify explicit scaling to add those scores to ordination diagrams. With type = "wa" the function finds the site scores from species scores. In that case, the new data can contain new sites, but species must match in the original and new data.  With type   = "sp" the function finds species scores from site constraints (linear combination scores). In that case the new data can contain new species, but sites must match in the original and new data. With type = "lc" the function finds the linear combination scores for sites from environmental data. In that case the new data frame must contain all constraining and conditioning environmental variables of the model formula. With type = "response" or type =   "working" the new data must contain envinronmental variables if constrained component is desired, and community data matrix if residual or unconstrained component is desired.  With these types, the function uses newdata to find new "lc" (constrained) or "wa" scores (unconstrained) and then finding the response or working data from these new row scores and species scores.  The original site (row) and species (column) weights are used for type = "response" and type = "working" in correspondence analysis (cca) and therefore the number of rows must match in the original data and newdata.
函数predict可以找到的原始数据矩阵或不同点(type = "response")任何职级的估计。随着rank = "full"是相同的fitted。此外,该功能可以找到的物种分数或网站评分为cca或rda从社区数据矩阵。该函数可以被用于用新的数据,并且它可以被用于添加新的物种或新的站点分数现有祝。该函数返回(加权)默认情况下,正交的分数,而你必须指定明确的scaling添加这些成绩的协调图。 type = "wa"的功能发现几十种分数的网站。在这种情况下,新的数据可以包含新的站点,但物种必须匹配的原始数据和新的数据。 type   = "sp"的功能发现物种的分数从场地的限制(线性组合的分数)。在这种情况下,新的数据可以包含新的物种,但网站必须在原有的和新的数据相匹配。用type = "lc"的功能,网站环境数据的线性组合的分数。在这种情况下,新的数据框必须包含所有约束和环境调节变量模型公式。 type = "response"或type =   "working"新的数据必须包含envinronmental变量约束的组成部分,需要和社区数据矩阵如果残留或无约束的组件。使用这些类型,该函数使用newdata找到新的"lc"(约束)或"wa"分数(不受限制),然后找到响应或工作数据,从这些新行的分数和物种分数。原网站(行)和物种(列)的权重用于type = "response"和type = "working"的对应分析(cca),所以行数必须与在原始数据和 newdata。

If a completely new data frame is created, extreme care is needed defining variables similarly as in the original model, in particular with (ordered) factors. If ordination was performed with the formula interface, the newdata also can be a data frame or matrix, but extreme care is needed that the columns match in the original and newdata.
如果是创建一个完全新的数据框,需要格外小心定义变量相同,在原有机型,尤其是(有序)的因素。如果协调的公式接口,newdata也可以是一个数据框或矩阵,但需要格外小心,列匹配的原件和newdata。

Function calibrate.cca finds estimates of constraints from community ordination or "wa" scores from cca, rda and capscale. This is often known as calibration, bioindication or environmental reconstruction. Basically, the method is similar to projecting site scores onto biplot arrows, but it uses regression coefficients.  The function can be called with newdata so that cross-validation is possible.  The newdata may contain new sites, but species must match in the original and new data  The function does not work with "partial" models with Condition term, and it cannot be used with newdata for capscale results.  The results may only be interpretable for continuous variables.
函数calibrate.cca发现制约社会协调或"wa"cca,rda和capscale得分的估计。这通常被称为的校准,bioindication或环境重建。基本上,方法是类似投影的网站得分上双标图箭头,但它使用的回归系数。该功能可以调用newdata“这样的交叉验证是可能的。可能包含newdata新的网站,但物种必须在原有的和新的数据相匹配的功能部分模型Condition术语不工作,而不能使用newdata 为capscale的结果。“结果可能只能解释为连续变量。

Function coef will give the regression coefficients from centred environmental variables (constraints and conditions) to linear combination scores. The coefficients are for unstandardized environmental variables. The coefficients will be NA for aliased effects.
功能coef中心的环境变量(限制条件)的回归系数的线性组合的分数。系数是对于非标准化的环境变量。系数将NA混叠效果。

Function predict.decorana is similar to predict.cca. However, type = "species" is not available in detrended correspondence analysis  (DCA), because detrending destroys the mutual reciprocal averaging (except for the first axis when rescaling is not used). Detrended CA does not attempt to approximate the original data matrix, so type = "response" has no meaning in detrended analysis (except with rank = 1).
功能predict.decorana是类似predict.cca。然而,type = "species"是不是可以在除趋势对应分析(DCA),因为去趋势破坏了相互倒数平均(第一轴不使用时重新缩放除外)。降趋CA不尝试近似的原始数据矩阵,所以type = "response"已经没有意义了去趋势分析(除rank = 1的)。


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

The functions return matrices, vectors or dissimilarities as is appropriate.
这些函数返回矩阵,向量或不同点是适当的。


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


Jari Oksanen.



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

analysis. Academic Press, London.

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

cca, rda, capscale,
cca,rda,capscale,


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


data(dune)
data(dune.env)
mod <- cca(dune ~ A1 + Management + Condition(Moisture), data=dune.env)
# Definition of the concepts 'fitted' and 'residuals'[的概念的定义嵌合和残差]
mod
cca(fitted(mod))
cca(residuals(mod))
# Remove rare species (freq==1) from 'cca' and find their scores[珍稀物种(频率== 1)从“文建会”,并找到他们的成绩]
# 'passively'.[“被动”。]
freq <- specnumber(dune, MARGIN=2)
freq
mod <- cca(dune[, freq>1] ~ A1 + Management + Condition(Moisture), dune.env)
predict(mod, type="sp", newdata=dune[, freq==1], scaling=2)
# New sites[新网站]
predict(mod, type="lc", new=data.frame(A1 = 3, Management="NM", Moisture="2"), scal=2)
# Calibration and residual plot[校准和残差图]
mod <- cca(dune ~ A1 + Moisture, dune.env)
pred <- calibrate(mod)
pred
with(dune.env, plot(A1, pred[,"A1"] - A1, ylab="Prediction Error"))
abline(h=0)

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-27 02:47 , Processed in 0.027820 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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