<?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: Can Cluster analysis deal only with one variable? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Can-Cluster-analysis-deal-only-with-one-variable/m-p/87544#M4280</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, you can do clustering on a single variable. Suppose you know that there are two groups in your data and want to separate them automatically, you could use clustering to do that. Run the following example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Generate example data with 2 clusters in variable x */&lt;/P&gt;&lt;P&gt;data test;&lt;BR /&gt;do x = 1,2,3,4,5,12,13,14;&lt;BR /&gt;id = put(x,2.);&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;/* Form all clusters */&lt;/P&gt;&lt;P&gt;proc cluster data=test outtree=tree method=centroid noprint;&lt;BR /&gt;var x;&lt;BR /&gt;id id;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;/* Isolate top 2 clusters */&lt;/P&gt;&lt;P&gt;proc tree data=tree out=clusters nclusters=2 noprint;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;/* Get quantiles */&lt;/P&gt;&lt;P&gt;proc rank data=test fraction out=quantiles;&lt;BR /&gt;var x;&lt;BR /&gt;ranks quantile;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;/* Assemble clusters and quantiles */&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;select Q.id, Q.x, Q.quantile label="Quantile", C.cluster&lt;BR /&gt;from clusters as C inner join quantiles as Q on C._NAME_=Q.id&lt;BR /&gt;order by cluster, x;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Observations are assigned to the proper cluster. The quantiles are just like rescaled ranks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Apr 2012 15:05:10 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2012-04-18T15:05:10Z</dc:date>
    <item>
      <title>Can Cluster analysis deal only with one variable?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Can-Cluster-analysis-deal-only-with-one-variable/m-p/87543#M4279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I have a data set with two variables,one is the ID,the other is the amount.Can proc cluster or porc fastclus deal only with the amount?&lt;/P&gt;&lt;P&gt;And what is the difference between quantile and cluster?&lt;/P&gt;&lt;P&gt;Maybe I am too careful,but I have to make it clear.&lt;/P&gt;&lt;P&gt;Thanks in advance! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2012 12:00:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Can-Cluster-analysis-deal-only-with-one-variable/m-p/87543#M4279</guid>
      <dc:creator>summy</dc:creator>
      <dc:date>2012-04-18T12:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: Can Cluster analysis deal only with one variable?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Can-Cluster-analysis-deal-only-with-one-variable/m-p/87544#M4280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, you can do clustering on a single variable. Suppose you know that there are two groups in your data and want to separate them automatically, you could use clustering to do that. Run the following example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Generate example data with 2 clusters in variable x */&lt;/P&gt;&lt;P&gt;data test;&lt;BR /&gt;do x = 1,2,3,4,5,12,13,14;&lt;BR /&gt;id = put(x,2.);&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;/* Form all clusters */&lt;/P&gt;&lt;P&gt;proc cluster data=test outtree=tree method=centroid noprint;&lt;BR /&gt;var x;&lt;BR /&gt;id id;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;/* Isolate top 2 clusters */&lt;/P&gt;&lt;P&gt;proc tree data=tree out=clusters nclusters=2 noprint;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;/* Get quantiles */&lt;/P&gt;&lt;P&gt;proc rank data=test fraction out=quantiles;&lt;BR /&gt;var x;&lt;BR /&gt;ranks quantile;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;/* Assemble clusters and quantiles */&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;select Q.id, Q.x, Q.quantile label="Quantile", C.cluster&lt;BR /&gt;from clusters as C inner join quantiles as Q on C._NAME_=Q.id&lt;BR /&gt;order by cluster, x;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Observations are assigned to the proper cluster. The quantiles are just like rescaled ranks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2012 15:05:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Can-Cluster-analysis-deal-only-with-one-variable/m-p/87544#M4280</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-04-18T15:05:10Z</dc:date>
    </item>
  </channel>
</rss>

