imputationList            package:mitools            R Documentation

_C_o_n_s_t_r_u_c_t_o_r _f_o_r _i_m_p_u_t_a_t_i_o_n_L_i_s_t _o_b_j_e_c_t_s

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

     Create and update 'imputationList' objects to be used as input to
     other 'MI' routines.

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

     imputationList(datasets)
     ## S3 method for class 'imputationList':
     update(object,...)
     ## S3 method for class 'imputationList':
     rbind(...)
     ## S3 method for class 'imputationList':
     cbind(...)

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

datasets: a list of data frames corresponding to the multiple
          imputations

  object: An object of class 'imputationList'

     ...: Arguments 'tag=expr' to 'update' will create new variables
          'tag'  by evaluating 'expr' in each imputed dataset

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

     An object of class 'imputationList'

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

     data.dir<-system.file("dta",package="mitools")
     files.men<-list.files(data.dir,pattern="m.\.dta$",full=TRUE)
     men<-imputationList(lapply(files.men, foreign::read.dta))
     files.women<-list.files(data.dir,pattern="f.\.dta$",full=TRUE)
     women<-imputationList(lapply(files.women, foreign::read.dta))
     men<-update(men, sex=1)
     women<-update(women,sex=0)
     all<-rbind(men,women)
     all<-update(all, drinkreg=as.numeric(drkfre)>2)
     all

