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

R语言 smatr包 slope.com()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-30 10:15:37 | 显示全部楼层 |阅读模式
slope.com(smatr)
slope.com()所属R语言包:smatr

                                         Common slope test amongst several allometric lines
                                         几个异速生长线之间的共同斜率测试

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

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

Test if several major axis or standardised major axis lines share a common slope. This can now be done via sma(y~x*groups), see help on the sma function.
测试,如果几大轴或标准化的主要轴线都有一个共同的斜坡。现在可以通过sma(y~x*groups)信息,请参阅上的sma功能的帮助。


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


slope.com(y, x, groups, method = 'SMA', alpha = 0.05,
   data = NULL, intercept = TRUE,
   V = array(0, c(2, 2, length(unique(groups)))),
   group.names = sort(unique(groups)),
   ci = TRUE, bs = TRUE, slope.test=NULL)



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

参数:y
The Y-variable for all observations (as a vector)  
Y-的所有观测的变量(作为一个向量)


参数:x
The X-variable for all observations (as a vector)  
X-变量的所有观测值(作为一个向量)


参数:groups
Coding variable identifying which group each observation belongs to (as a factor or vector)  
编码变量确定每个观测值属于哪个组(作为一个因素或矢量)


参数:method
The line fitting method:     
该生产线拟合的方法:

'SMA' or 1standardised major axis (this is the default)  
“SMA”或1standardised长轴(这是默认设置)

'MA' or 2major axis  
MA或2major轴的

'lamest' or 3Error variance ratio is estimated from the data     
lamest或3Error的方差比从数据估计


参数:alpha
The desired confidence level for the 100(1-alpha)% confidence interval for the common slope. (Default value is 0.05, which returns a 95% confidence interval.)  
所需的置信水平为100(1-α)%置信区间为共同斜率。 (默认值是0.05,它返回一个95%的置信区间)。


参数:data
(optional) data frame containing the data  
(可选的)数据框包含的数据


参数:intercept
(logical) Whether or not the line includes an  intercept.     
(逻辑)是否该系列包括拦截。

FALSE no intercept, so the line is forced through the origin   
FALSE没有拦截,因此被强制通过原点

TRUE an intercept is fitted (this is the default)      
TRUE拦截安装(这是默认的)


参数:V
The estimated variance matrices of measurement error, for each group. This is a 3-dimensional array with measurement error in Y in the first row and column, error in X in the second row and column, and groups running along the third dimension. Default is that there is no measurement error.  
测量误差的估计方差矩阵,每个组。与Y中的测量误差的第一行和列中,X中的第二行和列中的错误,并沿第三维度上运行的组中,这是一个3维阵列。默认是不存在测量误差。


参数:group.names
(optional: rarely required). A vector containing the labels for "groups". (Only actually useful for reducing computation time in simulation work).  
(可选:很少需要)。一个向量“组”的标签。 (实际上只用在模拟工作,减少计算时间)。


参数:ci
(logical) Whether or not to return a confidence interval for the common slope.  
(逻辑)是否返回一个共同斜率的置信区间。


参数:bs
(logical) Whether or not to return the slopes for the separate groups, with confidence intervals.  
(逻辑)是否返回的斜坡不同的群体,与置信区间。


参数:slope.test
If a value provided, tests the common slope fit against this value.
如果提供的值,测试适合对这种价值的共同斜率。


Details

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

For several bivariate groups of observations, this function tests if the line-of-best-fit has a common slope for all samples, when the line-of-best-fit is estimated using the major axis, standardised major axis, or a more general version of these methods in which the error variance ratio is estimated from the data.
对于几种二元组观测,此功能的测试,如果线路的最佳拟合线的最佳拟合估计使用的主要轴线,标准化的长轴时,对所有样品,一个共同斜率或更这些方法的估计误差方差的比率从数据的一般版本。

The test assumes the following:
测试假设如下:

each group of observations was independently sampled
观察各组的独立采样

y and x are linearly related within each group
y和x是线性相关的每个组内的

residuals independently follow a normal distribution with equal variance at all points along the line, within each group
残差独立遵循沿线的所有点等于方差的正态分布,各组内

Note that we do not need to assume equal variance across groups, unlike in the standard test for common slope for linear regression.
请注意,我们并不需要承担平等的差异,各组,与常见的线性回归斜率的标准测试。

The assumptions can be visually checked by plotting residual scores against fitted axis scores, and by constructing a Q-Q plot of residuals against a normal distribution, available using the plot.sma function.
假设可以肉眼检查剩余的分数对装轴的分数,并通过构建的残留物对正常的分布,可使用plot.sma功能的QQ图的绘制。

The common slope is estimated from a maximum of 100 iterations, convergence is reached when the change in b is < 10^-6.
共同的斜率估计从最高的100次迭代时,达到收敛的变化在B中< 10^-6。


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


参数:lr
The (Bartlett-corrected) likelihood ratio statistic testing for common slope
(巴特利特校正)共同的斜率似然比统计测试


参数:p
The P-value of the test. This is calculated assuming that lr has a chi-square distribution with (g-1) df, if there are g groups
P-值的测试。这是假设,LR有一个卡方分布(G-1),DF,如果有G功能组


参数:b
The common slope estimate
共同斜率估计


参数:varb
The sample variance of the common slope
的共同斜率的样本方差


参数:ci
A 100(1-alpha)% confidence interval for the common slope
A 100(1-α)%置信区间为共同斜率


参数:lambda
The error variance ratio - the ratio of error variance in y to error variance in x. For MA, this is assumed to be 1. for SMA, this is assumed to be b^2. For the "lamest" method, the error variance ratio is estimated from the data under the common slope assumption.
误差方差的比率 - 在y在x误差方差的误差方差的比例。对于MA,这被假设为1。 SMA的,这被假设为b^2。对于lamest的方法,估计误差方差比从数据的共同斜率假设下。


参数:bs
The slopes and confidence intervals for data from each group.
各组数据的斜坡和置信区间。


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


Warton, D. <a href="mailtoavid.Warton@unsw.edu.au">David.Warton@unsw.edu.au</a>, translated to R by Ormerod, J. 2005-12-08



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




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

sma, line.cis, elev.com, shift.com
sma,line.cis,elev.com,shift.com


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


#load leaf longevity data[加载叶寿命数据]
data(leaflife)

#plot the data, with different symbols for different groups.[绘制数据,为不同的群体用不同的符号。]
plot(leaflife$lma, leaflife$longev, type='n', log='xy', xlab=
   'leaf mass per area [log scale]', ylab='leaf longevity [log scale]')
colours <- c('blue', 'red', 'green', 'yellow')
points(leaflife$lma, leaflife$longev,
   col=colours[as.numeric(leaflife$site)])
legend(55, 5, as.character(unique(leaflife$site)), col=colours,
   pch=rep(1,4))

#test for common SMA slope of log(leaf longevity) vs log(LMA),[试验共同SMA斜率log(叶长寿)与log(LMA),]
#across species sampled at different sites:[跨物种在不同的地点采样:]
fit <- slope.com(log10(longev), log10(lma), site, data = leaflife)
fit

#Residual vs fits plots for SMA fit of each site[剩余对符合图适合每个站点SMA]
y <- log10(leaflife$longev)
x <- log10(leaflife$lma)
site <- leaflife$site
par( mfrow=c(2,2) )
plot(y[site==1] + fit$bs[1,1] * x[site==1], y[site==1] - fit$bs[1,1]
   * x[site==1], xlab='fits (site 1)', ylab='residuals (site 1)')
plot(y[site==2] + fit$bs[1,2] * x[site==2], y[site==2] - fit$bs[1,2]
   * x[site==2], xlab='fits (site 2)', ylab='residuals (site 2)')
plot(y[site==3] + fit$bs[1,3] * x[site==3], y[site==3] - fit$bs[1,3]
   * x[site==3], xlab='fits (site 3)', ylab='residuals (site 3)')
plot(y[site==4] + fit$bs[1,4] * x[site==4], y[site==4] - fit$bs[1,4]
   * x[site==4], xlab='fits (site 4)', ylab='residuals (site 4)')

#Test for common SMA slope amongst species at low rainfall sites[种在低雨量站点之间的共同SMA斜率测试]
#with different levels of soil nutrients[不同程度的土壤养分]
leaf.low.rain <- leaflife[leaflife$rain=='low',]
slope.com(log10(longev), log10(lma), soilp, data=leaf.low.rain)

#test for common MA slope:[测试共同MA坡:]
slope.com(log10(longev), log10(lma), site, data = leaflife,
   method='MA')

#test for common MA slope, and produce a 90% CI for the common slope:[测试常见的MA斜率,并产生一个90%CI为共同斜率:]
slope.com(log10(longev), log10(lma), site, data = leaflife,
   method='MA', alpha=0.1)


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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-5-26 11:07 , Processed in 0.037093 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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