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)

