printTable2             package:sfsmisc             R Documentation

_B_e_r_e_c_h_n_e _u_n_d _D_r_u_c_k_e _R_a_n_d_t_o_t_a_l_e _e_t_c _f_r _2-_w_e_g _K_o_n_t_i_n_g_e_n_z _T_a_f_e_l_n

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

     2-weg Kontingenztafel mit allem zusammen

     'margin2table()' computes marginals adds them to the table and
     returns a 'margin2table' object the print method for which adds
     text decorations (using '"-"' and '"|"').

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

     printTable2(table2, digits = 3)
     margin2table(x, totName = "sum")
     ## S3 method for class 'margin2table':
     print(x, digits = 3, ...)

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

  table2: Matrix mit Anzahlen, die Kontingenztafel.

       x: a matrix, or the result of 'margin2table'.

  digits: Anzahl Dezimalstellen, auf die die Hufigkeiten gerundet
          werden sollen.

 totName: string to use as row- and column- name if 'x' has
          corresponding 'dimnames'.

     ...: further potential arguments, unused currently.

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

     'margin2table' returns a matrix with _added marginals_, i.e., an
     extra row and column, and is of class 'margin2table' which has a
     nice print method.

     'printTable2' is just producing output.

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

     Martin Maechler, Feb.1993; then Dec 2003

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

     'table', 'ftable'.

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

     m <- diag(3); colnames(m) <- letters[1:3]
     margin2table(m)
     margin2table(m / sum(m))

     data(HairEyeColor)
     margin2table(HairEyeColor[,, "Male"])
     printTable2(HairEyeColor[,, "Male"])
     printTable2(HairEyeColor[,, "Female"])

