<?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 Using the Hier Clust Function in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Using-the-Hier-Clust-Function/m-p/394633#M64505</link>
    <description>&lt;P&gt;Hi. &amp;nbsp;How can I sort a vector of data into clusters using the "Hier Clust()" function? &amp;nbsp;I'm aware this can be done for a data column in a table, using the tools in the Clustering menu. However, I'm interested in doing this without a table or involving a GUI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hier Clust() takes a data vector and returns a list of 5 vectors: {OldToNew, NewToOld, Leader, Joiner, Distance}. &amp;nbsp;So, perhaps a more specific question is: how can I use this information to assign a cluster to each item in my original vector?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using JMP Pro 15.2.1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As always, thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2023 19:50:16 GMT</pubDate>
    <dc:creator>nikles</dc:creator>
    <dc:date>2023-06-09T19:50:16Z</dc:date>
    <item>
      <title>Using the Hier Clust Function</title>
      <link>https://community.jmp.com/t5/Discussions/Using-the-Hier-Clust-Function/m-p/394633#M64505</link>
      <description>&lt;P&gt;Hi. &amp;nbsp;How can I sort a vector of data into clusters using the "Hier Clust()" function? &amp;nbsp;I'm aware this can be done for a data column in a table, using the tools in the Clustering menu. However, I'm interested in doing this without a table or involving a GUI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hier Clust() takes a data vector and returns a list of 5 vectors: {OldToNew, NewToOld, Leader, Joiner, Distance}. &amp;nbsp;So, perhaps a more specific question is: how can I use this information to assign a cluster to each item in my original vector?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using JMP Pro 15.2.1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As always, thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 19:50:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-the-Hier-Clust-Function/m-p/394633#M64505</guid>
      <dc:creator>nikles</dc:creator>
      <dc:date>2023-06-09T19:50:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using the Hier Clust Function</title>
      <link>https://community.jmp.com/t5/Discussions/Using-the-Hier-Clust-Function/m-p/394748#M64526</link>
      <description>&lt;P&gt;Answering my own question in case anyone finds it helpful. &amp;nbsp;I was able to find a way to determine the cluster for a vector of data x_vec (assuming nclusters) using this script:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;hc_lis = Hier Clust(x_vec);
ldr_vec = Eval(hc_lis[3]);
jnr_vec = Eval(hc_lis[4]);
c_vec = (1::NItems(ldr_vec))`;     //initialize a vector that will become the cluster ids
For(i=1, i&amp;lt;=NItems(ldr_vec) - nclusters, i++,
	loc_vec = Loc(c_vec, jnr_vec[i]);
	c_vec[loc_vec] = ldr_vec[i];
);
c_aa = AssociativeArray(c_vec);
c_lis = c_aa &amp;lt;&amp;lt; Get Keys;    //list of just the cluster ids&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This returns c_vec, which is a matrix the same size as x_vec, where c_vec[I] = the cluster id number of x_vec[I]. &amp;nbsp;Also returned is c_lis, which is just a list of the cluster ids. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If there's a faster or more elegant way to do this, please let me know.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jun 2021 15:25:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-the-Hier-Clust-Function/m-p/394748#M64526</guid>
      <dc:creator>nikles</dc:creator>
      <dc:date>2021-06-21T15:25:14Z</dc:date>
    </item>
  </channel>
</rss>

