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

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

[复制链接]
发表于 2012-10-1 14:46:30 | 显示全部楼层 |阅读模式
cd_plot(vcd)
cd_plot()所属R语言包:vcd

                                        Conditional Density Plots
                                         有条件的密度图

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

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

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


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


cd_plot(x, ...)
## Default S3 method:[默认方法]
cd_plot(x, y,
  plot = TRUE, ylab_tol = 0.05,
  bw = "nrd0", n = 512, from = NULL, to = NULL,
  main = "", xlab = NULL, ylab = NULL, margins = c(5.1, 4.1, 4.1, 3.1),
  gp = gpar(), name = "cd_plot", newpage = TRUE, pop = TRUE,
  ...)
## S3 method for class 'formula'[类formula的方法]
cd_plot(formula, data = list(),
  plot = TRUE, ylab_tol = 0.05,
  bw = "nrd0", n = 512, from = NULL, to = NULL,
  main = "", xlab = NULL, ylab = NULL, margins = c(5.1, 4.1, 4.1, 3.1),
  gp = gpar(), name = "cd_plot", newpage = TRUE, pop = TRUE,
  ...)



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

参数:x
an object, the default method expects either a single numerical variable.
对象,默认的方法,希望一个单一的数值变量。


参数: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?
逻辑。如果计算出的条件密度,绘制?


参数:ylab_tol
convenience tolerance parameter for y-axis annotation. If the distance between two labels drops under this threshold, they are plotted equidistantly.
y轴注解的便利性参数。如果两个标签之间的距离,根据该阈值下降,它们等距离地绘制。


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


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


参数:margins
margins when calling plotViewport
利润时调用plotViewport


参数:gp
a "gpar" object controlling the grid graphical parameters of the rectangles. It should specify in particular a vector of fill colors of the same length as levels(y). The default is to call gray.colors.   
一个"gpar"对象的矩形网格图形参数控制。它应该特别指定的向量fill颜色相同的长度levels(y)。默认值是调用“gray.colors。


参数:name
name of the plotting viewport.
绘制视口的名称。


参数:newpage
logical. Should grid.newpage be called  before plotting?
逻辑。 grid.newpage被称为打印之前?


参数:pop
logical. Should the viewport created be popped?
逻辑。如果视口创建弹出?


Details

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

cd_plot 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.
cd_plot计算的条件密度,x的水平y,加权的边际分布y。密度衍生累积y以上的水平。

This visualization technique is similar to spinograms (see spine) but they do not discretize the explanatory variable, but rather use a smoothing approach. Furthermore, the original x axis and not a distorted x axis (as for spinograms) is used. This typically results in conditional densities that are based on very few observations in the margins: hence, the estimates are less reliable there.
这个可视化技术是相似的spinograms(见spine),但他们不离散解释变量,而是使用平滑的方法。此外,使用的原始x轴,而不是一个扭曲的x轴(为spinograms)。这通常会导致条件的基础上的利润很少观测的密度,因此,估计是不可靠的。


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

The conditional density functions (cumulative over the levels of y) are returned invisibly.
有条件的密度函数(累计在各级y)回到看不见的。


(作者)----------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----------

spine, density
spine,density


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


## Arthritis data[#关节炎数据]
data("Arthritis")
cd_plot(Improved ~ Age, data = Arthritis)
cd_plot(Improved ~ Age, data = Arthritis, bw = 3)
cd_plot(Improved ~ Age, data = Arthritis, bw = "SJ")
## compare with spinogram[#与spinogram比较]
spine(Improved ~ Age, data = Arthritis, breaks = 3)

## Space shuttle data[#航天飞机数据]
data("SpaceShuttle")
cd_plot(Fail ~ Temperature, data = SpaceShuttle, bw = 2)

## scatter plot with conditional density[#散点图条件密度]
cdens <- cd_plot(Fail ~ Temperature, data = SpaceShuttle, bw = 2, plot = FALSE)
plot(I(-1 * (as.numeric(Fail) - 2)) ~ jitter(Temperature, factor = 2), data = SpaceShuttle,
  xlab = "Temperature", ylab = "Failure")
lines(53:81, cdens[[1]](53:81), col = 2)

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-27 10:34 , Processed in 0.021284 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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