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

R语言:cdplot()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-16 17:48:35 | 显示全部楼层 |阅读模式
cdplot(graphics)
cdplot()所属R语言包:graphics

                                        Conditional Density Plots
                                         条件密度图

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

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

Computes and plots conditional densities describing how the conditional distribution of a categorical variable y changes over a numerical variable x.
计算和图形描述的条件密度如何分类变量y超过一个数值变量x变化的条件分布。


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


cdplot(x, ...)

## Default S3 method:[默认方法]
cdplot(x, y,
  plot = TRUE, tol.ylab = 0.05, ylevels = NULL,
  bw = "nrd0", n = 512, from = NULL, to = NULL,
  col = NULL, border = 1, main = "", xlab = NULL, ylab = NULL,
  yaxlabels = NULL, xlim = NULL, ylim = c(0, 1), ...)

## S3 method for class 'formula'[类formula的方法]
cdplot(formula, data = list(),
  plot = TRUE, tol.ylab = 0.05, ylevels = NULL,
  bw = "nrd0", n = 512, from = NULL, to = NULL,
  col = NULL, border = 1, main = "", xlab = NULL, ylab = NULL,
  yaxlabels = NULL, xlim = NULL, ylim = c(0, 1), ...,
  subset = NULL)



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

参数:x
an object, the default method expects a single numerical variable (or an object coercible to this).
一个对象,默认的方法,预计一个单一的数值变量(或对象强制转换本)。


参数:y
a "factor" interpreted to be the dependent variable
"factor"解释为因变量


参数:formula
a "formula" of type y ~ x with a single dependent "factor" and a single numerical explanatory variable.     
"formula"的类型y ~ x单一依赖"factor"和一个单一的数值解释变量。


参数:data
an optional data frame.
一个可选的数据框。


参数:plot
logical. Should the computed conditional densities be plotted?
逻辑。如果有条件的计算密度绘制?


参数:tol.ylab
convenience tolerance parameter for y-axis annotation. If the distance between two labels drops under this threshold, they are plotted equidistantly.
Y轴标注方便性参数。如果两个标签之间的距离在此阈值下降,他们绘制等距。


参数:ylevels
a character or numeric vector specifying in which order the levels of the dependent variable should be plotted.
为了因变量水平指定的字符或数字向量应绘制。


参数:bw, n, from, to, ...
arguments passed to density
参数传递density


参数:col
a vector of fill colors of the same length as levels(y). The default is to call gray.colors.   
填充颜色相同的长度为levels(y)向量。默认是调用gray.colors。


参数:border
border color of shaded polygons.   
阴影多边形的边框颜色。


参数:main, xlab, ylab
character strings for annotation
注释字符串


参数:yaxlabels
character vector for annotation of y axis, defaults to levels(y).
特征向量为y轴的注释,默认levels(y)。


参数:xlim, ylim
the range of x and y values with sensible defaults.
合理的默认值x和y值的范围。


参数:subset
an optional vector specifying a subset of observations to be used for plotting.
指定一个可选的向量绘图观测的子集。


Details

详情----------Details----------

cdplot computes the conditional densities of x given the levels of y weighted by the marginal distribution of y. The densities are derived cumulatively over the levels of y.
cdplot计算的条件密度x水平,y加权边际由y的分布。累计超过y水平得到密度。

This visualization technique is similar to spinograms (see spineplot) and plots P(y | x) against x. The conditional probabilities are not derived by discretization (as in the spinogram), but using a smoothing approach via density.
这个可视化技术是相似到spinograms(见spineplot)和图P(y | x)对x。条件概率推导出离散(在spinogram),但通过density使用平滑的方法。

Note, that the estimates of the conditional densities are more reliable for  high-density regions of x. Conversely, the are less reliable in regions with only few x observations.
注意,有条件的密度估计x高密度区域的更可靠的。相反,该区域只有少数x观测可靠。


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

The conditional density functions (cumulative over the levels of y) are returned invisibly.
有条件的密度函数(累积超过y)返回无形水平。


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



Achim Zeileis <a href="mailto:Achim.Zeileis@R-project.org">Achim.Zeileis@R-project.org</a>




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

conditional distributions, Unpublished Manuscript.

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

spineplot, density
spineplot,density


举例----------Examples----------


## NASA space shuttle o-ring failures[#美国宇航局航天飞机O形圈的失败]
fail <- factor(c(2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1,
                 1, 2, 1, 1, 1, 1, 1),
               levels = 1:2, labels = c("no", "yes"))
temperature <- c(53, 57, 58, 63, 66, 67, 67, 67, 68, 69, 70, 70,
                 70, 70, 72, 73, 75, 75, 76, 76, 78, 79, 81)

## CD plot[#光盘图]
cdplot(fail ~ temperature)
cdplot(fail ~ temperature, bw = 2)
cdplot(fail ~ temperature, bw = "SJ")

## compare with spinogram[#与spinogram比较]
(spineplot(fail ~ temperature, breaks = 3))

## highlighting for failures[#突出的故障]
cdplot(fail ~ temperature, ylevels = 2:1)

## scatter plot with conditional density[#条件密度的散点图]
cdens <- cdplot(fail ~ temperature, plot = FALSE)
plot(I(as.numeric(fail) - 1) ~ jitter(temperature, factor = 2),
     xlab = "Temperature", ylab = "Conditional failure probability")
lines(53:81, 1 - cdens[[1]](53:81), col = 2)

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-23 06:04 , Processed in 0.026276 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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