Learning SAS? Welcome to the exclusive online community for all SAS learners.

organizing dataset for cluster analysis n SAS

Reply
Occasional Contributor
Posts: 8

organizing dataset for cluster analysis n SAS

I found an excellent example of how to use SAS PROC CLUSTER do to a cluster analysis.  My problem is that my data is set up in a very different way.  I am hoping someone can give me advice on how to rearrange my data, and then procedue with SAS PROC CLUSTER.  I provide details below.  

 

The example that I am following has the object that you want to organize (fish species in this case) listed in the first column.  For example,

                           Variable X          Variable X2      Variable X3       Variable X4

Fish species           ###                     ###                   ####                 ####

 

I am trying to do the same thing.  I want to look for clusters of fish species.  However, my data is set up in a different way.  I want to see what fish species are caught with other fish species on fishing trips.  So each row is a trip.  An example is below.  

 

                                  Fish species 1          Fish species 2       Fish species 3      fish species 4       Depth         Gear

Trip A                             10                           3                               6                            9                     22             trap    

Trip B                              7                            8                              11                           7                     31             trap

Trip C                              6                            0                               0                            4                     55             hook

 

My objective is to do a cluster analysis to group the fish species by looking at the data from fishing trips.  For example, maybe fish species 4 should be grouped with fish species 1 because they are frequently caught together.    

 

I am stuck so any help would be greatly appreciated.  

 

Occasional Contributor
Posts: 8

Re: organizing dataset for cluster analysis n SAS

Posted in reply to elopomorph

The data in the post looks sloppy.  I repost my dataset structure below.

                 Fish species 1      Fish species 2       Fish species 3      fish species 4       Depth         Gear

Trip A         10                           3                               6                            9                     22             trap    

Trip B          7                            8                              11                           7                     31             trap

Trip C          6                            0                               0                            4                     55             hook

 

 

Ask a Question
Discussion stats
  • 1 reply
  • 244 views
  • 0 likes
  • 1 in conversation