SAS: Impute Missing Values

Deepanshu Bhalla Add Comment

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.

Related Posts
Spread the Word!
Share
About Author:
Deepanshu Bhalla

Deepanshu founded ListenData with a simple objective - Make analytics easy to understand and follow. He has over 10 years of experience in data science. During his tenure, he worked with global clients in various domains like Banking, Insurance, Private Equity, Telecom and HR.

Post Comment 0 Response to "SAS: Impute Missing Values"
Next → ← Prev