<?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 Which clustering method to use in PROC CLUSTER after inputting Gower dissimilarity matrix? in SAS Data Science</title>
    <link>https://communities.sas.com/t5/SAS-Data-Science/Which-clustering-method-to-use-in-PROC-CLUSTER-after-inputting/m-p/347481#M5186</link>
    <description>&lt;P&gt;I'm planning on performing a cluster analysis in SAS EG 6.1 on a health care dataset&amp;nbsp;containing about 4,000 observations and ~100 nominal, interval, and ratio variables. The Gower similarity coefficient is a recommended distance measure&amp;nbsp;for mixed variables types, which can be calculated using the DISTANCE procedure. The Gower dissimilarity matrix generated from PROC DISTANCE, gower_distance, will then be used as the input dataset for PROC CLUSTER.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc distance data=health_data method=dgower out=gower_distance;
	var nominal(...) interval(...) ratio(...);
	id member_id;
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Question: Which clustering method is recommended in PROC CLUSTER for a Gower dissimilarity matrix?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Clustering methods that use an Euclidean distance measure, such as Centroid and Ward's Minimum Variance, can be ruled out, but that leaves a number of options.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Wed, 05 Apr 2017 17:52:34 GMT</pubDate>
    <dc:creator>RobertF</dc:creator>
    <dc:date>2017-04-05T17:52:34Z</dc:date>
    <item>
      <title>Which clustering method to use in PROC CLUSTER after inputting Gower dissimilarity matrix?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Which-clustering-method-to-use-in-PROC-CLUSTER-after-inputting/m-p/347481#M5186</link>
      <description>&lt;P&gt;I'm planning on performing a cluster analysis in SAS EG 6.1 on a health care dataset&amp;nbsp;containing about 4,000 observations and ~100 nominal, interval, and ratio variables. The Gower similarity coefficient is a recommended distance measure&amp;nbsp;for mixed variables types, which can be calculated using the DISTANCE procedure. The Gower dissimilarity matrix generated from PROC DISTANCE, gower_distance, will then be used as the input dataset for PROC CLUSTER.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc distance data=health_data method=dgower out=gower_distance;
	var nominal(...) interval(...) ratio(...);
	id member_id;
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Question: Which clustering method is recommended in PROC CLUSTER for a Gower dissimilarity matrix?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Clustering methods that use an Euclidean distance measure, such as Centroid and Ward's Minimum Variance, can be ruled out, but that leaves a number of options.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2017 17:52:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Which-clustering-method-to-use-in-PROC-CLUSTER-after-inputting/m-p/347481#M5186</guid>
      <dc:creator>RobertF</dc:creator>
      <dc:date>2017-04-05T17:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: Which clustering method to use in PROC CLUSTER after inputting Gower dissimilarity matrix?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Which-clustering-method-to-use-in-PROC-CLUSTER-after-inputting/m-p/348256#M5193</link>
      <description>&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let's first look at what is a&amp;nbsp;Gower similarity:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) for interval parts:&amp;nbsp;S_{ijk} = 1 − |x_{ik} − x_{jk}| / r_{k}, where i,j are the indices of the two observations, k is the index of the variable, r_{k} is the range of the k^{th} variable. In other words, the Gower similarity is 'one minus the normalized Manhattan distance'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) for nominal parts: &lt;SPAN&gt;S_{ijk} = 1&lt;/SPAN&gt;&amp;nbsp;if x_{ik} = x_{jk}, or 0 if &lt;SPAN&gt;x_{ik} != x_{jk}&lt;/SPAN&gt;.&amp;nbsp;&lt;SPAN&gt;In other words, the Gower similarity is 'one minus the binary&amp;nbsp;distance'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Since for the proc distance, a Gower dissimilarity is calculated, so there is no 'one minus' in the above equations. So the Gower dissimilarity can be regarded as a type of distance (for mixed type input with both interval and nominal variables).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;And since the input is a distance matrix, not a data table with each row is an observation, we can use the 'proc cluster' for the clustering as shown in the below example, which produces a tree to show the clustering structure in the data.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;title 'Protein Consumption in Europe';
   proc distance data=Protein out=Dist method=Euclid;
      var interval(RedMeat--FruitVeg / std=Std);
      id Country;
   run;&lt;/PRE&gt;&lt;PRE&gt;proc cluster data=Dist method=Ward outtree=Tree noprint;
   id Country;
run;
   
axis1 order=(0 to 1 by 0.1);&lt;BR /&gt;proc tree data=Tree haxis=axis1 horizontal;
   height _rsq_;
   id Country;
run;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Besides, I would recommend you to use the 'proc kclus' as the clustering method. 'proc kclus' provides the k-prototypes clustering algorithm for mixed type input. And for the interval part, there are options of distance as Euclidean and Manhattan; for nominal part, there are Binary, GlobalFreq, and RelativeFreq. This indeed covers the Gower similarity as a special case. For the details of using 'proc kclus', please see the SAS Proc document for it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Yingjian&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 18:28:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Which-clustering-method-to-use-in-PROC-CLUSTER-after-inputting/m-p/348256#M5193</guid>
      <dc:creator>YingjianWang</dc:creator>
      <dc:date>2017-04-07T18:28:39Z</dc:date>
    </item>
    <item>
      <title>Re: Which clustering method to use in PROC CLUSTER after inputting Gower dissimilarity matrix?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Which-clustering-method-to-use-in-PROC-CLUSTER-after-inputting/m-p/348273#M5194</link>
      <description>&lt;P&gt;Yingjian,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for responding. PROC KCLUS looks interesting - looks like I can access PROC KCLUS by downloading the free 14 day trial for SAS Viya.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my question, I picked the Gower dissimilarity distance for the method in PROC DISTANCE (METHOD=DGOWER), however after checking the SAS documentation there is also the option to choose the Gower similarity distance&amp;nbsp;(METHOD=GOWER) if this is the more correct methodology.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm hoping I can then use PROC CLUSTER in the base SAS STAT module. Maybe average linkage would be appropriate?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 19:20:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Which-clustering-method-to-use-in-PROC-CLUSTER-after-inputting/m-p/348273#M5194</guid>
      <dc:creator>RobertF</dc:creator>
      <dc:date>2017-04-07T19:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: Which clustering method to use in PROC CLUSTER after inputting Gower dissimilarity matrix?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Which-clustering-method-to-use-in-PROC-CLUSTER-after-inputting/m-p/348278#M5195</link>
      <description>&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since we need a distance measure to feed into the 'proc cluster', 'proc distance (method=dgower)' produces a dissimilarity which is in the same meaning of a distance measure. So this is what we need here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, there are 11 different methods in finding the hierarchical clustering structure in the data provided by the 'proc cluster'. These methods have different focus on how to find the distance between clusters. 'average linkage' take the distances of each pair of data in 2 clusters as the distance between them. It is a commonly-chosen method and it may also fit your case. The&amp;nbsp;detailed descriptions about these 11 methods, the definitions, focuses, and references, can be found in&amp;nbsp;the&amp;nbsp;SAS document as below. You may want to read it and compare the advantages and disadvantages and choose the best one for your case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_cluster_sect012.htm" target="_blank"&gt;https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_cluster_sect012.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yingjian&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 19:46:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Which-clustering-method-to-use-in-PROC-CLUSTER-after-inputting/m-p/348278#M5195</guid>
      <dc:creator>YingjianWang</dc:creator>
      <dc:date>2017-04-07T19:46:48Z</dc:date>
    </item>
  </channel>
</rss>

