tabpct                package:epicalc                R Documentation

_T_w_o-_w_a_y _t_a_b_u_l_a_t_i_o_n

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

     Two-way tabulation with automatic mosaic plot

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

     tabpct (row, col, ..., decimal = 1, percent = c("both", "col", "row"), 
     graph = TRUE, las = 0)  

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

row, col: variables

     ...: additional arguments for 'table'

 decimal: number of decimals for the percentage in the table

 percent: orientation of the percentage in the table

   graph: automatic graphing

     las: orientation of group labelling, 

          0: always parallel to axis

          1: always horizontal,

          2: always perpendicular to the axis,

          3: always vertical. 

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

     'tabpct' gives column and row percent cross-tabulation as well as
     mosaic plot. 

     The width of the bar in the plot denotes the relative proportion
     of the row variable.

     Inside each bar, the relative proportion denotes the distribution
     of column variables within each row variable.

     Note that 'row' and 'col' arguments of this function are for the
     table, not the mosaic plot and the default value for the 'percent'
     orientation is "both".

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

     Tables of row and column percentage

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

     Virasakdi Chongsuvivatwong <cvirasak@medicine.psu.ac.th>

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

     'tab1', 'table', 'mosaicplot'

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

     data(Oswego)
     .data <- Oswego
     attach(.data)

     # The above commands generate a data frame. 
     # In reality, one just exploits 'use("Oswego.rec")', if the file is available.
     agegr <- cut(age, breaks=c(0,20,40,60,80))
     label.var(agegr, "age group")
     tabpct(agegr, ill)

