0

I am trying to do a cluster analysis, based on the transactional data for a financial product, and try and measure their movement over time. I have my static cluster ready (based on the transactions in first quarter). Now I want to see their movement in the second quarter and see if they remain in the same cluster or move to a different cluster. I have the cluster mean and radius for each cluster and then measure the distance of new transactional readings to the cluster centroids and group them accordingly. But i am not sure how to measure this distance.

I am using SAS for my analysis.

  • This is probably better asked on http://stats.stackexchange.com/. That said, if you can provide sample data someone here might be able to help. – DomPazz Nov 28 '14 at 14:50

1 Answers1

0

Here is an example using proc fastclus.

/* Create initial clusters */
proc fastclus 
        data = sashelp.class 
        /* Output the cluster for each observation */
        out = cluster1 
        maxclusters = 2 
        /* Output the centroids */
        outseed = seed1; 
    var age height weight;
run;
/* Move the numbers around a bit to simulate a later snapshot */
data class2;
    set cluster1;
    drop distance;
    rename cluster = cluster1;
    age + rand("normal", 0, 5);
    height + rand("normal", 0, 5);
    weight + rand("normal", 0, 5);
run;
/* Apply the original clustering to the new data */
proc fastclus 
        data = class2 
        /* This output will contain the cluster and distance */
        out = cluster2 
        maxclusters = 2 
        /* Pass the initial centroids */
        seed = seed1
        /* Output the new cluster centroids */
        outseed = seed2 
        /* Prevent looking for better clusterings, change this if you want better clusters */
        maxiter = 0; 
    var age height weight;
run;
SRSwift
  • 1,700
  • 9
  • 11