permtest                package:BHH2                R Documentation

_P_e_r_m_u_t_a_t_i_o_n _t_e_s_t: _r_a_n_d_o_m_i_z_a_t_i_o_n _t_e_s_t _f_o_r _s_m_a_l_l _s_i_z_e _s_a_m_p_l_e_s

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

     Permutation test for means and variance comparisons.

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

            permtest(x, y = NULL)

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

       x: numeric vector. Sample group X.

       y: numeric vector. Sample group Y.

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

     In the one-sample problem, the function builds all 2^n possible
     +/- x_i combinations. For the two-sample problem, all possible
     B(n+m,n) samples size n (='length(x)') and m (='length(y)') are
     generated and the permutation distributions for the _t_-statistics
     and _F_-ratios. _p_-values are computed based on these
     distributions.

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

     The function returns the number N of different samples generated
     for the permutation distribution, the observed _t_-statistic, its
     _p_-value, based on both, the parametric and permutation
     distributions as well as the observed _F_-ratio and its
     corresponding _p_-values. The test may take a long time to
     generate all the possible combinations. It has been tested for n +
     m = 22 and n < 12.

_W_A_R_N_I_N_G:

     The test may take a long time to generate all the possible
     combinations.

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

     Ernesto Barrios

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

     Box G. E. P, Hunter, J. S. and Hunter, W. C. (2005).  _Statistics
     for Experimenters II_. New York: Wiley.

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

     'onet.permutation' and 'towt.permutation' of 'DAAG' package, and
     'perm.test' of the 'exactRankTests'.

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

     library(BHH2)

     # Permutation test for Tomato Data
     data(tomato.data)
     cat("Tomato Data (not paired):\n")
     attach(tomato.data)
     a <- pounds[fertilizer=="A"]
     b <- pounds[fertilizer=="B"]
     print(round(test <- permtest(b,a),3))
     detach()

     # Permutation test for Boy's Shoes Example
     data(shoes.data)
     cat("Shoes Data (paired):\n")
     attach(shoes.data)
     x <- matB-matA
     print(round(test <- permtest(x),3))
     detach()

