plotDS(sfsmisc)
plotDS()所属R语言包:sfsmisc
Plot Data and Smoother / Fitted Values
绘制数据和平滑器/拟合值的
译者:生物统计家园网 机器人LoveR
描述----------Description----------
For one-dimensional nonparametric regression, plot the data and fitted values, typically a smooth function, and optionally use segments to visualize the residuals.
对于一维非参数回归,绘制的数据和拟合值,通常是一个光滑的函数,以及有选择地使用可视化的残差段。
用法----------Usage----------
plotDS(x, yd, ys, xlab = "", ylab = "", ylim = rrange(c(yd, ys)),
xpd = TRUE, do.seg = TRUE, seg.p = 0.95,
segP = list(lty = 2, lwd = 1, col = 2),
linP = list(lty = 1, lwd = 2.5, col = 3),
...)
参数----------Arguments----------
参数:x, yd, ys
numeric vectors all of the same length, representing (x_i, y_i) and fitted (smooth) values y^_i. x will be sorted increasingly if necessary, and yd and ys accordingly. Alternatively, ys can be an x-y list (as resulting from xy.coords) containing fitted values on a finer grid than the observations x. In that case, the observational values x[] must be part of the larger set; seqXtend() may be applied to construct such a set of abscissa values.
数字矢量相同的长度,代表(x_i, y_i)和拟合值(平滑)y^_i。 “”x排序日益如果必要的话,yd和ys相应。另外,ys可以是XY名单(如造成的xy.coords)的拟合值更精细的网格上,而不是的意见x。在这种情况下,观测值x[]必须是较大的集合的一部分;seqXtend()可施加到构造这样一个组的横坐标值。
参数:xlab, ylab
x- and y- axis labels, as in plot.default.
x-和y-轴的标签,如在plot.default。
参数:ylim
limits of y-axis to be used; defaults to a robust range of the values.
y轴以可以使用默认一个健壮的数值范围的极限。
参数:xpd
see par(xpd=.); by default do allow to draw outside the plot region.
看到par(xpd=.);默认情况下,允许绘制的图区域外。
参数:do.seg
logical indicating if residual segments should be drawn, at x[i], from yd[i] to ys[i] (approximately, see seg.p).
逻辑表明如果剩余的部分应得出,在x[i],yd[i]到ys[i](约,seg.p“)。
参数:seg.p
segment percentage of segments to be drawn, from yd to seg.p*ys + (1-seg.p)*yd.
段段比例要绘制的,从yd到seg.p*ys + (1-seg.p)*yd。
参数:segP
list with named components lty, lwd, col specifying line type, width and color for the residual segments, used only when do.seg is true.
的命名组件列表lty, lwd, col指定行类型,宽度和颜色的剩余部分,只有当do.seg是真实的。
参数:linP
list with named components lty, lwd, col specifying line type, width and color for “smooth curve lines”.
lty, lwd, col指定为“平滑曲线”的线路类型,宽度和颜色的命名组件列表。
参数:...
further arguments passed to plot.
进一步的参数传递给plot。
注意----------Note----------
Non-existing components in the lists segP or linP will result in the par defaults to be used.
非现有的组件中的列表中的segP或linP将导致par默认值,以使用。
plotDS() used to be called pl.ds up to November 2007.
plotDS()被称为pl.ds:“截至2007年11月。
(作者)----------Author(s)----------
Martin Maechler, since 1990
参见----------See Also----------
seqXtend() to construct more smooth ys “objects”.
seqXtend()构建更加流畅ys“对象”。
实例----------Examples----------
data(cars)
x <- cars$speed
yd <- cars$dist
ys <- lowess(x, yd, f = .3)$y
plotDS(x, yd, ys)
## More interesting : Version of example(Theoph)[#更有趣的例子:版本(茶碱)]
data(Theoph)
Th4 <- subset(Theoph, Subject == 4)
## just for "checking" purposes -- permute the observations:[#只为“检查”的宗旨 - 表,改变意见:]
Th4 <- Th4[sample(nrow(Th4)), ]
fm1 <- nls(conc ~ SSfol(Dose, Time, lKe, lKa, lCl), data = Th4)
## Simple[#简单]
plotDS(Th4$Time, Th4$conc, fitted(fm1),
sub = "Theophylline data - Subject 4 only",
segP = list(lty=1,col=2), las = 1)
## Nicer: Draw the smoother not only at x = x[i] (observations):[#漂亮:绘制平滑不仅在X = X [I](观察):]
xsm <- unique(sort(c(Th4$Time, seq(0, 25, length = 201))))
ysm <- c(predict(fm1, newdata = list(Time = xsm)))
plotDS(Th4$Time, Th4$conc, ys = list(x=xsm, y=ysm),
sub = "Theophylline data - Subject 4 only",
segP = list(lwd=2), las = 1)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|