randomiser               package:made4               R Documentation

_R_a_n_d_o_m_l_y _r_e_a_s_s_i_g_n _t_r_a_i_n_i_n_g _a_n_d _t_e_s_t _s_a_m_p_l_e_s

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

     This function is used to check for bias between a training and
     test data. It return a new index, which randomly re-assigns
     samples in the training data to the test dataset and vice versa.

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

     randomiser(ntrain = 77, ntest = 19)

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

  ntrain: Numeric. A integer indicating the number of cases in the
          training dataset 

   ntest: Numeric. A integer indicating the number of cases in the test
          dataset 

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

     Produces new indices that can be used for training/test datasets

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

     It returns a list, containing 2 vectors 

  train : A vector of length ntrain, which can be used to index a new
          training dataset

   test : A vector of length ntest, which can be used to index a new
          test dataset

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

     Aedin Culhane

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

     randomiser(10,5)
     train<-matrix(rnorm(400), ncol=20, nrow=20, dimnames=list(1:20,
     paste("train",letters[1:20], sep=".")))
     test<-matrix(rnorm(200), ncol=10, nrow=20, dimnames=list(1:20,
     paste("test",LETTERS[1:10], sep=".")))
     all<-cbind(train,test)

     colnames(train)
     colnames(test)
     newInd<-randomiser(ntrain=20, ntest=10)

     newtrain<-all[,newInd$train]
     newtest<-all[,newInd$test]

     colnames(newtrain)
     colnames(newtest)

