twPERM               package:ppiStats               R Documentation

_A _f_u_n_c_t_i_o_n _t_o _c_o_m_p_u_t_e _a _p_e_r_m_u_t_a_t_i_o_n _t_e_s_t _o_n _a _t_w_o _w_a_y _t_a_b_l_e._h

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

     This function takes the entries of a two-way table and creates two
     binary logical vectors upon which it computes a permutation test
     to check for independence.

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

     twowayPERM( v1, v2, NPERM, stat, seed = 123)
     makeBinVect(n11, n12, n21, n22)

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

      v1: A logical vector.

      v2: A logical vector the same length as v1.

   NPERM: A positive integer. The number of tests to be conducted.

    stat: A statistical function passed into to test the permutation on
          two vectors.

    seed: A positive integer. To set the seed for the random number
          generator.

     n11: A postive integer. The value of (1,1) in the two way table.

     n12: A postive integer. The value of (1,2) in the two way table.

     n21: A postive integer. The value of (2,1) in the two way table.

     n22: A postive integer. The value of (2,2) in the two way table.

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

     A numeric vector containing the p-values for the test that the
     permutation of the vector v1 is independent from v2.

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

     T Chiang

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

     x <- makeBinVect(13, 17, 23, 71)

