Missing Value Imputation based on Clustering

The clustering based missing imputation assigns observations to clusters and fill in cluster means for missing observations.


Suppose the variable X1 is Cost and X2 is Salary. The non-missing cases have been clustered into three clusters.

Now you have a case with a value for Cost but not for Salary.

  • You determine which cluster's mean value is closest to the Cost value. 
  • Suppose this value of Cost is closest to the mean of the second cluster. 
  • To impute the missing value of Salary, you replace it with the mean value of  Salary for the second cluster.

proc fastclus data=training impute outiter outseed=seed out=training1 maxclusters=5;
var outcome survrate prognos amttreat gsi avoid intrus;

  1. IMPUTE requests imputation of missing values after the final assignment of observations to clusters. 
  2. OUTITER outputs information from the iteration history to the OUTSEED= data set, including the cluster seeds at each iteration.
  3. OUTSEED= is another name for the MEAN= data set, provided because the data set can contain location estimates other than means.
  4. MAXCLUSTERS= specifies the maximum number of clusters permitted. If you omit the MAXCLUSTERS= option, a value of 100 is assumed.

PROC FASTCLUS is then used to replace the missing values from the validation data set with the cluster means from the training data set computed at the first iteration.
proc fastclus data=valid impute seed=seed(where=(_iter_=1)) replace=none maxclusters=5 out=validate1 maxiter=0;
var outcome survrate prognos amttreat gsi avoid intrus;
SEED= specifies an input data set from which initial cluster seeds are to be selected.

REPLACE= specifies how seed replacement is performed. NONE suppresses the seed replacement.
Love this Post? Spread the Word!
Comment and share to motivate us to write more!
About Author:

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

Get Free Email Updates :
*Please confirm your email address by clicking on the link sent to your Email*
Related Posts:
0 Response to "Missing Value Imputation based on Clustering"

Post a Comment

We have Zero Tolerance to Spam. Comments with links will be deleted immediately upon our review.

Next → ← Prev
Scroll to Top