Impute Missing Values without SAS Macro

Live Online Training : SAS Programming with 50+ Case Studies

- Explain Programming Concepts in Simple English
- Live Projects
- Scenario Based Questions
- Job Placement Assistance
- Get 10% off till Oct 26, 2017
- Batch starts from October 28, 2017

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.

SAS Tutorials : 100 Free SAS Tutorials

About Author:

Deepanshu founded ListenData with a simple objective - Make analytics easy to understand and follow. He has close to 7 years of experience in data science and predictive modeling. During his tenure, he has worked with global clients in various domains like retail and commercial banking, Telecom, HR and Automotive.


While I love having friends who agree, I only learn from those who don't.

Let's Get Connected: Email | LinkedIn

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