
proc print data=develop(obs=15);
   var ccbal ccpurc income hmown;
run;

/* Create missing indicators */
/* missing indicators 생성 */

data develop1;
   set develop;
   /* name the missing indicator variables */
   array mi{*} MIAcctAg MIPhone MIPOS MIPOSAmt 
               MIInv MIInvBal MICC MICCBal 
               MICCPurc MIIncome MIHMOwn MILORes
               MIHMVal MIAge MICRScor;
   /* select variables with missing values */
   array x{*} acctage phone pos posamt 
              inv invbal cc ccbal
              ccpurc income hmown lores 
              hmval age crscore;
   do i=1 to dim(mi);  /*~ 15*/
      mi{i}=(x{i}=.);    /* missing->1 , 이외->0 */
   end;
run;


/* Impute missing values with the median */
/* 중앙값으로 결측치 보정 */
proc stdize data=develop1 
            reponly    /* missing값만 보정해라 */
            method=median    /* median으로 보정 */ 
            out=imputed;
   var &inputs;
run;
/* stdize procedure : The STDIZE procedure standardizes one or more numeric variables 
                            in a SAS data set by subtracting a location measure and 
                            dividing by a scale measure.  */
                            


proc print data=imputed(obs=12);
   var ccbal miccbal ccpurc miccpurc 
       income miincome hmown mihmown;
run;
