<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: In Proc cluster, how to know an observation was assigned in which cluster? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/In-Proc-cluster-how-to-know-an-observation-was-assigned-in-which/m-p/800988#M315197</link>
    <description>&lt;P&gt;You may want to consider a different cluster procedure if you want cluster identification added to existing data. Here is a small example you can run as you should have the SASHELP.CLASS data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;
proc fastclus data=sashelp.class maxclusters=3 out=want ;
   var height weight;
run;&lt;/PRE&gt;
&lt;P&gt;The output data set, want, has all of the variables from the SASHELP.CLASS data set plus two variables, Cluster - cluster assigned, and Distance a measure used in the assignment of cluster. There are different options involved in specifying the cluster building.Note that Maxclusters sets the maximum number of clusters which I picked just as an example as 3 because the sample data set is small and just wanted to show something that may be viable option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FASTCLUS is designed to work with large data sets so may not be quite as precise for smaller sets. It also may work better with standardized data&lt;/P&gt;</description>
    <pubDate>Wed, 09 Mar 2022 04:00:53 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2022-03-09T04:00:53Z</dc:date>
    <item>
      <title>In Proc cluster, how to know an observation was assigned in which cluster?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/In-Proc-cluster-how-to-know-an-observation-was-assigned-in-which/m-p/800971#M315182</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to do a clustering analysis. Here is my code and output from PROC CLUSTER:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;PROC CLUSTER Data=Dist METHOD=average OUTTREE=tree PSEUDO print=15;
id record_id_char;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 473px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/69264i39FDD78AB5CFC998/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have 240 observations, and my question is if I choose 4 clusters, how do I know each observation was assigned to which clusters? I'd like to create a new categorical variable called "cluster" which contains this information for each observation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see there is an output dataset called "tree" from the above code. The first 10 print of "tree" is below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 793px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/69266iF2DA9566EE78ABB7/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;It shows how each observation was assigned. But it is hard to track one by one. Is there a way to get this information from the output? Please help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Kenny&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2022 01:31:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/In-Proc-cluster-how-to-know-an-observation-was-assigned-in-which/m-p/800971#M315182</guid>
      <dc:creator>zzdwcrzlj1</dc:creator>
      <dc:date>2022-03-09T01:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: In Proc cluster, how to know an observation was assigned in which cluster?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/In-Proc-cluster-how-to-know-an-observation-was-assigned-in-which/m-p/800975#M315186</link>
      <description>I think you need to use PROC TREE to get that info.</description>
      <pubDate>Wed, 09 Mar 2022 02:44:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/In-Proc-cluster-how-to-know-an-observation-was-assigned-in-which/m-p/800975#M315186</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-03-09T02:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: In Proc cluster, how to know an observation was assigned in which cluster?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/In-Proc-cluster-how-to-know-an-observation-was-assigned-in-which/m-p/800981#M315190</link>
      <description>&lt;P&gt;Hi Reeza,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did use the proc tree. The plot is like below. Since I have too many obs, this is not very informative.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 817px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/69267iAB853895853CA418/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2022 03:26:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/In-Proc-cluster-how-to-know-an-observation-was-assigned-in-which/m-p/800981#M315190</guid>
      <dc:creator>zzdwcrzlj1</dc:creator>
      <dc:date>2022-03-09T03:26:12Z</dc:date>
    </item>
    <item>
      <title>Re: In Proc cluster, how to know an observation was assigned in which cluster?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/In-Proc-cluster-how-to-know-an-observation-was-assigned-in-which/m-p/800987#M315196</link>
      <description>Did you check the output dataset from PROC TREE?</description>
      <pubDate>Wed, 09 Mar 2022 03:59:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/In-Proc-cluster-how-to-know-an-observation-was-assigned-in-which/m-p/800987#M315196</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-03-09T03:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: In Proc cluster, how to know an observation was assigned in which cluster?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/In-Proc-cluster-how-to-know-an-observation-was-assigned-in-which/m-p/800988#M315197</link>
      <description>&lt;P&gt;You may want to consider a different cluster procedure if you want cluster identification added to existing data. Here is a small example you can run as you should have the SASHELP.CLASS data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;
proc fastclus data=sashelp.class maxclusters=3 out=want ;
   var height weight;
run;&lt;/PRE&gt;
&lt;P&gt;The output data set, want, has all of the variables from the SASHELP.CLASS data set plus two variables, Cluster - cluster assigned, and Distance a measure used in the assignment of cluster. There are different options involved in specifying the cluster building.Note that Maxclusters sets the maximum number of clusters which I picked just as an example as 3 because the sample data set is small and just wanted to show something that may be viable option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FASTCLUS is designed to work with large data sets so may not be quite as precise for smaller sets. It also may work better with standardized data&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2022 04:00:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/In-Proc-cluster-how-to-know-an-observation-was-assigned-in-which/m-p/800988#M315197</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-03-09T04:00:53Z</dc:date>
    </item>
  </channel>
</rss>

