ctab                 package:catspec                 R Documentation

_P_e_r_c_e_n_t_a_g_e _t_a_b_l_e_s

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

     Prints one-way, two-way or multiway percentage tables

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

     ctab(..., digits = 2, type = c("n", "row", "column", "total"),
     row.vars = NULL, col.vars = NULL, percentages = TRUE)

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

     ...: one or more factors or a table object of class 'table',
          'xtabs', or 'ftable'

  digits: number of decimal places (default 2)

    type: Row, column, total percentages or counts ('type=n')

row.vars: 

col.vars: Same as 'ftable'

percentages: If 'FALSE', proportions rather than percentages are
          printed

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

     Simplifies the production of (multiway) percentage tables.

_V_a_l_u_e:

     For one-way and two-way tables, a 'table' object is returned. For
     three-way and higher tables, an 'ftable' object is returned.

_N_o_t_e:

     If the table contains three or more factors, the first is treated
     by default as the row variable, the second as the column variable,
     the third and following as grouping variables. This can be
     overridden using 'row.vars' and/or 'col.vars'. Note that 
     'CrossTable' in the 'gregmisc' package also provides an easy
     method for producing percentage tables but only for two-way
     tables.

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

     John Hendrickx <John_Hendrickx@yahoo.com>

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

     <URL: http://www.xs4all.nl/~jhckx/>

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

     'table', 'ftable', 'xtabs', 'prop.table', 'CrossTable'

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

     data(Titanic)
     ctab(Titanic)
     ctab(Titanic,type="r")
     ctab(Titanic,row.vars=1:3,type="r")
     ctab(Titanic,col.vars=c(2,4),type="r")
     ctab(Titanic,row.vars=c(1,3),type="c")
     ctab(Titanic,col.vars=c("Sex","Survived"),type="r")
     ctab(Titanic,col.vars=c("Sex","Survived"),type="t")

