mosaic3d(vcdExtra)
mosaic3d()所属R语言包:vcdExtra
3D Mosaic Plots
3D拼接图
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Produces a 3D mosaic plot for a contingency table (or a link[MASS]{loglm} model) using the rgl-package.
生成一个3D拼接图的列联表(或link[MASS]{loglm}模型)使用rgl-package。
Generalizing the 2D mosaic plot, this begins with a given 3D shape (a unit cube), and successively sub-divides it along the X, Y, Z dimensions according to the table margins, generating a nested set of 3D tiles. The volume of the resulting tiles is therefore proportional to the frequency represented in the table cells. Residuals from a given loglinear model are then used to color or shade each of the tiles.
泛化的2D马赛克图,这与一个给定的三维形状(一个单位立方体)开始,并连续子分沿X,Y,Z维度根据表边距,生成一组嵌套的三维瓷砖。因此,所得到的砖的体积是在表格单元中表示的频率成正比。残差,然后用于从一个给定的对数线性模型的颜色或阴影每个瓦片。
This is a developing implementation. The arguments and details are subject to change.
这是一个发展中的实现。参数和细节都可能发生变化。
用法----------Usage----------
mosaic3d(x, ...)
## S3 method for class 'loglm'
mosaic3d(x, type = c("observed", "expected"), residuals_type = c("pearson", "deviance"), ...)
## Default S3 method:[默认方法]
mosaic3d(x, expected = NULL, residuals = NULL,
type = c("observed", "expected"), residuals_type = NULL,
shape = cube3d(alpha = alpha), alpha = 0.5,
spacing = 0.1, split_dir = 1:3, shading = shading_basic, zero_size=.05,
label_edge,
labeling_args = list(), newpage = TRUE, box=FALSE, ...)
参数----------Arguments----------
参数:x
A link[MASS]{loglm} model object. Alternatively, a multidimensional array or table or structable of frequencies in a contingency table. In the present implementation, the dimensions are taken in sequential order. Use link[base]{aperm} or structable to change this.
Alink[MASS]{loglm}模型对象。另外,多维array或table或structable的列联表的频率。在目前的实现中,尺寸是按顺序。使用link[base]{aperm}或structable改变。
参数:expected
optionally, for contingency tables, an array of expected frequencies of the same dimension as x, or alternatively the corresponding loglinear model specification as used by link[stats]{loglin} or link[MASS]{loglm} (see structable for details).
任选,列联表,数组的预期频率相同的尺寸,x,或者相应的对数线性模型规范所使用的link[stats]{loglin}或link[MASS]{loglm}(见structable了解详情)。
参数:residuals
optionally, an array of residuals of the same dimension as x (see details).
可选的阵列的尺寸相同x(见详情)的残留物。
参数:type
a character string indicating whether the "observed" or the "expected" frequencies in the table should be visualized by the volume of the 3D tiles.
一个字符串,指示是否"observed"或"expected"表中的频率应该是可视化的3D瓷砖的体积。
参数:residuals_type
a character string indicating the type of residuals to be computed when none are supplied. If residuals is NULL, residuals_type must be one of "pearson" (default; giving components of Pearson's chi-squared), "deviance" (giving components of the likelihood ratio chi-squared), or "FT" for the Freeman-Tukey residuals. The value of this argument can be abbreviated.
一个字符串类型的残差计算时没有提供。如果残差是NULL,residuals_type是"pearson"(默认组件Pearson的卡方),"deviance"(组件的可能性比卡方),或"FT"的弗里曼杜克残差。这个参数的值,可以缩写。
参数:shape
The initial 3D shape on which the mosaic is based. Typically this is a call to an rgl function, and must produce a shape3d object. The default is a "unit cube" on (-1, +1), with transparency specified by alpha.
马赛克是根据初始的3D形状。通常情况下,这是一个的调用一个RGL功能,并,必须出示shape3d对象。默认值是“单位立方体”(-1,+1),与指定的alpha透明度。
参数:alpha
Specifies the transparency of the 3D tiles used to compose the 3D mosaic.
指定用来组成的3D拼接的3D瓷砖的透明度。
参数:spacing
A number or vector giving the total amount of space used to separate the 3D tiles along each of the dimensions of the table. The values specified are re-cycled to the number of table dimensions.
一个数字或矢量给予的空间总量用于分离的表中的每一个的尺寸沿三维瓷砖。指定的值是重新循环的数目的表的尺寸。
参数:split_dir
A numeric vector composed of the integers 1:3 or a character vector composed of c("x", "y", "z"), where split_dir[i] specifies the axis along which the tiles should be split for dimension i of the table. The values specified are re-cycled to the number of table dimensions.
一个数值向量组成的整数1:3或字符组成的向量c("x", "y", "z"),其中split_dir[i]指定轴沿的瓷砖应该被分割的尺寸i的表。指定的值是重新循环的数目的表的尺寸。
参数:shading
A function, taking an array or vector of residuals for the given model, returning a vector of colors. At present, only the default shading=shading_basic is provided. This is roughly equivalent to the use of the shade argument in mosaicplot or to the use of gp=shading_Friendly in mosaic.
一个函数,考虑一个数组或残差向量为给定的模型,返回一个矢量的颜色。目前,只有默认的shading=shading_basic。这大致相当于在shademosaicplot参数的使用或使用gp=shading_Friendlymosaic。
参数:zero_size
The radius of a small sphere used to mark zero cells in the display.
小球体的半径零单元标记显示。
参数:label_edge
A character vector composed of c("-", "+") indicating whether the labels for a given table dimension are to be written at the minima ("-") or maxima ("+") of the other dimensions in the plot. The default is rep( c('-', '+'), each=3, length=ndim), meaning that the first three table variables are labeled at the minima, and successive ones at the maxima.
字符向量组成的c("-", "+")对于一个给定的表的尺寸的标签是否要写入的最小值("-")或最大("+")其他维度中的图。默认值是rep( c('-', '+'), each=3, length=ndim),这意味着,前三标记在表变量中的最低,连续的的最大值。
参数:labeling_args
This argument is intended to be used to specify details of the rendering of labels for the table dimensions, but at present has no effect.
此参数的目的被用来指定的渲染的标签表的尺寸的详细信息,但目前并没有效果。
参数:newpage
logical indicating whether a new page should be created for the plot or not.
逻辑表明的图或是否应该创建一个新的页面。
参数:box
logical indicating whether a bounding box should be drawn around the plot.
逻辑边界框周围绘制的图。
参数:...
Other arguments passed down to mosaic.default or 3D functions.
其他参数传递给mosaic.default或3D功能的。
Details
详细信息----------Details----------
Friendly (1995), Friendly [Sect. 4.5](2000) and Theus and Lauer (1999) have all used the idea of 3D mosaic displays to explain various aspects of loglinear models (the iterative proportional fitting algorithm, the structure of various models for 3-way and n-way tables, etc.), but no implementation of 3D mosaics was previously available.
活动(1995年),的友好[宗。 4.5](2000)和瑟乌斯和劳尔(1999)都用三维马赛克显示的想法来解释的对数线性模型(3-way与n路表的迭代比例拟合算法,各种型号的结构的各个方面,等),但没有实现的3D马赛克。
For the default method, residuals, used to color and shade the 3D tiles, can be passed explicitly, or, more typically, are computed as needed from observed and expected frequencies. In this case, the expected frequencies are optionally computed for a specified loglinear model given by the expected argument. For the loglm method, residuals and observed frequencies are calculated from the model object.
对于默认的方法,残差,用于色彩和阴影的3D瓷砖,可以显式地传递,或者,更典型地,如需要从观察到的和期望的频率计算。在这种情况下,预期的频率任选expected参数所给出的为指定的对数线性模型计算。对于loglm方法,残差和观察到的频率计算从模型对象。
值----------Value----------
Invisibly, the list of shape3d objects used to draw the 3D mosaic, with names corresponding to the concatenation of the level labels, separated by ":".
列表中不可见的,shape3d对象与名称对应的级别标签的串联,用于绘制3D拼接,用“:”分隔的。
(作者)----------Author(s)----------
Michael Friendly, with the help of Duncan Murdoch and Achim Zeileis
参考文献----------References----------
Conceptual and Visual Models for Categorical Data, The American Statistician, 49, 153-160.
Web materials: http://www.datavis.ca/books/vcd/.
Visualizing Loglinear Models. Journal of Computational and Graphical Statistics, 8, 396-412.
参见----------See Also----------
strucplot, mosaic, mosaicplot
strucplot,mosaic,mosaicplot
loglin, loglm for details on fitting loglinear models
loglin,loglm的详细信息,对数线性模型拟合
实例----------Examples----------
# 2 x 2 x 2[2×2×2的]
mosaic3d(Bartlett, box=TRUE)
# compare with expected frequencies under model of mutual independence[与预计模型相互独立的频率下进行比较]
mosaic3d(Bartlett, type="expected", box=TRUE)
# 2 x 2 x 3[2×2×3]
mosaic3d(Heart, box=TRUE)
## Not run: [#不运行:]
# 2 x 2 x 2 x 3[2×2×2×3]
# illustrates a 4D table[说明了4D表]
mosaic3d(Detergent)
# compare 2D and 3D mosaics[比较2D和3D马赛克]
demo("mosaic-hec")
## End(Not run)[#(不执行)]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|