cotab_panel               package:vcd               R Documentation

_P_a_n_e_l-_g_e_n_e_r_a_t_i_n_g _F_u_n_c_t_i_o_n_s _f_o_r _C_o_n_t_i_n_g_e_n_c_y _T_a_b_l_e _C_o_p_l_o_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     Panel-generating functions visualizing contingency tables that can
     be passed to 'cotabplot'.

_U_s_a_g_e:

     cotab_mosaic(x = NULL, condvars = NULL, ...)
     cotab_assoc(x = NULL, condvars = NULL, ylim = NULL, ...)
     cotab_sieve(x = NULL, condvars = NULL, ...)
     cotab_fourfold(x = NULL, condvars = NULL, ...)
     cotab_coindep(x, condvars,
       test = c("max", "Chisq"), level = NULL, n = 1000,
       h = NULL, c = NULL, l = NULL, lty = 1,
       type = c("mosaic", "assoc"),
       legend = FALSE, ylim = NULL, ...)

_A_r_g_u_m_e_n_t_s:

       x: an contingency tables in array form.

condvars: margin name(s) of the conditioning variables.

    ylim: y-axis limits for 'assoc' plot. By default this is computed
          from 'x'.

    test: character indicating which type of statistic should be used
          for assessing conditional independence.

level,n,h,c,l,lty: variables controlling the HCL shading of the
          residuals, see 'shading_max' for more details.

    type: character indicating which type of plot should be produced.

  legend: logical. Should a legend be produced in each panel?

     ...: further arguments passed to the plotting function (such as
          'mosaic' or 'assoc' or 'sieve' respectively).

_D_e_t_a_i_l_s:

     These functions of class '"panel_generator"' are panel-generating
     functions for use with 'cotabplot', i.e., they return functions
     with the interface

     'panel(x, condlevels)'

     required for 'cotabplot'. The functions produced by
     'cotab_mosaic', 'cotab_assoc' and 'cotab_sieve' essentially only
     call 'co_table' to produce the conditioned table and then call
     'mosaic', 'assoc' or 'sieve' respectively with the arguments
     specified.

     The function 'cotab_coindep' is similar but additionally chooses
     an appropriate residual-based shading visualizing the associated
     conditional independence model. The conditional independence test
     is carried out via 'coindep_test' and the shading is set up via
     'shading_hcl'.

     A description of the underlying ideas is given in Zeileis, Meyer,
     Hornik (2005).

_A_u_t_h_o_r(_s):

     Achim Zeileis Achim.Zeileis@R-project.org

_R_e_f_e_r_e_n_c_e_s:

     Zeileis, A., Meyer, D., Hornik K. (2005), _Residual-based shadings
     for visualizing (conditional) independence_, Research Report,
     *20*. <URL: http://epub.wu-wien.ac.at/>

_S_e_e _A_l_s_o:

     'cotabplot', 'mosaic', 'assoc', 'sieve', 'co_table',
     'coindep_test', 'shading_hcl'

_E_x_a_m_p_l_e_s:

     data(UCBAdmissions)

     cotabplot(~ Admit + Gender | Dept, data = UCBAdmissions)
     cotabplot(~ Admit + Gender | Dept, data = UCBAdmissions, panel = cotab_assoc)
     cotabplot(~ Admit + Gender | Dept, data = UCBAdmissions, panel = cotab_fourfold)

     ucb <- cotab_coindep(UCBAdmissions, condvars = "Dept", type = "assoc", n = 5000, margins = c(3, 1, 1, 3))
     cotabplot(~ Admit + Gender | Dept, data = UCBAdmissions, panel = ucb)

