Impute Missing Values without SAS Macro


SAS Analytics : Practical SAS, Statistics & Analysis Course

Suppose you have data consisting of 1000 variables and you need to impute missing values with mean/median. You can do it easily with PROC STDIZE.
proc stdize data= test out= result method=mean reponly;
var X1-X1000 ;
run;
By specifying the REPONLY option, the STDIZE procedure does not standardize the numeric variables; it replaces the missing values with the METHOD= statistic. 

Other Useful METHOD= statistic options

  1. MEDIAN
  2. MIDRANGE
  3. IQR
  4. MAXABS : Maximum Absolute Value
  5. STD : Standard Deviation

If you want to replace missing values with 0 or any number

proc stdize data=develop1 reponly missing=0 out=imputed;
var mortdue value yoj derog delinq clage ninq clno debtinc;
run;

Note : You cannot use MISSING and METHOD options together.
Coursera Data Science

SAS Tutorials : 100 Free SAS Tutorials

Get Free Email Updates :
*Please confirm your email address by clicking on the link sent to your Email*

Related Posts:

0 Response to "Impute Missing Values without SAS Macro"

Post a Comment

Next → ← Prev