fill.missing             package:maanova             R Documentation

_F_i_l_l _i_n _m_i_s_s_i_n_g _d_a_t_a

_D_e_s_c_r_i_p_t_i_o_n:

     This is the function to do missing data imputation.

_U_s_a_g_e:

     fill.missing(data, method="knn", k=20, dist.method="euclidean")

_A_r_g_u_m_e_n_t_s:

    data: An object of class 'madata', which should be the result from
          'read.madata'.

  method: The method to do missing data imputation. Currently only
          "knn" (K nearest neighbour) is implemented.

       k: Number of neighbours used in imputation. Default is 20.

dist.method: The distance measure to be used. See 'dist' for detail.

_D_e_t_a_i_l_s:

     This function will take an object of class 'madata' and fill in
     the missing data. Currently only KNN (K nearest neighbour)
     algorithm is implemented. The memory usage is quadratic in the
     number of genes.

_V_a_l_u_e:

     An object of class 'madata' with missing data filled in.

_A_u_t_h_o_r(_s):

     Hao Wu

_R_e_f_e_r_e_n_c_e_s:

     *  O.Troyanskaya, M. Cantor, G. Sherlock, P. Brown, T. Hastie, R.
        Tibshirani, D. Botstein, & R. B. Altman. Missing Value
        estimation methods for DNA microarrays. Bioinformatics
        17(6):520-525, 2001.

_E_x_a_m_p_l_e_s:

     data(abf1)
     # randomly generate some missing data 
     rawdata <- abf1
     ndata <- length(abf1$data)
     pct.missing <- 0.05 # 5
     idx.missing <- sample(ndata, floor(ndata*pct.missing))
     rawdata$data[idx.missing] <- NA
     rawdata <- fill.missing(rawdata)
     # plot impute data versus original data
     plot(rawdata$data[idx.missing], abf1$data[idx.missing])
     abline(0,1)

