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

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

[复制链接]
发表于 2012-9-30 02:29:06 | 显示全部楼层 |阅读模式
diffslope(simba)
diffslope()所属R语言包:simba

                                         Calculate the difference in slope or intercept of two regression lines
                                         计算两个回归线的斜率或截距的差异

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

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

The function can be used to calculate the difference in slope between two datasets containing each two vectors. Follows an idea of Nekola & White (1999) for calculating the statistical inference of the difference in slope between two regression lines. diffslope2 has the same purpose as diffslope but implementation is without for-loop. The plot method allows easy plotting of the actual difference in slope against the distribution of permuted values.
该函数可以被用来计算在两个数据集之间,包含每两个向量的斜率的差异。如下的想法Nekola与白(1999)计算的统计推断的两个回归线的斜率之间的差异。 diffslope2具有相同的目的作为diffslope但实施是未经for循环。在斜坡的实际差异,对置换值的分布图法可以方便地绘制。


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


diffslope(x1, y1, x2, y2, permutations = 1000, ic = FALSE,
                resc.x = FALSE, resc.y = TRUE, trace=FALSE, ...)
        
diffslope2(x1, y1, x2, y2, permutations = 1000, resc.x = FALSE,
        resc.y = TRUE, ...)
        
diffic(x1, y1, x2, y2, permutations = 1000, resc.x = FALSE,
        resc.y = FALSE, trace=FALSE, ...)
        
## S3 method for class 'dsl'
plot(x, y, ...)



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

参数:x1
vector containing an independent variable (for instance distance between plots).  
包含一个独立的变量的向量(例如图之间的距离)。


参数:y1
vector containing a variable dependent on x1 (for instance similarity between the plots. must have the same length as x1.  
向量的一个变量依赖于x1(例如图之间的相似度。必须具有相同的长度x1。


参数:x2
vector containing a second independent variable (for instance distance between plots). can be the same as in x1.  
向量的第二个独立变量(例如图之间的距离)。可以是相同的,在x1。


参数:y2
vector containing a variable dependent on x2 (for instance similarity between the plots. must have the same length as x2.  
向量的一个变量依赖于x2(例如图之间的相似度。必须具有相同的长度x2。


参数:permutations
number of permutations  
的排列数


参数:ic
Shall the difference in intercept be tested? Defaults to FALSE.  
在拦截的差异进行测试?默认为FALSE的。


参数:resc.x
Shall the values of the independent variables be rescaled to a common mean? Defaults to FALSE.
应的独立变量的值被重新调整到一个共同的意思吗?默认为false。


参数:resc.y
Shall the values of the dependent variables be rescaled to a common mean? Defaults to TRUE (Nekola & White 1999) for diffslope and to FALSE for diffic.  
应因变量的值被重新调整到一个共同的意思吗?默认为TRUE(Nekola 1999年与白)为diffslope为FALSE diffic。


参数:trace
Set to true if progress shall be printed with increasing numbers. Defaults to FALSE  
设置为true,如果应印有越来越多的进步。默认为false


参数:...
Arguments to other functions (for instance to lm, which is used to calculate the regression lines).  
参数传递给其他函数(例如lm,它被用来计算回归线)。


参数:x
dsl-object (given back by diffslope or diffic) which is to be plotted.  
dsl对象(还给diffslope或diffic),这是被绘制。


参数:y
Plotting object, usually not necessary  
绘制对象,通常是没有必要的


Details

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

diffslope: As the function was initially build to easily calculate the difference in slope between the regression lines of distance decay plots, the independent vectors are meant to contain distance values whereas the dependent vectors should represent similarity values. But you can use it for anything else, as you wish. The vectors belonging together are formed into a data.frame. For each permutation run the rows are interchanged randomly between the two data.frames and the difference in slope calculated thereafter is calculated and collected into a vector. The p-value is then computed as the ratio between the number of cases where the differences in slope exceed the difference in slope of the inital configuration and the number of permutations.
diffslope的功能初步建成,很容易计算出距离衰减曲线的回归线的斜率之间的差异,是独立的向量包含依赖向量的距离值,而应该代表相似度值。但是你可以用它做别的事情,如你所愿。属于在一起的向量形成为数据框。对于每个置换运行的行互换之间随机的2data.frames和计算,随后计算并收集成一个向量的斜率的差异。然后,计算p-值的数目之间的比率的情况下,在斜坡的差异超过斜率>初始配置和排列的数目差异。

The same applies to diffic. However, this function tests whether the intercepts of the two relationships are significantly different. Although resc.y has been kept as an option, it is not wise to do so, when one is testing for differences in intercept.
这同样适用于diffic。但是,此功能测试的两个关系的截距是否是显着不同的。虽然resc.y已被作为一个选项,它这样做是不明智的,当一个测试中截取的差异。

If the difference in slope returns negative, the slope (distance decay) of the second relationship is less pronounced, if it returns positive, the second relationship exhibits a stronger distance decay (slope) than the first. This holds for distance decay relationships. If y increases with x, it is vice versa.
如果差值在边坡返回否定的,则所述第二关系的斜率(距离衰减)是不太明显的,如果它返回正,第二关系表现出更强的距离衰减(斜率)比所述第一。这适用于距离衰减关系。如果y与x增加,反之亦然。

As it uses a for loop, it takes a while to calculate. So get a coffee while it is running, or set trace to TRUE to avoid being bored ...
由于它采用的是for循环,它需要一段时间来计算。所以在运行时,喝杯咖啡,或设置trace为TRUE,以避免无聊...


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

Returns a list giving the function call, the difference in slope, the significance of this difference, and the number of permutations. If you want to change the way lm is computed you must send the arguments to lm via .... Per default it is calculated with the default arguments of lm.
返回一个列表,给出的函数调用,边坡的差异,这种差异的重要意义,以及数的排列。如果你想改变的方式lm计算,你必须发送的参数lm通过......每默认情况下,它计算出的与默认参数lm。

In case of diffic there is still differences in slope reported (although differences in intercept have been calculated). So it's just a false label here. This will be updated soon.
在的情况下,diffic仍然是有差异的斜率(虽然在拦截的差异已计算)。所以它只是一个虚假标签。这将更新很快。


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


Gerald Jurasinski



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

similarity in biogeography and ecology. Journal of Biogeography  26: 867-878.
(2005) Predicting Regional Patterns of Similarity in Species  Composition for Conservation Planning. Conservation Biology 19:  1978-1988.
(2006) Environment, dispersal and patterns of species similarity.  Journal of Biogeography 33: 1044-1054.

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

lm, sample
lm,sample


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


data(abis)
names(abis.env) ##take a look at the data[来看看在数据]
pert.dist <- 1-vegdist(abis.env[,19:25], "euclidean")
##calculate the distance (Euclidean) between the plots [#计算的图之间的距离(欧氏)]
##regarding disturbance variables[#干扰变量]

soil.dist <- 1-vegdist(abis.env[,c(6,27:28)])
##calculate the similarity (Bray-Curtis) between the plots [#相似度计算(布雷柯蒂斯)之间的图]
##regarding soil parameters[#关于土壤参数]

##calculate geographical distance between plots[#图之间的GEO距离计算]
coord.dist <- dist(abis.env[,1:2])

##transform all distance matrices into list format:[#把所有的距离矩阵,列表格式:]
struc.dist.ls <- liste(pert.dist, entry="BC.struc")
soil.dist.ls <- liste(soil.dist, entry="BC.soil")
coord.dist.ls <- liste(coord.dist, entry="dist")

##create a data.frame containg plot information, geographical [#创建一个的数据框containg图的信息,GEO]
##distance,similarity of soil parameters, and similarity of [#距离,土壤参数的相似性,相似]
##structural parameters:[#结构参数:]

df <- data.frame(coord.dist.ls, soil.dist.ls[,3], struc.dist.ls[,3])
names(df) ##see names[#见名]

##give better names:[#提供更好的名称:]
names(df)[4:5] <- c("soil","struc")
attach(df)

##prepare graphics device:[#准备图形设备:]
par(mfrow=c(2,1))

##plot and compare distance decay (decrease of similarity with [#图和距离衰减比较(减少的相似性]
##distance):[#距离):]
plot(dist, soil)
plot(dist, struc)
##remove problematic zero entries:[#删除有问题的零项:]
df <- subset(df, struc != 0)

##plot again, this time with regression lines (in red for better [#图再次,这一次回归线(红色为更好地]
##visability):[#visability):]
detach(df)
attach(df)
plot(dist, soil)
abline(lm(soil~dist), col="red4")
plot(dist, struc)
abline(lm(struc~dist), col="red4")
##is the slope significantly different?[#显着的斜率是不同的吗?]
res <- diffslope(dist, soil, dist, struc)
res2 <- diffic(dist, soil, dist, struc)

##go for a coffee, as it takes a while...[#去喝杯咖啡,因为它需要一段时间...]


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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-5-23 13:24 , Processed in 0.021877 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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