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

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

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

                                         (Standardized) major axis estimation and testing for one or several samples
                                         (标准)的一个或多个样品的长轴的估计和检验

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

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

The sma and ma functions fit SMA and MA respectively, and construct confidence  intervals or test hypotheses about slope or elevation in one or several samples, depending on how the arguments  are specified. Options exist to force lines through the origin, (approximately) correct for measurement error if the  measurement error variance is known, and use robust estimation to ensure that inferences are valid in
sma和ma功能适合SMA和MA,构建置信区间或在一个或多个样品测试假设坡度或高程,根据参数被指定。选项存在的力线通过原点(约)正确的测量误差,测量误差的方差是已知的,并且使用强大的估计,以确保推论是有效的


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


sma(formula, data, subset, na.action, log="",
         method=c("SMA","MA","OLS"), type=c("elevation","shift"), alpha=0.05,
         slope.test=NA, elev.test=NA, multcomp=FALSE, multcompmethod=c("default","adjusted"),
         robust=FALSE,V=matrix(0,2,2),
         ...)



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

参数:formula
Formula of the form y ~ x etc. This determines whether a single (S)MA is fitted, or whether several lines are fitted and compared. See Details.
的形式的公式Y~X等,这确定是否为单个(S)MA嵌合,或几行是否被嵌合比较。查看详细信息。


参数:data
A dataframe with the x and y variables.
甲与变量x和y的数据框。


参数:subset
A subset of the dataframe for fitting; optional.
一个子集,的数据框用于安装;可选的。


参数:na.action
What to do with missing values (na.omit, na.fail, etc).
怎么办缺失值(na.omit,na.fail等)。


参数:log
One of 'x', 'y', or 'xy' to log10-transform variables.
其中的“x”,y的,或XYlog10的变换变量。


参数:method
If SMA, standardized major axis, if MA, major axis, and if OLS, ordinary least squares.
如果SMA,标准化的长轴,如果MA,长轴,如果OLS,普通最小二乘法。


参数:type
If several lines with common slope are to be compared, do you want to test for a change in 'elevation' or for a 'shift' along a common (S)MA. See Details.
如果有几个共同的斜率线进行比较,你想在“海拔”或“转移”沿着一个共同的(S)MA的测试。查看详细信息。


参数:alpha
The error rate for confidence intervals. Typically 0.05.
置信区间的错误率。通常情况下0.05。


参数:slope.test
The hypothesised value to be used, if testing for evidence that (S)MA slope(s) are significantly different from a hypothesised value.
推测的值被使用,如果测试的证据表明,(S)MA坡度(S)是从一个科学家的假设值显着不同。


参数:elev.test
The hypothesised value to be used, if testing for evidence that (S)MA elevation(s) are significantly different from a hypothesised value.
推测的值,如果使用的证据,(S)MA的抬高(S)是从一个科学家的假设值显着不同的测试。


参数:robust
If TRUE, uses a new method of robust line fitting. (Currently available for single-sample testing only.)
如果为true,则使用强大的线性拟合的一种新方法。 (目前仅适用于单个样本测试。)


参数:V
The estimated variance matrix of measurement error. Average measurement error for Y is in the first row and column, and average measurement error for X is in the second row and column.  The default is that there is no measurement error.
估计方差矩阵的测量误差。平均测量误差为Y中的第一行和列,和用于X的平均测量误差是在第二行和列。在默认情况下是不存在测量误差。


参数:multcomp
Logical. If TRUE, performs pair-wise comparisons between levels of the grouping variable.
逻辑。如果为TRUE,进行成对比较的分组变量之间的水平。


参数:multcompmethod
Whether to adjust the P values for multiple comparisons ('adjusted') or not ('default').
无论是调整的多重比较的P值(“调整”)或(“默认”)。


参数:...
Further arguments passed to internal functions (none at the moment?)
更多参数传递给内部函数(没有的时刻?)


Details

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

This is the key function in the smatr-package; all the key estimation and testing  functionality in the package can all be accessed using this function, via different usages of  the formula and other arguments, as described below.
这是最关键的功能在smatr-package;的估计和检验的所有关键功能包中都可以使用该功能来访问,通过不同用途的formula和其他参数,如下所述。

One-sample testing The below options allow estimation of a (S)MA, confidence intervals for parameters, and hypothesis testing of parameters, from a single sample of two variables y and x. Use the sma function to fit a standardised major axis (SMA), or use ma in combination with the below options in order to fit major axis (MA) instead.
样本测试下面的选项允许(S)MA,参数的置信区间,假设检验参数估计,从单个样品的两个变量y和x。使用sma功能,以适应标准化的长轴(SMA),或使用ma的组合,以适应主要轴(MA),而不是与下面的选项。




sma(y~x)  Fits a SMA and constructs confidence intervals for the true slope and elevation. Replaces the line.cis function from previous versions of smatr.
sma(y~x)适合的SMA和构建真正的坡度和海拔的置信区间。替换line.cis功能从以前版本的smatr。




ma(y~x)  Fits a MA and constructs confidence intervals for the true slope and elevation. All the below functions also work for MA, if the ma function is called instead of the sma function.
ma(y~x)适合MA,构建真正的坡度和海拔的置信区间。以下所有功能也适用于MA,,如果ma函数被调用,而不是sma功能。




sma(y~x, slope.test=B)  Tests if the slope of a SMA equals B.
sma(y~x, slope.test=B)测试,如果一个SMA的斜率等于B。




sma(y~x, elev.test=A)  Tests if the elevation of a SMA equals A.
sma(y~x, elev.test=A)测试,如果海拔的SMA等于A。




sma(y~x, robust=T)  Fits a SMA using Huber's M estimation and constructs confidence intervals for the true slope and elevation. This offers robustness to outliers in estimation and inference, and can be used in combination with the slope.test and elev.test arguments.
sma(y~x, robust=T)适合SMA使用Huber的M估计,并构造真正的坡度和海拔的置信区间。这提供离群值估计和推断的鲁棒性,并且可以组合使用与slope.test和elev.test论据。




sma(y~x-1)  Fits a SMA where the line is forced through the origin, and constructs confidence intervals for the true slope. This type of formula can be used in combination with the slope.test argument.
sma(y~x-1)适合SMA被强制通过原点的,和真正的斜坡构造的置信区间。这种类型的公式可以组合使用与slope.test参数。

For several samples: The below options allow estimation of several (S)MA lines, confidence intervals for parameters, and hypothesis testing of parameters, from two variables y and x for observations that have been classified into several different samples using the factor groups. Use the sma function to fit a standardised major axis (SMA), or use the ma in combination with the below options in order to fir major axis (MA) instead.
几样:以下选项允许数(S)MA线,参数的置信区间,假设检验参数估计,从两个变量y和x的观测,已分为几个不同的样品使用的因素groups。使用sma功能,以适应标准的长轴(SMA),或使用ma结合,与下列选项以杉木长轴(MA),而不是。




sma(y~x*groups)  Test if several SMA lines share a common slope, and construct a confidence interval for the true common slope.
sma(y~x*groups)测试,如果有几个的SMA线共用一个共同的斜率,构建真正的共同斜率的置信区间。




sma(y~x+groups, type="elevation")  Test if several common slope SMA lines also share a common elevation, and construct a confidence interval for the true common elevation.
sma(y~x+groups, type="elevation")测试如果有几个共同的斜率SMA线也都有一个共同的海拔,和真正的共同海拔构造一个置信区间。




sma(y~x+groups, type="shift")  Test if several groups of observations have no shift in location along common slope SMA lines.
sma(y~x+groups, type="shift")测试几组观察有没有共同的斜率SMA线位置沿转变。




sma(y~x*groups, slope.test=B)  Test if several SMA lines share a common slope whose true value is exactly equal to B.
sma(y~x*groups, slope.test=B)测试,如果几个SMA线共用真正值恰好等于B的一个共同的斜率。




sma(y~x+groups, elev.test=A)  Test if several common-slope SMA lines share a common elevation whose true value is exactly equal to A.
sma(y~x+groups, elev.test=A)测试,如果几种常见的斜率SMA线共享一个共同抬高,其真正的值恰好等于A的的。




sma(y~x*groups-1)  Test if several SMA lines forced through the origin share a common slope. This can also be used in combination with the slope.test argument or when testing for no shift along common (S)MA lines.
sma(y~x*groups-1)几个SMA线的测试,如果强行通过的起源都有一个共同的斜率。这也可以结合使用slope.test参数或当测试没有沿着共同的(S)MA线的移位。

In all cases, estimates and confidence intervals for key parameters are returned, and if a hypothesis test is done, results will be returned and stored in the slope.test or elev.test output arguments.
在所有情况下,返回了关键参数的估计和区间估计,如果假设进行测试,结果将被返回,并存储在slope.test或elev.test的输出参数。

The plot function can be applied to objects produced using the sma and ma functions, which is highly recommended to visualise results and check assumptions.
plot功能,可以使用sma和ma功能,这是强烈建议将结果可视化,并检查假设的对象。

Multiple comparisons If multcomp=TRUE, pair-wise comparisons are made between levels of the grouping variable for differences in slope, elevation or shift, depending on the formula used. The P values can be adjusted for multiple comparisons (using the Sidak correction). See also multcompmatrix for visualization of the results. Warning: When using the multiple comparisons (multcomp=TRUE), you must specify a data statement. If your variables are not in a dataframe, simply combine them in a dataframe before calling sma.
多重比较,如果multcomp = TRUE,成对比较的分组变量之间的水平差异,坡度,海拔或移位,根据所使用的公式。的P值可以调整进行多重比较(使用的通富校正)。 multcompmatrix可视化的结果。警告:当使用多重比较(multcomp = TRUE),则必须指定一个data声明。如果你的变量是不是在一个数据框,只需将他们的数据框前调用sma。


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

An object of class sma or ma, which contains the following output arguments:
一个对象的类sma或ma,其中包含以下输出参数:




coef  The coefficients of the fitted (standardised) major axes. If several samples are being compared, this will return parameters from the alternative model, e.g. assuming separate slopes if testing for common slope, or assuming common slope but separate elevations if testing for common elevation.
系数的系数的拟合(标准化)的长轴。如果有多个样本进行比较,这将返回参数的另一种模式,例如:假设独立的斜坡,如果测试常见的斜率,或承担共同的斜率,但独立的升高,如果测试常见的海拔。




nullcoef The coefficients under the null hypothesis
nullcoef系数的零假设下




alpha  As above.
阿尔法以上。




method  The method used in fitting lines: 'MA' or 'SMA'
方法该方法用于拟合直线:MA或SMA




intercept  Whether or not (S)MA lines were forced through the origin (True or False).
拦截(S)MA线是否被迫通过原点(True或False)。




call  The call to the ma or sma function.
叫ma或sma函数的调用。




data  As above.
如上数据。




log  As above.
如上登录。




variables  A list of the variables used in fitting (S)MA lines.
接头(S)MA线使用的变量,变量的列表。




origvariables  A list of the variables prior to transformation (if any) for use in fitting (S)MA lines.
origvariables甲前的变量列表转换(如果有的话)的拟合中使用(S)MA线。




groups Levels of the grouping variable, if present in the fit.
组水平分组变量,如果存在于拟合。




gt Type of grouptest ("slopecom","elevcom",or "shiftcom"), if it was carried out, or "none" if none.
GT型的grouptest(“slopecom”,“elevcom”,或“shiftcom)进行,或”无“,如果没有。




gtr The result of that grouptest.
GTR的该grouptest结果。




slopetest  Output from the hypothesis test of slope(s), if any. Returned as a list of objects, including the P-value (p), the test statistic (r or LR), the (common) slope (b) and its confidence interval (ci).
slopetest输出坡度(S)的假设检验,如果有的话。返回的对象列表,其中包括P-值(p),检验统计量(r或LR),(普通的)斜率(b)其置信区间(ci)。




elevtest  Output from the hypothesis test of elevation(s), if any. Returned as a list of objects, including the P-value (p), the test statistic (t or stat), the (common) elevation (a) and its confidence interval (ci).
elevtest输出从海拔(S)的假设检验,如果有的话。返回的对象列表,其中包括P-值(p),检验统计量(t或stat),(普通的)高程(a)其置信区间(ci)。




slopetestdone Whether a slopetest was actually carried out.
slopetestdone,无论实际上被执行了slopetest。




elevtestdone Whether an elevation test was actually carried out.
elevtestdone,是否抬高试验实际上被执行了。




n Sample size(s).
N个采样大小(s)。




r2 Squared correlation coefficient.
R2平方相关系数。




pval P-value of the test of correlation coefficient against zero.
pval的P-值的相关系数对零的考验。




from,to X values corresponding the maximum and minimum fitted values in each group. Used by plot.sma to determine endpoints for fitted lines).
从对应的最大和最小的拟合值在各组的X值。所使用的plot.sma确定拟合线的端点)。




groupsummary Neatly organized dataframe with coefficients by group.
groupsummary整齐地组织数据框各组的系数。


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


Warton, D. I. <a href="mailtoavid.Warton@unsw.edu.au">David.Warton@unsw.edu.au</a>, R.A. Duursma, D. Falster, S. Taskinen  



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






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

plot.sma
plot.sma


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



# Load leaf lifetime dataset:[加载叶一生数据集:]
data(leaflife)

### One sample analyses ###[##一###样品分析]
# Extract only low-nutrient, low-rainfall data:[只提取低营养,低降雨量数据:]
leaf.low <- subset(leaflife, soilp == 'low' &amp; rain == 'low')

# Fit a MA for log(leaf longevity) vs log(leaf mass per area):[装一个MA的log(叶长寿)和log(叶单位面积质量):]
ma(longev ~ lma, log='xy', data=leaflife)

# Test if the MA slope is not significantly different from 1:[测试如果MA坡是不显着的不同从1:]
ma.test <- ma(longev ~ lma, log='xy', slope.test=1, data=leaflife)
summary(ma.test)

# Construct a residual plot to check assumptions:[构建一个残差图检查假设:]
plot(ma.test,type="residual")

### Several sample analyses ###[#####的几个样品分析]

# Now consider low-nutrient sites (high and low rainfall):[现在考虑低营养的网站(高和低降雨量):]
leaf.low.soilp <- subset(leaflife, soilp == 'low')

# Fit SMA's separately at each of high and low rainfall sites,[适合SMA分别在每个高及低雨量站点,]
# and test for common slope:[测试常见的斜率:]
com.test <- sma(longev~lma*rain, log="xy", data=leaf.low.soilp)
com.test

# Plot longevity vs LMA separately for each group:[图的寿命比的LMA分别为各组:]
plot(com.test)

# Fit SMA's separately at each of high and low rainfall sites,[适合SMA分别在每个高及低雨量站点,]
# and test if there is a common slope equal to 1:[和测试,如果有一个共同的斜率等于1:]
sma(longev~lma*rain, log="xy", slope.test=1, data=leaf.low.soilp)

# Fit SMA's with common slope across each of high and low rainfall sites, [适合SMA的共同坡高及低雨量站点,在每个]
# and test for common elevation:[和测试共同海拔:]
sma(longev~lma+rain, log="xy", data=leaf.low.soilp)

# Fit SMA's with common slope across each of high and low rainfall sites, [适合SMA的共同坡高及低雨量站点,在每个]
# and test for no shift along common SMA:[和测试没有一起共同SMA的转变:]
sma(longev~lma+rain, log="xy", type="shift", data=leaf.low.soilp)


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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-5-26 10:46 , Processed in 0.039715 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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