plot.sma(smatr)
plot.sma()所属R语言包:smatr
Draw an X-Y plot
画一个X-Y图
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Plot a (standardized) major axis fit, including the data and the fitted lines. There are many options for changing the appearance of the plot and generating high-quality publishable graphs.
绘画(标准化)的长轴配合,包括数据和拟合线。有很多的选择改变外观的图和产生高品质的发布图表。
用法----------Usage----------
## S3 method for class 'sma'
plot(x, which = c("default", "residual", "qq"),
use.null = FALSE, add = FALSE, type = "o", xaxis = NULL,
yaxis = NULL, xlab = NULL, ylab = NULL, pch = NULL,
col = NULL, lty = NULL, from = NULL, to = NULL,
参数----------Arguments----------
参数:x
Object of class 'sma'.
对象类“形状记忆合金的。
参数:which
If 'residual', plots a residual plot; if 'qq', plots a qq plot; otherwise an x-y plot.
如果“剩余”,绘制残差图,如果QQ,图的QQ图,否则XY图。
参数:use.null
Logical. If FALSE, plots the fitted lines (the default), otherwise those corresponding to the null hypothesis.
逻辑。如果为FALSE,图的拟合线(默认值),否则相应的零假设。
参数:add
Logical. If TRUE, adds lines or points to an existing plot.
逻辑。如果是TRUE,线或点添加到现有的图。
参数:type
As in 'lm.default' : 'p' plots points only, 'l' only lines, and 'o' or 'b' plot both.
至于在“lm.default:P图点,L行,和O或B图。
参数:xaxis,yaxis
Special axis objects. See Details and examples.
特别轴对象。查看详细信息和例子。
参数:xlab,ylab
Labels for X and Y axes.
X和Y轴的标签。
参数:pch
Plotting symbols (see points).
绘图符号(见points“)。
参数:col
Color of points and lines.
点和线的颜色。
参数:lty
Line type (see lines).
线路类型(见lines“)。
参数:from,to
Min and max X values for the lines (defaults to values given by sma, which are the X values corresponding the maximum and minimum fitted values in the data.).
最小和最大的X值线(默认sma,它是对应的X值中的数据的最大值和最小值的拟合值的给定值。)。
参数:log
One of 'x','y' or 'xy', to denote which axes to log-scale.
一个X,Y或XY,表示轴登录规模。
参数:frame.plot
a logical indicating whether a box should be drawn around the plot, by default = TRUE.
逻辑一箱是否被周围绘制的图,默认= TRUE。
参数:tck
The length of tick marks as a fraction of the smaller of the width or height of the plotting region. If tck >= 0.5 it is interpreted as a fraction of the relevant side, so if tck = 1 grid lines are drawn. By default set to current system defaults (tck = par("tck")).
的刻度标记的长度的一小部分的小的绘图区域的宽度或高度。如果tck的> = 0.5,它被解释为有关侧的一小部分,因此,如果tck的= 1的网格线的绘制。默认情况下设置为当前系统的默认值(TCK = PAR(“TCK”))。
参数:...
Further arguments passed to plot.default.
进一步的参数传递给plot.default。
Details
详细信息----------Details----------
The plot.sma function produces one of three different types of plot, depending on the which argument.
plot.sma函数产生三种不同类型的图之一的,根据which参数。
The default plot, which="default", produced a plot of y vs x, with separate symbols for each group if appropriate, and MA or SMA lines fitted through each group. The formula used in the sma object that is input to the plot function determines whether there is a group structure, whether fitted lines have common slope, etc.
默认的图,which="default",产生了积y与x,与每个group单独的符号(如适用),并通过各组MA或SMA线安装。 sma的对象,该对象是输入plot函数中使用的公式确定是否存在的基团的结构,拟合线是否有共同斜率,等
A residual plot can be obtained via which="residual" - this is a plot of residuals against fitted values. This can be used to check assumptions - if assumptions are satisfied there should be no pattern.
可以通过which="residual"“ - 这是一个图的残差对拟合值的剩余图。这可以用来检验假设 - 如果假设是满意的,应该没有模式。
A normal quantile plot can be obtained via which="qq" - this is a normal quantile plot of residuals. This can be used to check the normality assumption - if data are close to a straight line, normality is plausible. Note that non-normality is only important to the validity of the test in small samples. In larger samples, non-normality will not effect validity, but strong non-normality will reduce the power of tests.
一个正常的位数曲线可以通过which="qq"“ - 这是一个正常分量的残差图。这可以用来检查正态性假设 - 如果数据是接近一条直线,正常是合理的。请注意,在小样本测试的有效性是唯一重要的非正态。在更大的样本中,非正常,不会影响有效性,但强烈的非正常降低功率的测试。
If use.null=TRUE then the lines added to the plot use the coefficients estimated under the null hypothesis. For example, if the sma object x was produced using a common slopes test (via y~x*groups or similar) then use.null=TRUE will plot lines that apply the common slope to each group.
如果use.null=TRUE然后添加的图使用的零假设下的估计系数。例如,如果SMA对象x制作使用一个共同的斜坡测试(通过y~x*groups或类似的),那么use.null=TRUE将绘制应用到每个组的共同斜率的线。
The arguments pch, col, lty, from & to, are used to modify characteristics of the plotted points and lines. If a vector of values for anyone of these arguments is passed to plot.sma, then successive values are applied to each group, provided group structure is included in x and the vector length is at least as long as the number of groups.
的参数pch,col,lty,from & to,用于修改所绘制的点和线的特点。如果这些参数的任何人的向量的值传递给plot.sma,然后连续值应用于每个组,提供的基团的结构包含在x和向量的长度为至少只要数量的组。
By default, plot.sma uses the default tick spacing given by plot.default. To customise axes, users can pass special axis objects to plot.sma, obtained using the defineAxis command as in the example below. This enables high quality publishable plots to be produced. See plotutils for more information.
默认情况下,plot.sma使用默认的刻度间距的plot.default。要自定义轴,用户可以通过特殊的轴对象为plot.sma,defineAxis使用命令,在下面的例子中获得。这使得生产高品质的发布的图。见plotutils更多信息。
(作者)----------Author(s)----------
D. Falster, R.A. Duursma, D.I. Warton
参见----------See Also----------
sma, plotutils, defineAxis
sma,plotutils,defineAxis
实例----------Examples----------
# Load leaf lifetime dataset:[加载叶一生数据集:]
data(leaflife)
# Only consider low-nutrient sites:[仅考虑低养分的网站:]
leaf.low.soilp <- subset(leaflife, soilp == 'low')
# Fit SMA's separately at each of high and low [适合SMA的分别在每个高和低]
# rainfall sites and test for common slope:[降雨网站和共同的斜率测试:]
ft <- sma(longev~lma*rain, data=leaf.low.soilp, log="xy")
# Plot leaf longevity (longev) vs leaf mass per area (lma) [图的叶子寿命(longev)与比叶重(LMA)]
# separately for each of high and low rainfall:[分别为高和低的降雨:]
plot(ft)
# As before but add lines which have a common slope:[像以前一样,但添加行都有一个共同的斜率:]
plot(ft, use.null=TRUE)
#As above, but adding the common slope lines to an existing plot[如上所述,但共同斜率线添加到现有的图]
plot(ft, type='p', col="black")
plot(ft, use.null=TRUE, add=TRUE, type='l')
# Plot with equally spaced tick marks:[图同样间隔的刻度线:]
plot(ft, xaxis=defineAxis(major.ticks=c(40,80,160,320,640)),
yaxis=defineAxis(major.ticks=c(0.5,1,2,4,8)) )
# Produce a residual plot to check assumptions:[产生残差图检查假设:]
plot(ft,which="res")
# Produce a normal quantile plot:[产生正常的位数图:]
plot(ft,which="qq")
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|