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

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

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

                                        Shading-generating Functions for Residual-based Shadings
                                         剩余着色的阴影生成函数

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

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

Shading-generating functions for computing residual-based shadings  for mosaic and association plots.
计算剩余的马赛克和关联图的阴影着色的功能。


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


shading_hcl(observed, residuals = NULL, expected = NULL, df = NULL,
  h = NULL, c = NULL, l = NULL, interpolate = c(2, 4), lty = 1,
  eps = NULL, line_col = "black", p.value = NULL, level = 0.95, ...)

shading_hsv(observed, residuals = NULL, expected = NULL, df = NULL,
  h = c(2/3, 0), s = c(1, 0), v = c(1, 0.5),
  interpolate = c(2, 4), lty = 1, eps = NULL, line_col = "black",
  p.value = NULL, level = 0.95, ...)

shading_max(observed = NULL, residuals = NULL, expected = NULL, df = NULL,
  h = NULL, c = NULL, l = NULL, lty = 1, eps = NULL, line_col = "black",
  level = c(0.9, 0.99), n = 1000, ...)

shading_Friendly(observed = NULL, residuals = NULL, expected = NULL, df = NULL,
  h = c(2/3, 0), lty = 1:2, interpolate = c(2, 4),
  eps = 0.01, line_col = "black", ...)

shading_sieve(observed = NULL, residuals = NULL, expected = NULL, df = NULL,
  h = c(260, 0), lty = 1:2, interpolate = c(2, 4),
  eps = 0.01, line_col = "black", ...)

shading_binary(observed = NULL, residuals = NULL, expected = NULL, df = NULL,
  col = NULL)

hcl2hex(h = 0, c = 35, l = 85, fixup = TRUE)



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

参数:observed
contingency table of observed values
列联表的观测值


参数:residuals
contingency table of residuals
列联表的残留物


参数:expected
contingency table of expected values
预期值的列联表


参数:df
degrees of freedom of the associated independence model.   
相关联的独立的模型的自由程度。


参数:h
hue value in the HCL or HSV color description, has to be in [0, 360] for HCL and in [0, 1] for HSV colors. The default is to use blue and red for positive and negative residuals respectively. In the HCL specification it is c(260, 0) by default and for HSV c(2/3, 0).
在HCL或HSV颜色的描述,色调值必须在[0,360] HCL在[0,1]为HSV颜色。默认值是分别用蓝色和红色的正面和负面的残差。在HCL规范,它是c(260, 0)默认情况下,单纯疱疹病毒c(2/3, 0)。


参数:c
chroma value in the HCL color description. This controls the maximum chroma for significant and non-significant results respectively and defaults  to c(100, 20).
色度值在HCL颜色描述。这可以控制的最大浓度分别为显着和不显着的结果,默认为c(100, 20)。


参数:l
luminance value in the HCL color description. Defaults to c(90, 50) for small and large residuals respectively.
亮度值在HCL颜色描述。默认为c(90, 50)分别为小型和大型残差。


参数:s
saturation value in the HSV color description. Defaults to c(1, 0) for large and small residuals respectively.
在HSV颜色的饱和度值描述。默认为c(1, 0)分别为大型和小型残差。


参数:v
saturation value in the HSV color description. Defaults to c(1, 0.5) for significant and non-significant results respectively.
在HSV颜色的饱和度值描述。默认为c(1, 0.5)的重大和非重大的结果。


参数:interpolate
a specification for mapping the absolute size of the residuals to a value in [0, 1]. This can be either a function or a numeric vector. In the latter case, a step function with steps of equal size going from 0 to 1 is used.
残差的绝对大小,映射到的值在[0,1]的一个规范。这可以是一个功能或一个数值向量。在后者的情况下,大小相等的步骤,从0到1的一个阶跃函数使用。


参数:lty
a vector of two line types for positive and negative residuals respectively. Recycled if necessary.
残差分别为正和负的两个行类型的向量。如果需要回收。


参数:eps
numeric tolerance value below which absolute residuals are considered to be zero, which is used for coding the border color and line type. If set to NULL (default), all borders have the default color specified by line\_col. If set to a numeric value, all border colors corresponding to residuals with a larger absolute value are set to the full positive or negative color, respectively;  borders corresponding to smaller residuals are are drawn with line\_col and lty[1] </table>
低于该数值的公差值绝对残差被认为是零,这是用于编码的边框颜色和行类型。如果设置为NULL(默认),所有的边界有指定的line\_col的默认颜色。如果设置为一个数值,设置边框的颜色对应的残差具有较大的绝对值的积极或消极的颜色,分别为边界更小的残差绘制line\_col和lty[1] </ TABLE>


参数:line_col
default border color (for shading_sieve: default sieve color).
默认的边框颜色(shading_sieve:默认情况下筛的颜色)。


参数:p.value
the p value associated with the independence model. By default, this is computed from a Chi-squared distribution with df degrees of freedom. p.value can be either a scalar or a function(observed, residuals, expected, df) that computes the p value from the data. If set to NA no inference is performed.
p值与独立模型。默认情况下,这是计算卡方分布df自由度。 p.value可以是一个标量或function(observed, residuals, expected, df)计算p值从数据。如果设置为NA没有推断执行。


参数:level
confidence level of the test used. If p.value is smaller than 1 - level, bright colors are used, otherwise dark colors are employed. For shading_max a vector of levels can be supplied. The corresponding critical values are then used as interpolate cut-offs.
所使用的测试的置信水平。如果p.value是小于1 - level,鲜艳的色彩,否则暗色调采用。对于shading_max级别的向量都可以提供。相应的临界值,然后作为interpolate切的平衡。


参数:n
number of permutations used in the call to coindep_test.
用于调用coindep_test排列。


参数:col
a vector of two colors for positive and negative residuals respectively.
一个向量的残差分别为正和负两种颜色。


参数:fixup
logical. Should the color be corrected to a valid RGB value before correction?
逻辑。应的颜色校正的校正前的一个有效的RGB值?


参数:...
Other arguments passed to hcl2hex or hsv, respectively.
其他参数传递给hcl2hex或hsv。


Details

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

These shading-generating functions can be passed to strucplot to generate residual-based shadings for contingency tables. strucplot calls these functions with the arguments observed, residuals, expected, df which give the observed values, residuals, expected values and associated degrees of freedom for a particular contingency table and associated independence  model.
strucplot列联表产生剩余的阴影,这些阴影产生的功能都可以通过。 strucplot调用这些函数的参数observed,residuals,expected,df给出的观测值,残差,预期值和相关的自由度一个特定的列联表和相关联的独立模型。

The shadings shading_hcl and shading_hsv do the same thing conceptually, but use HCL or HSV colors respectively. The former is usually preferred because they are perceptually based. Both shadings visualize the sign of the residuals of an independence model using two hues (by default: blue and red). The absolute size of  the residuals is visualized by the colorfulness and the amount of grey, by default in three categories: very colorful for large residuals (> 4), less colorful for medium sized residuals (< 4 and > 2), grey/white for small residuals (< 2). More categories or a continuous scale can be specified by setting interpolate. Furthermore, the result of a significance test can be visualized by the amount of grey in the colors. If significant, a colorful palette is used, if not, the amount of color is reduced. See Zeileis, Meyer, and Hornik (2007) and diverge_hcl for more details.
的阴影shading_hcl和shading_hsv做同样的事情在概念上,而是分别使用盐酸或HSV颜色。前者通常是优选的,因为它们是听觉根据。这两个阴影可视化的标志使用两种色调(默认值:蓝色和红色)的独立模型的残差。残差的绝对大小是用灰色的色彩和量的,默认情况下,在三大类:大残差(4)非常丰富多彩的,丰富多彩的为中型残差(<4> 2),灰色/白残差为小(<2)。通过设置interpolate可以指定多个类别或连续规模。此外,显着性检验的结果,可以用在颜色的量的灰色。如果显着,使用丰富多彩的调色板,如果没有,色彩的量减少。请参阅迈耶,Zeileis,和霍尔尼克(2007年)和diverge_hcl更多细节。

The shading shading_max is applicable in 2-way contingency tables and uses a similar strategy as shading_hcl. But instead of using the cut-offs 2 and 4, it employs the critical values for the maximum statistic (by default at 90% and 99%). Consequently, color in the plot signals a significant result at 90% or 99% significance level, respectively. The test is carried out by calling coindep_test.
的阴影shading_max是适用于2列联表,并采用了类似的策略,shading_hcl。但是,而不是使用切割冲销2和4,它采用的最大统计的临界值(默认情况下,在90%和99%)。因此,色彩的图在90%或99%的显着性水平,标志着一个显着的结果。试验进行,满分通过调用coindep_test。

The shading shading_Friendly is very similar to shading_hsv, but additionally codes the sign of the residuals by different line types. See Friendly (1994) for more details. shading_sieve is similar, but uses HCL colors.
遮光shading_Friendlyshading_hsv,但另外的残差编码的符号由不同的线类型是非常类似的。有关详细信息,请参阅活动(1994年)。 shading_sieve是相似的,但使用HCL颜色。

The shading shading_binary just visualizes the sign of the residuals by using two different colors (default: blue HCL(260, 50, 70) and red HCL(0, 50, 70)).
的阴影shading_binary只是可视化残差的符号使用两种不同的颜色(默认:蓝色HCL(260,50,70)和红色HCL(0,50,70))。

The color implementations employed are hsv from base R and polarLUV from the colorspace package, respectively. To transform the HCL coordinates to a hexadecimal color string (as returned by hsv), the function hex is employed. A convenience wrapper hcl2hex is provided.
采用的颜色实现hsv从基础R和polarLUVcolorspace包,分别。要转换HCL坐标为十六进制的的颜色字符串(返回hsv),功能hex采用。一个方便的包装hcl2hex提供。


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

A shading function which takes only a single argument, interpreted as a vector/table of residuals, and returns a "gpar" object with the corresponding vector(s)/table(s) of graphical parameter(s).
着色功能,只需要一个参数,解释为一个向量/表的残留物,并返回一个"gpar"对象对应的向量(S)/(次)的图形参数(S)。


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



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




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

Mosaic Displays for Multi-Way Contingency Tables. Journal of the American Statistical Association, 89, 190&ndash;200.
The Strucplot Framework: Visualizing Multi-Way Contingency Tables with <code>vcd</code>. Journal of Statistical Software, 17(3), 1&ndash;48. URL http://www.jstatsoft.org/v17/i03/. See also <code>vignette("strucplot", package = "vcd")</code>.
(Conditional) Independence. Journal of Computational and Graphical Statistics, 16, 507&ndash;525.
Escaping RGBland: Selecting Colors for Statistical Graphics. Computational Statistics &amp; Data Analysis, Forthcoming. Preprint available from http://statmath.wu-wien.ac.at/~zeileis/papers/Zeileis+Hornik+Murrell-2008.pdf.

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

hex, polarLUV, hsv, mosaic, assoc, strucplot, diverge_hcl
hex,polarLUV,hsv,mosaic,assoc,strucplot,diverge_hcl


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


## load Arthritis data[#加载关节炎的数据。]
data("Arthritis")
art <- xtabs(~Treatment + Improved, data = Arthritis)

## plain mosaic display without shading[#纯拼接显示无阴影]
mosaic(art)

## with shading for independence model[#独立模型的阴影]
mosaic(art, shade = TRUE)
## which uses the HCL shading[#使用HCL阴影]
mosaic(art, gp = shading_hcl)
## the residuals are two small to have color,[#残差是两个小有颜色的,]
## hence the cut-offs can be modified[#因此切割的平衡可以被修改]
mosaic(art, gp = shading_hcl, gp_args = list(interpolate = c(1, 1.8)))
## the same with the Friendly palette [#同样的友好调色板]
## (without significance testing)[(无显着性检验)]
mosaic(art, gp = shading_Friendly, gp_args = list(interpolate = c(1, 1.8)))

## assess independence using the maximum statistic[评估独立使用的最大统计]
## cut-offs are now critical values for the test statistic[#切割不同而有不同的检验统计量的临界值]
mosaic(art, gp = shading_max)

## association plot with shading as in base R[带阴影的碱基r#协会图]
assoc(art, gp = shading_binary(col = c(1, 2)))

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-27 08:23 , Processed in 0.033554 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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