Contents: | Purpose / History / Requirements / Usage / Limitations |
1.0 | Initial version. |
%inc "<location of your file containing the CLUSTERGROUPS macro>";
Following this statement, you can call the %CLUSTERGROUPS macro. Before running the %CLUSTERGROUPS macro, create the DATA= data set for input to the macro. The easiest way to generate the necessary input data set is to use the OUTTREE= data set from performing a cluster analysis in PROC CLUSTER. The example in the Results tab uses this technique.
The following macro parameter is required:
The following macro parameters are optional:
The version of the %CLUSTERGROUPS macro that you are using is displayed in the SAS log when you specify version (or any string) as the first argument. For example:
%CLUSTERGROUPS(version, ...other options...)
The %CLUSTERGROUPS macro attempts to check for a later version of itself. If it is unable to do this (such as if there is no active internet connection available), the macro will issue the following message:
CLUSTERGROUPS: Unable to check for newer version
The computations performed by the macro are not affected by the appearance of this message.
This macro cannot be used to analyze an input data set containing multiple BY groups. BY groups processing is not supported.
These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.
These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.
The macro is called twice, showing a 3-cluster solution and a 4-cluster solution with colored clusters.
ods html body='b.html' style=htmlblue; /* Run a cluster analysis and create an OUTTREE= output data set */ proc cluster data=sashelp.mileages(type=distance) method=average pseudo outtree=tree; id City; run; /* Define the CLUSTERGROUPS macro */ %inc "<location of your file containing the CLUSTERGROUPS macro>"; %clustergroups(nclusters=3) %clustergroups(nclusters=4, data=tree, id=City)
Right-click on the link below and select Save target as... to save
the %CLUSTERGROUPS definition to a file. It is recommended that you name the file
clustergroups.sas
.
Download and save clustergroups.sas
Type: | Sample |
Topic: | Analytics ==> Cluster Analysis SAS Reference ==> Procedures ==> CLUSTER SAS Reference ==> Procedures ==> TREE |
Date Modified: | 2013-06-10 16:50:32 |
Date Created: | 2013-06-03 11:01:37 |
Product Family | Product | Host | SAS Release | |
Starting | Ending | |||
SAS System | SAS/STAT | z/OS | 9.3 TS1M0 | |
Microsoft® Windows® for x64 | 9.3 TS1M0 | |||
Microsoft Windows Server 2003 Datacenter Edition | 9.3 TS1M0 | |||
Microsoft Windows Server 2003 Enterprise Edition | 9.3 TS1M0 | |||
Microsoft Windows Server 2003 Standard Edition | 9.3 TS1M0 | |||
Microsoft Windows Server 2003 for x64 | 9.3 TS1M0 | |||
Microsoft Windows Server 2008 | 9.3 TS1M0 | |||
Microsoft Windows Server 2008 for x64 | 9.3 TS1M0 | |||
Microsoft Windows XP Professional | 9.3 TS1M0 | |||
Windows 7 Enterprise 32 bit | 9.3 TS1M0 | |||
Windows 7 Enterprise x64 | 9.3 TS1M0 | |||
Windows 7 Home Premium 32 bit | 9.3 TS1M0 | |||
Windows 7 Home Premium x64 | 9.3 TS1M0 | |||
Windows 7 Professional 32 bit | 9.3 TS1M0 | |||
Windows 7 Professional x64 | 9.3 TS1M0 | |||
Windows 7 Ultimate 32 bit | 9.3 TS1M0 | |||
Windows 7 Ultimate x64 | 9.3 TS1M0 | |||
Windows Vista | 9.3 TS1M0 | |||
Windows Vista for x64 | 9.3 TS1M0 | |||
64-bit Enabled AIX | 9.3 TS1M0 | |||
64-bit Enabled HP-UX | 9.3 TS1M0 | |||
64-bit Enabled Solaris | 9.3 TS1M0 | |||
HP-UX IPF | 9.3 TS1M0 | |||
Linux | 9.3 TS1M0 | |||
Linux for x64 | 9.3 TS1M0 | |||
Solaris for x64 | 9.3 TS1M0 |