cotabplot(vcd)
cotabplot()所属R语言包:vcd
Coplot for Contingency Tables
Coplot列联表
译者:生物统计家园网 机器人LoveR
描述----------Description----------
cotabplot is a generic function for creating trellis-like coplots (conditional plots) for contingency tables.
cotabplot是一个泛型函数列联表为创建网格状coplots,(有条件的图)。
用法----------Usage----------
cotabplot(x, ...)
## Default S3 method:[默认方法]
cotabplot(x, cond = NULL,
panel = cotab_mosaic, panel_args = list(),
margins = rep(1, 4), layout = NULL,
text_gp = gpar(fontsize = 12), rect_gp = gpar(fill = grey(0.9)),
pop = TRUE, newpage = TRUE,
...)
## S3 method for class 'formula'[类formula的方法]
cotabplot(formula, data = NULL, ...)
参数----------Arguments----------
参数:x
an object. The default method can deal with contingency tables in array form.
一个对象。默认的方法可以处理数组形式的列联表。
参数:cond
margin index(es) or corresponding name(s) of the conditioning variables.
裕度指标(ES)或相应的条件变量的名称(S)。
参数:panel
panel function applied for each conditioned plot, see details.
“面板功能每个空调图申请,查看详细信息。
参数:panel_args
list of arguments passed to panel if this is a panel-generating function inheriting from class "grapcon_generator".
列表中的参数传递给panel如果这是一个面板的功能继承自类"grapcon_generator"。
参数:margins
either an object of class "unit" of length 4, or a numeric vector of length 4. The elements are recycled as needed. giving the margins around the whole plot.
无论是类的一个对象"unit"长度为4,或一个数值向量的长度为4。被回收作为需要的元素。整个小区给周围的边距。
参数:layout
integer vector (of length two), giving the number of rows and columns for the panel.
整数向量(长度为2),给为面板的行和列的数目。
参数:text_gp
object of class "gpar" used for the text in the panel titles.
类的对象"gpar"使用的面板标题中的文本。
参数:rect_gp
object of class "gpar" used for the rectangles with the panel titles.
类的对象"gpar"的矩形面板标题。
参数:pop
logical indicating whether the generated viewport tree should be removed at the end of the drawing or not.
逻辑指示是否应被删除在绘图或不结束所产生的视口树。
参数:newpage
logical controlling whether a new grid page should be created.
逻辑控制是否应该创建一个新的网格页。
参数:...
further arguments passed to the panel-generating function.
通过进一步的论据面板的功能。
参数:formula
a formula specifying the variables used to create a contingency table from data. It has to be of type ~ x + y | z where z is/are the conditioning variable(s) used.
公式指定使用的变量,创建一个列联表data。它必须是类型~ x + y | z其中z/调节变量()。
参数:data
either a data frame, or an object of class "table" or "ftable".
一个数据框,或对象类"table"或"ftable"的。
Details
详细信息----------Details----------
cotabplot is a generic function designed to create coplots or conditional plots (see Cleveland, 1993, and Becker, Cleveland, Shyu, 1996) similar to coplot but for contingency tables.
cotabplot是一个通用的功能,设计成类似coplot但对于列联表创建coplots或有条件的图(见克利夫兰,1993年,贝克尔,克利夫兰,徐,1996年)。
cotabplot takes on computing the conditioning information and setting up the trellis display, and then relies on a panel function to create plots from the full table and the conditioning information. A simple example would be a contingency table tab with margin names "x", "y" and "z". To produce this plot either the default interface can be used or the formula interface via
cotabplot需要计算空调信息和设置的网格显示,然后靠面板上的功能,创建图的全表和调节信息。一个简单的例子是一个列联表tab与保证金名"x","y"和"z"。要产生这样的图,无论是默认接口,可用于通过公式接口
cotabplot(tab, "z") cotabplot(~ x + y | z, data = tab)
cotabplot(tab, "z")cotabplot(~ x + y | z, data = tab)
The panel function needs to be of the form
面板功能需要的形式
panel(x, condlevels)
panel(x, condlevels)
where x is the full table (tab in the example above) and condlevels is a named vector with the levels (e.g., c(z = "z1") in the example above).
x是全表(tab在上面的例子),condlevels是一个名为矢量的水平(例如,c(z = "z1")在上面的例子)。
Alternatively, panel can also be a panel-generating function of class "grapcon_generator" which creates a function with the interface described above. The panel-generating function is called with the interface
还有一种方法,panel还可以是一个面板产生类的函数"grapcon_generator"创建与上面所描述的接口的功能。面板产生的函数被调用的接口
panel(x, condvars, ...)
panel(x, condvars, ...)
where again x is the full table, condvars is now only a vector with the names of the conditioning variables (and not their levels, e.g., "z" in the example above). Further arguments can be passed to the panel-generating function via ... which also includes the arguments set in panel_args.
在那里再次x是完整的表,condvars现在只有一个矢量的调节变量的名称(和不是他们的水平,例如,"z"在上面的例子)。进一步的参数可以通过面板的功能,通过...其中还包括了参数设置在panel_args。
Suitable panel-generating functions for mosaic, association and sieve plots can be found at cotab_mosaic.
合适的面板功能,可以在cotab_mosaic马赛克,结社和筛图。
A description of the underlying ideas is given in Zeileis, Meyer, Hornik (2005).
描述的基本思想是在Zeileis,迈耶,霍尔尼克(2005年)。
(作者)----------Author(s)----------
Achim Zeileis <a href="mailto:Achim.Zeileis@R-project.org">Achim.Zeileis@R-project.org</a>
参考文献----------References----------
The visual design and control of trellis display. Journal of Computational and Graphical Statistics, 5, 123–155.
The strucplot framework: Visualizing multi-way contingency tables with <code>vcd</code>. Journal of Statistical Software, 17(3), 1-48. URL http://www.jstatsoft.org/v17/i03/ and available as <code>vignette("strucplot")</code>.
(conditional) independence, Journal of Computational and Graphical Statistics, 16, 507–525.
参见----------See Also----------
cotab_mosaic, cotab_coindep, co_table, coindep_test
cotab_mosaic,cotab_coindep,co_table,coindep_test
实例----------Examples----------
data("UCBAdmissions")
cotabplot(~ Admit + Gender | Dept, data = UCBAdmissions)
cotabplot(~ Admit + Gender | Dept, data = UCBAdmissions, panel = cotab_assoc)
ucb <- cotab_coindep(UCBAdmissions, condvars = "Dept", type = "assoc", n = 5000, margins = c(3, 1, 1, 3))
cotabplot(~ Admit + Gender | Dept, data = UCBAdmissions, panel = ucb)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|