pcol(simba)
pcol()所属R语言包:simba
Permuted Correlation (on strata)
置换的相关性(地层)
译者:生物统计家园网 机器人LoveR
----------Description----------
The function is a wrapper for several functions related to the permuted correlation between distance matrices: calculate permuted correlation between vectors or calculate permuted correlation on strata. This can be useful to obtain data-points for a multivariate Mantel correlogram. Two matrices and a matrix dividing these into strata (levels) are to be specified.
该功能是封装置换的距离矩阵之间的相关性相关的几个功能:计算的置换向量之间的相关性或计算置换的相关阶层。这可能是有用的,获得的多元曼特尔相关图的数据点。两个矩阵和矩阵划分到这些阶层(水平)将被指定。
用法----------Usage----------
pcol(x, y = NULL, z = NULL, width = NULL, bins = 5, method = "pearson",
permutations = 1000, alpha = 0.5, trace = FALSE, ...)
mantl(x, y, method = "pearson", permutations = 1000, sub = NULL,
loop = FALSE, ...)
## S3 method for class 'mantl'
plot(x, y, ...)
参数----------Arguments----------
参数:x
dist-object containing distances or similarities returned by sim, vegdist, dist, dist.binary or a complete resemblance matrix (nrow==ncol). For the plotting method a mantl-object.
dist对象的距离或相似返回sim,vegdist,dist,dist.binary或一个完整的相似矩阵(NROW == NCOL)。对于一个mantl对象的绘图方法。
参数:y
A similar object like x with the same dimensions representing resemblance between the same objects as for x but based on other variables. Defaults to NULL. See details
类似的物体,比如x具有相同的尺寸,相同的对象的x,但根据其他变量之间的相似性。默认为NULL的。查看详细资料
参数:z
A similar object like x containing distances or distance classes. If the latter is true set width to 1 (bins is without effect then). If y is provided the function calculates Mantel statistic for the correlation between x and y on the strata that are defined by z. If y is not given the function correlates the x against the classes in z leading to data points for a multivariate Mantel correlogram in the sense of Olden & Sokal (1986). See details.
类似的物体,如x的距离或距离班。如果是后者是真正集width(bins是没有效果的话)。如果y提供的函数计算曼特尔统计之间的相关性x和y阶层所定义的z。如果y的功能没有给出相关的x对类z在这个意义上的古代索卡尔(1986)的多元曼特尔相关图的数据点。查看详细信息。
参数:width
Numeric. If width=1 z is assumed to contain classes already. If width is NULL (default), the classes are defined inside the function by using bins to derive n = bins distance classes that span the same distance range. If width is specified this gives the bin width instead of a number of bins.
数字。如果width= 1z已经被假定为包含类。如果width是NULL(默认),类的定义在函数内部使用bins得出n = bins距离的类,涵盖了相同的距离范围内。如果width指定给的的bin宽度,而不是一些箱。
参数:bins
Numeric. If width is NULL (default), the distance classes derived from z are defined inside the function by using bins to derive n = bins distance classes that span the same distance range. Defaults to 5 bins.
数字。如果width是NULL(默认),距离派生类的z的定义在函数内部使用bins得出n = bins的距离班的跨越同样的距离范围内。默认为5箱。
参数:method
Method of correlation, as it is done by cor.test, see help there for details. Defaults to Pearson correlation coefficients. Other options are Kendall and Spearman rank correlations.
参数:permutations
Integer giving the number of permutations in mantl, defaults to 1000 to get a significance level of p = 0.001.
mantl,默认的排列数到1000的整数获得显着性水平P = 0.001。
参数:alpha
Numeric. The initial alpha-level against which should be tested. In case of testing on strata (z != NULL)it is internally corrected using Bonferronis method.
数字。初始alpha级对应测试。 z != NULL在地层(测试的情况下),它在内部使用Bonferronis方法校正。
参数:trace
Logical. Set to TRUE to follow the calculation succession in case x, y, and z are specified.
逻辑。按照计算继承的情况下x,y和z指定,设置为TRUE。
参数:...
Arguments to other functions, for instance to cor.test regarding specifications of the test, however only the correlation value is taken from this function. but here you could change from pearson to kendall for instance.
其他函数的参数,例如为cor.test的测试规格,但只有相关值被此功能。但在这里,你可以改变从多伦多皮尔逊肯德尔的实例。
参数:sub
If Case is 1 (see details) a subset of cases from x and y can be defined for correlation. Therefore, sub has to be a logical matrix with the same dimensions as a matrix derived from x and y.
如果情况是1(见details)的情况下,从x和y可以定义为相关的一个子集。因此,sub是一个逻辑矩阵与尺寸相同的矩阵来自x和y的。
参数:loop
Triggers the method for permutation inside the function mantl. Shall it be looped (for-loop, loop = TRUE) or be done by an apply method (loop = FALSE)? Determines speed. For many reasonably huge data sets, the latter will be faster. However, when the datasets get really huge it may run faster on for-loops.
触发器的功能mantl内的置换方法。环(for循环,loop = TRUE)或通过一个apply(loop = FALSE)?确定速度。对于许多相当庞大的数据集,后者会更快。然而,当数据集获得非常巨大的,它可能会运行得更快for循环。
Details
详细信息----------Details----------
pcol is doing the handling whereas all permutations are done with mantl. Depending on what is given to y, z, and width and bins respectively, the following is carried out:
pcol做处理,而所有的排列组合已经完成了mantl。根据y,z和width和bins,下面是进行:
If x and y are given but z = NULL a simple permuted correlation with mantl is run. This corresponds to a Mantel test. The two data-objects are correlated with cor, then the rows and corresponding rows in y are permuted and with cor the correlation is calculated again. This is repeated permutation times. Finally, the initial correlation value is compared to the permuted values. The number of times, the permuted values exceed the initial value is divided by the number of permutations to obtain a significance value. Thus, with 1000 permutations a minimum p of 0.001 can be tested. A diagnostic plot of the resulting object of class permcor can be plotted with the corresponding plot function.
如果x和y但是z = NULL的一个简单的置换相关mantl运行。这对应到Mantel检验。这两个数据对象与cor,然后行和相应的行中y被置换,并用cor的相关性被重新计算。这被重复permutation倍。最后,初始相关值被置换后的值相比。的次数,对置换后的值超过初始值的排列数除以得到的显着性值。因此,用1000排列的最小p为0.001可以进行测试。图生成的对象的类permcor的诊断,可以绘制出相应的曲线功能。
If x, y, and z are given, the permuted correlation is done for every stratum or level given by z - this could e.g. be direction or distance classes flagging which plots share a similar distance and therefore fall into the same class. If z is a distance matrix or dist-object width or bins have to be specified to obtain distance classes. If run with defaults the function finds 5 classes (bins) of equal distance range. The resulting data-points can be used to plot a correlogram which allows for the analysis of non-stationarity in the relationships between x and y.
如果x,y,置换后的相关z是给定的,为每一个阶层或电平由Z - 这可能会如它描绘有着相似的距离,并因此陷入同一类的方向或距离班标记。如果z是一个距离矩阵或dist对象width或bins一定要指定,以获得距离班。如果用默认的运行函数发现5类(bins),相等的距离范围内。所得到的数据点可以用来绘制一个相关函数,它允许分析在x和y之间的关系的非平稳。
If x and z are specified and y = NULL, the matrix or vector in x is correlated against the classes given in or derived from z. This produces the data-points for a multivariate Mantel correlogram in the sense of Oden & Sokal (1986) (see also Legendre & Legendre 1998 for a comprehensive coverage of the subject).
如果x和z指定y = NULL,x矩阵或向量与对班或来自z。这将产生在这个意义上奥登索卡尔(1986)的多元曼特尔相关图的数据点(见勒让德勒让德1998年全面覆盖的主题)。
值----------Value----------
Returns different objects, depending on given arguments and triggers.
返回不同的对象,根据给定的参数和触发器。
In case 1 a permcor-object with the following items is returned:
在第一种情况下一个permcor对象返回以下项目:
参数:call
The call to the function.
调用该函数。
参数:method
The correlation method as used by cor.test.
所使用的cor.test的相关方法。
参数:statistic
The initial correlation value which is tested against the permuted values.
初始相关值的测试是针对置换后的值。
参数:signif
The significance of the calculation.
计算的意义。
参数:n
The number of cases.
情况的数量。
参数:permutations
The number of permutations as specified by permutations.
所指定的permutations排列的数量。
参数:perms
The result of the permuted runs. It is not printed by default but can be accessed via result\$perms. The correlation value can be plotted against an histogram of the distribution of the permuted values to visualize the significance with the default plotting method.
置换后的运行的结果。默认情况下,不打印,但可以通过result\$perms。可以绘制的相关值,对一个置换后的值,以默认的作图方法的意义与可视化的分布直方图。
In cases 2 and 3 a pclist-object with the following items is returned. It might be as well worth to set trace = TRUE to display the progress of the calculation because it can take a while:
情况2和3pclist对象的下列项目将被返回。这可能是非常值得的设置trace= TRUE显示进度的计算,因为它可能需要一段时间:
参数:call
The call to the function.
调用该函数。
参数:method
The correlation method as used by cor.test.
所使用的cor.test的相关方法。
参数:gesN
The total number of cases.
情况的总数。
参数:strata
The number of strata (or levels) for which permutation has been done.
地层(或水平)的置换已经完成。
参数:permutations
The number of permutations as specified by permutations.
所指定的permutations排列的数量。
参数:out
A data.frame with 3 columns containing the result for each stratum in the rows: statistic contains the correlation values for the corresponding stratum, sig the obtained significance, and nop the number of cases found and used for permutation on this very level.
Adata.frame 3列包含结果行中的每一个阶层:statistic包含的相关值对应的地层,sig所获得的意义,和nop数发现和使用的情况下,这个水平排列。
注意----------Note----------
Depending on what is done and the size of the matrices it may take a while to calculate. The slowest is case 3.
根据是什么做的矩阵的大小,它可能需要一段时间来计算。最慢的情况下,3。
(作者)----------Author(s)----------
Gerald Jurasinski <a href="mailto:gerald.jurasinski@uni-rostock.de">gerald.jurasinski@uni-rostock.de</a>
参考文献----------References----------
参见----------See Also----------
mantel for a different implementation of Mantel tests, cor.test
mantel不同的实现,经过Mantel,cor.test
实例----------Examples----------
data(abis)
## calulcate soerensen of species data[#calulcate瑟伦森的物种数据。]
abis.soer <- sim(abis.spec)
## calculate distance (Euclidean) regarding some disturbance [#计算对于一些干扰的距离(欧几里得)]
## variables (feces counts)[#变量(粪便计数)]
abis.pert <- dist(abis.env[,19:25])
## are compositional similarity and dissimilarity of disturbance related?[#组成的相似性和差异性的干扰有关吗?]
pcol(abis.soer, abis.pert)
## the relationship is significant, but not very strong[#的关系是重要的,但不是很强烈]
## compare one resemblance matrix with several others[#比较相似矩阵与其他几个人]
# we compare bray-curtis against this selection of indices:[我们比较布赖柯蒂斯对本次评选指标:]
indices <- c("soerensen", "jaccard", "ochiai", "mountford", "whittaker",
"lande", "wilsonshmida", "cocogaston", "magurran", "harrison")
# we use mantl() inside a sapply call[内sapply呼叫我们使用mantl的()]
t(sapply(indices, function(x) unlist(mantl(vegdist(abis.spec), sim(abis.spec, method=x))[3:5])))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|