s2k                   package:gap                   R Documentation

_S_t_a_t_i_s_t_i_c_s _f_o_r _2 _b_y _K _t_a_b_l_e

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

     This function calculates one-to-others and maximum accumulated
     chi-squared statistics for a 2 by K contingency table.

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

     s2k(y1,y2)

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

      y1: a vector containing the first row of a 2 by K contingency
          table

      y2: a vector containing the second row of a 2 by K contingency
          table

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

     The returned value is a list containing:

     x2a: the one-to-other chisquare

     x2b: the maximum accumulated chisquare

    col1: the column index for x2a

    col2: the column index for x2b

       p: the corresponding p value

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

     Hirotsu C, Aoki S, Inada T, Kitao Y (2001) An exact test for the
     association  between the disease and alleles at highly polymorphic
     loci with particular interest  in the haplotype analysis.
     Biometrics 57:769-778

_N_o_t_e:

     The lengths of y1 and y2 should be the same

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

     Chihiro Hirotsu, Jing hua Zhao

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

     ## Not run: 
     # an example from Mike Neale
     # termed 'ugly' contingency table by Patrick Sullivan
     y1 <- c(2,15,16,35,132,30,25,7,12,24,10,10,0)
     y2 <- c(0, 6,31,49,120,27,15,8,14,25, 3, 9,3)

     result <- s2k(y1,y2)
     ## End(Not run)

