Brat                  package:VGAM                  R Documentation

_I_n_p_u_t_t_i_n_g _D_a_t_a _t_o _f_i_t _a _B_r_a_d_l_e_y _T_e_r_r_y _M_o_d_e_l

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

     Takes in a square matrix of counts and outputs them in a form that
     is accessible to the 'brat' and 'bratt' family functions.

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

     Brat(mat, ties=0*mat, string=c(" > "," == "))

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

     mat: Matrix of counts, which is considered M by M in dimension
          when there are ties, and M+1 by M+1  when there are no ties.
          The rows are winners and the columns are losers, e.g., the
          2-1 element is now many times Competitor 2 has beaten
          Competitor 1. The matrices are best labelled with the
          competitors' names. 

    ties: Matrix of counts. This should be the same dimension as 'mat'.
          By default, there are no ties. The matrix must be symmetric,
          and the diagonal should contain 'NA's.  

  string: Character.  The matrices are labelled with the first value of
          the descriptor, e.g., '"NZ > Oz"' `means' NZ beats Australia
          in rugby. Suggested alternatives include '" beats "' or '"
          wins against "'. The second value is used to handle ties.

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

     In the 'VGAM' package  it is necessary for each matrix to be
     represented as a single row of data by 'brat' and 'bratt'. Hence
     the non-diagonal elements of the M+1 by M+1 matrix are
     concatenated into M(M+1) values (no ties), while if there are
     ties, the non-diagonal elements of the M by M matrix are
     concatenated into M(M-1) values.

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

     A matrix with 1 row and either M(M+1) or M(M-1) columns.

_N_o_t_e:

     This is a data preprocessing function for 'brat' and 'bratt'.

     Yet to do: merge 'InverseBrat' into 'brat'.

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

     T. W. Yee

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

     Agresti, A. (2002) _Categorical Data Analysis_, 2nd ed. New York:
     Wiley.

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

     'brat', 'bratt', 'InverseBrat'.

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

     journal = c("Biometrika", "Comm Statist", "JASA", "JRSS-B")
     m = matrix(c( NA, 33, 320, 284,   730, NA, 813, 276,
                  498, 68,  NA, 325,   221, 17, 142, NA), 4,4)
     dimnames(m) = list(winner = journal, loser = journal)
     Brat(m)
     vglm(Brat(m) ~ 1, brat, trace=TRUE)

