turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- General Programming
- /
- How to apply factor & cluster analysis to populati...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-07-2014 12:17 AM

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?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-07-2014 11:40 AM

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.

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-10-2014 01:15 AM

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-16-2014 07:10 PM

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

Thanks for all your help!