complete                package:mice                R Documentation

_P_r_o_d_u_c_e_s _I_m_p_u_t_e_d _F_l_a_t _F_i_l_e_s
_f_r_o_m _M_u_l_t_i_p_l_y _I_m_p_u_t_e_d _D_a_t_a _S_e_t (_m_i_d_s)

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

     Takes an object of type mids, fills in the missing data, and
     returns the completed data in a specified format.

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

         complete(x, action=1)

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

       x: An object of class ''mids'' (created by the function
          'mice()').

  action: If action is a scalar between 1 and 'x$m', the function
          returns the data with the action's imputation filled in.
          Thus, 'action=1' returns the first completed data set.  The
          can also be one of the following strings: '"long"',
          '"broad"', '"repeated"'. This has the following meaning:
          \begin{description} \item['action="long"'] produces a long
          matrix with n*m rows,containing all imputed data plus two
          additional variables '"_ID_"' (containing the row.names) and
          '"_IMP_"' (containing the imputation number).
          \item['action="broad"'] produces a broad matrix with m times
          the number of columns in the original data. The first
          ncol('x$data') columns contain the first imputed data matrix.
          Column names are changed to reflect the imputation number.
          \item['action="repeated"'] produces a broad matrix with m
          times 'ncol(x$data)' columns. The first m columns give the
          filled-in first variable. Column names are changed to reflect
          the imputation number. \end{description} 

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

     A data frame with the imputed values filled in.

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

     Stef van Buuren, Karin Oudshoorn, 2000

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

     Van Buuren, S. & Oudshoorn, C.G.M. (2000). Multivariate Imputation
     by Chained Equations:  MICE V1.0 User's manual. Report
     PG/VGZ/00.038, TNO Prevention and Health, Leiden.

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

     'mice', 'mids'

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

     data(nhanes)
     imp <- mice(nhanes)     # do default multiple imputation on a numeric matrix
     mat <- complete(imp)    # fills in the first imputation
     mat <- complete(imp, 3) # fills in the third imputation
     mat <- complete(imp, "long") # produces a long matrix with stacked complete data
     mat <- complete(imp, "b") # a broad matrix
     cor(mat)                # for numeric mat, produces a blocked correlation matrix, where
                 # each m*m block contains of the same variable pair over different
                 # multiple imputations.

