<?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: Hierarchical clustering output without the tree figure in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Hierarchical-clustering-output-without-the-tree-figure/m-p/659181#M197539</link>
    <description>&lt;P&gt;When you create a scatter plot, add the GROUP= option. There are &lt;A href="https://go.documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_cluster_examples03.htm&amp;amp;docsetVersion=15.1&amp;amp;locale=en" target="_self"&gt;examples in the PROC CLUSTER documentation.&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 16 Jun 2020 00:11:21 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2020-06-16T00:11:21Z</dc:date>
    <item>
      <title>Hierarchical clustering output without the tree figure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hierarchical-clustering-output-without-the-tree-figure/m-p/658550#M197363</link>
      <description>I want to use&amp;nbsp;Hierarchical clustering to find the best number of clusters.&lt;BR /&gt;&lt;BR /&gt;However, I am not able to get the tree plot output from the following code.&lt;BR /&gt;&lt;BR /&gt;Please help me to take a look at it.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;data cars;&lt;BR /&gt;&lt;BR /&gt;set sashelp.cars;&lt;BR /&gt;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/*Learning from the data*/&lt;BR /&gt;&lt;BR /&gt;title "2004 Car Data";&lt;BR /&gt;&lt;BR /&gt;proc contents data=cars varnum;&lt;BR /&gt;&lt;BR /&gt;ods select position;&lt;BR /&gt;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;title "The First Five Observations Out of 428";&lt;BR /&gt;&lt;BR /&gt;proc print data=cars(obs=5) noobs;&lt;BR /&gt;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;title "The Type Variable";&lt;BR /&gt;&lt;BR /&gt;proc freq data=cars;&lt;BR /&gt;&lt;BR /&gt;tables Type;&lt;BR /&gt;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;/*Standardize data*/&lt;BR /&gt;&lt;BR /&gt;title "Standardize data";&lt;BR /&gt;&lt;BR /&gt;proc standard data = cars mean = 0 std = 1 out= carsSTD; var _numeric_;&lt;BR /&gt;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc print data = carsSTD (obs = 10);&lt;BR /&gt;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;proc aceclus data=carsSTD out=Ace p=.03 noprint;&lt;BR /&gt;&lt;BR /&gt;var MPG_Highway MSRP EngineSize Cylinders Horsepower MPG_City Weight Wheelbase Length;&lt;BR /&gt;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;ods graphics on;&lt;BR /&gt;&lt;BR /&gt;proc cluster data=Ace method=ward ccc pseudo print=20 out=tree&lt;BR /&gt;&lt;BR /&gt;plots=den(height=rsq);&lt;BR /&gt;&lt;BR /&gt;var can1-can3;&lt;BR /&gt;&lt;BR /&gt;id Make;&lt;BR /&gt;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;ods graphics off;</description>
      <pubDate>Mon, 15 Jun 2020 06:30:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hierarchical-clustering-output-without-the-tree-figure/m-p/658550#M197363</guid>
      <dc:creator>Siennayun</dc:creator>
      <dc:date>2020-06-15T06:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: Hierarchical clustering output without the tree figure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hierarchical-clustering-output-without-the-tree-figure/m-p/659027#M197454</link>
      <description>&lt;P&gt;It is always important to look at the SAS log to see if there are any WARNING or ERROR messages. For your example, the log says:&lt;/P&gt;
&lt;DIV id="sasLogWarning2_1592236374689" class="sasWarning"&gt;&lt;STRONG&gt;WARNING: The MAXPOINTS option value 200 is less than the number of clusters (428). This may&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV class="sasWarning"&gt;&lt;STRONG&gt;result in a dendrogram that is difficult to read. The dendrogram will not be displayed.&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV class="sasWarning"&gt;&lt;STRONG&gt;You can use the PLOTS(MAXPOINTS=) option in the PROC CLUSTER statement to change this&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV class="sasWarning"&gt;&lt;STRONG&gt;maximum.&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV class="sasWarning"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasWarning"&gt;If you add the suggested change [ PLOTS(MAXPOINTS=428)&lt;SPAN&gt;=den(height=rsq); ] and rerun the analysis, then you get a new WARNING:&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="sasWarning"&gt;&lt;STRONG&gt;WARNING: The DENDROGRAM will not be drawn because the NODEID values are not unique.&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV class="sasWarning"&gt;This tells you that the ID variable must have unique values. For your example, the MAKE variable does not have unique values and cannot be used as an ID.&amp;nbsp; You could create a unique ID by concatenating the MAKE and MODEL variables, but the strings will be very long. Or you can create a shorter ID for each observation such as '001', '002', etc.&lt;/DIV&gt;
&lt;DIV class="sasWarning"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasWarning"&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data cars;
   set sashelp.cars(obs=80);            /* use fewer obs */
   ModelMake = catx(":", make, model);  /* VERY long string! */
   MyID = put(_N_, Z3.);                /* a shorter string */
run;

/*Standardize data*/
title "Standardize data";
proc standard data=cars mean=0 std=1 out=carsSTD;
   var _numeric_;
run;

proc aceclus data=carsSTD out=Ace p=.03 ;
   var MPG_Highway MSRP EngineSize Cylinders Horsepower MPG_City Weight Wheelbase 
      Length;
run;

proc cluster data=Ace method=ward ccc pseudo print=20 out=tree 
      plots(MAXPOINTS=428)=den(height=rsq);
   var can1-can3;
   id MyID;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jun 2020 16:03:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hierarchical-clustering-output-without-the-tree-figure/m-p/659027#M197454</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2020-06-15T16:03:20Z</dc:date>
    </item>
    <item>
      <title>Re: Hierarchical clustering output without the tree figure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hierarchical-clustering-output-without-the-tree-figure/m-p/659150#M197518</link>
      <description>Hi Rick&lt;BR /&gt;&lt;BR /&gt;Thank you so much for your detailed explanation.&lt;BR /&gt;&lt;BR /&gt;It makes much sense now.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;May I ask another question?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;If I want to use the Hierarchical clustering to find the best number of clusters, and then set it as the K into the K-means cluster.&lt;BR /&gt;&lt;BR /&gt;Which method would you recommend finding the best number in this case? Shall I use several methods, such as "centroid, single, average, ward", to get the best number from the figure of "criteria for the number of clusters" respectively? And then, choose the number appeared at the most time as the K number.&lt;BR /&gt;&lt;BR /&gt;For example, the best number for single method is : 3, 8 , 11&lt;BR /&gt;For centroid method is: 3, 6,12&lt;BR /&gt;For average method is : 3, 5, 11 , 13&lt;BR /&gt;For ward method is: 10&lt;BR /&gt;In conclusion, 3 will be the best number of clusters.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Looking forward to your reply.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Mon, 15 Jun 2020 22:17:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hierarchical-clustering-output-without-the-tree-figure/m-p/659150#M197518</guid>
      <dc:creator>Siennayun</dc:creator>
      <dc:date>2020-06-15T22:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: Hierarchical clustering output without the tree figure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hierarchical-clustering-output-without-the-tree-figure/m-p/659169#M197530</link>
      <description>&lt;P&gt;I am not an expert on clustering, but, yes, that is essentially what I would do. For your data, there is evidence for 3, 6, and 12. If you project the data onto the first few principal components and color by the cluster number, that might help you decide.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jun 2020 23:51:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hierarchical-clustering-output-without-the-tree-figure/m-p/659169#M197530</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2020-06-15T23:51:29Z</dc:date>
    </item>
    <item>
      <title>Re: Hierarchical clustering output without the tree figure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hierarchical-clustering-output-without-the-tree-figure/m-p/659180#M197538</link>
      <description>I really appreciate your advice.&lt;BR /&gt;Is it possible for you to give me some guidance on how to color the&lt;BR /&gt;components by the cluster number? I am not that familiar with this part.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Jun 2020 00:06:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hierarchical-clustering-output-without-the-tree-figure/m-p/659180#M197538</guid>
      <dc:creator>Siennayun</dc:creator>
      <dc:date>2020-06-16T00:06:12Z</dc:date>
    </item>
    <item>
      <title>Re: Hierarchical clustering output without the tree figure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hierarchical-clustering-output-without-the-tree-figure/m-p/659181#M197539</link>
      <description>&lt;P&gt;When you create a scatter plot, add the GROUP= option. There are &lt;A href="https://go.documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_cluster_examples03.htm&amp;amp;docsetVersion=15.1&amp;amp;locale=en" target="_self"&gt;examples in the PROC CLUSTER documentation.&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 00:11:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hierarchical-clustering-output-without-the-tree-figure/m-p/659181#M197539</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2020-06-16T00:11:21Z</dc:date>
    </item>
    <item>
      <title>Re: Hierarchical clustering output without the tree figure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hierarchical-clustering-output-without-the-tree-figure/m-p/659182#M197540</link>
      <description>Great! Thank you so much!&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Jun 2020 00:14:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hierarchical-clustering-output-without-the-tree-figure/m-p/659182#M197540</guid>
      <dc:creator>Siennayun</dc:creator>
      <dc:date>2020-06-16T00:14:11Z</dc:date>
    </item>
  </channel>
</rss>

