getPImatrix               package:safe               R Documentation

_G_e_n_e_r_a_t_i_o_n _o_f _a _P_i _m_a_t_r_i_x

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

     A function to generate random permutations of the data.
     Permutations are stored as a matrix with each row containing the
     permuted order as the reordered integers from 1 to n.

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

     getPImatrix(n, K= ,method=)
     getPImatrix(y.vec= , K=)
     getPImatrix(block.vec=, K=)

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

       n: Number of samples or length of the response vector 

   y.vec: Response vector for a SAFE analysis 

block.vec: A character or numeric vector containing the blocking
          assignments (see Details:).

       K: Number of permutations to generate 

  method: For 'method' = "random" each permutation is a random
          reordering of 1 through n (with or without blocks). Future
          versions will allow 'method' = "exaust" to give all unique
          permuations for a moderate number of arrays. 

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

     'getPImatrix' is provided as a separate function from 'safe', so
     that a matrix of permutation assignments can be created and stored
     to reproduce identical results. In some experimental designs it
     may be appropriate to generate blocked  permutaions of the
     samples, that hold another effect constant. By specifying
     'block.vec', only the column numbers sharing a unique value in the
     vector will be permuted.

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

     A matrix is returned with each row containing a permutation of the
     integers from 1 to n. The first row is restricted to the ordered
     integers to represent the  observed data.

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

     William T. Barry: wbarry@bios.unc.edu

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

     W. T. Barry, A. B. Nobel and F.A. Wright, 2004, _Significance
     Analysis of functional categories in gene expression studies: a
     structured permutation approach_, _Bioinformatics_ In press. 

     See also the vignette included with this package.

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

     {'safe'.}

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

     ## Random permutations for 8 samples
     getPImatrix( n = 8, K = 5)

     ## Random permutations within blocks 
     block <- rep(0:1,each=4)
     block

     getPImatrix(block.vec = block, K = 5)

