How to apply factor & cluster analysis to population

Reply
Occasional Contributor
Posts: 6

How to apply factor & cluster analysis to population

I'm doing some clustering analysis so I used PROC FACTOR on about 70 variables to first create factors, then ran PROC FASTCLUS on the resulting 15 factors to divide them into clusters. I did this on a sample of 100k records out of over a million.

So now I'm trying to take that clustering as-is and apply it to the entire population of 1mill+. So I have a file of all 1mill+ records and the 70 key variables, and need to apply the same factoring I used on my sample to get the 15 factors for them. Then I need to apply the same clustering I got from the sample to the full population. I don't want to refresh or re-cluster the data, just roll out the existing clustering.

I'm not really sure if SAS has an easy way to do this. I've used the OUTSTAT options in both PROC FACTOR and PROC FASTCLUS to store the factor scores and the cluster centroids. It should be just a matter of applying those to my 1mill+ population dataset. Is there some kind of INSTAT option?

Super User
Posts: 17,831

Re: How to apply factor & cluster analysis to population

Start with the Proc Factor replication:

Check out Proc Score that will allow you to replicate this. You may want to test this to ensure you're getting what you expect.

SAS/STAT(R) 9.22 User's Guide

The replication of the Clustering is a question that has been asked on here before so searching will get you the answer, which I think is, it depends on the type of clustering performed and may not be possible for all types of clustering.

Occasional Contributor
Posts: 6

Re: How to apply factor & cluster analysis to population

Thanks that works great for the factor analysis. On the cluster analysis, I used PROC FASTCLUS which I believe is k-means clustering. I stored the OUTSTAT output which contains all the cluster centroids:

PROC FASTCLUS DATA=FactoredData

  MAXC=16 MAXITER=5 REPLACE=NONE STRICT=5 OUT=FileOut OUTSTAT=StatOut;

  VAR Factor1 Factor2 Factor3 Factor4 Factor5 Factor6 Factor7 Factor8 Factor9 Factor10 Factor11 Factor12 Factor13 Factor14 Factor15;

RUN;

so in theory there's no reason I can't cluster the full population with the same clustering. I just need to know if there's a command and what the syntax is. I could even do it manually if necessary, it's just a Euclidean distance metric. But it'd be a lot neater if there's already a command to do that, like PROC SCORE did for the factor analysis.

Occasional Contributor
Posts: 6

Re: How to apply factor & cluster analysis to population

Actually never mind, I figured it out in the end. Had to use the INSTAT option in PROC FASTCLUS.

Thanks for all your help!

Ask a Question
Discussion stats
  • 3 replies
  • 844 views
  • 4 likes
  • 2 in conversation