The MODECLUS Procedure

Example 79.3 Cluster Analysis with Significance Tests

(View the complete code for this example.)

This example uses artificial data containing two clusters. One cluster is from a circular bivariate normal distribution. The other is a ring-shaped cluster that completely surrounds the first cluster. Without significance tests, the ring is divided into several sample clusters for any degree of smoothing that yields reasonable density estimates. The JOIN= option puts the ring back together. Output 79.3.1 displays a short summary generated from the first PROC MODECLUS statement. Output 79.3.2 contains a series of tables produced from the second PROC MODECLUS statement. The lack of p-value in the JOIN= option makes joining continue until only one cluster remains (see the description of the JOIN= option). The cluster memberships are then plotted as displayed in Output 79.3.1 through Output 79.3.8.

The following statements produce Output 79.3.1 through Output 79.3.8:

title  'Modeclus Analysis with the JOIN= option';
title2 'A Normal Cluster Surrounded by a Ring Cluster';

data circle; keep x y;
   c=1;
   do n=1 to 30;
      x=rannor(5);
      y=rannor(5);
      output;
   end;

   c=2;
   do n=1 to 300;
      x=rannor(5);
      y=rannor(5);
      z=rannor(5)+8;
      l=z/sqrt(x**2+y**2);
      x=x*l;
      y=y*l;
      output;
   end;
run;
proc modeclus data=circle m=1 r=1 to 3.5 by .25 join=20 short;
run;
proc modeclus data=circle m=1 r=2.5 join out=out;
run;
proc sgplot data=out noautolegend;
   yaxis values=(-10 to 10 by 5);
   xaxis values=(-15 to 15 by 5);
   scatter y=y x=x / group=cluster Markerchar=cluster;
   by _NJOIN_;
run;

Output 79.3.1: Significance Tests with the JOIN=20 and SHORT Options

Modeclus Analysis with the JOIN= option
A Normal Cluster Surrounded by a Ring Cluster

The MODECLUS Procedure

Cluster Summary
RNumber of
Clusters
Joined
Maximum
P-value
Number of
Clusters
Frequency of
Unclassified
Objects
1360.93391301
1.25200.71311301
1.5100.32961300
1.7550.199020
250.068320
2.2530.050420
2.540.030120
2.7530.058520
350.000310
3.2540.192320
3.540.000010


Output 79.3.2: Significance Tests with the JOIN Option

Modeclus Analysis with the JOIN= option
A Normal Cluster Surrounded by a Ring Cluster

The MODECLUS Procedure
R=2.5 METHOD=1

Cluster Statistics-Saddle Test: Version 92.7-
ClusterFrequencyMaximum
Estimated
Density
Boundary
Frequency
Estimated
Saddle
Density
Mode
Count
Saddle
Count
Overlap
Count
ZApprox
P-value
11030.00617328220.00308664391902.4950.5055
2710.00571029200.0043213362791.1930.999
3530.00509296180.004012633225100.9860.9999
4450.00478429190.003549643022141.4290.9924
5300.004629960.290.3.6110.0301
6280.00370397170.00354964232290.0001


Cluster 6 with P-value 1.0000 will be joined to cluster 4.

Cluster Statistics-Saddle Test: Version 92.7-
ClusterFrequencyMaximum
Estimated
Density
Boundary
Frequency
Estimated
Saddle
Density
Mode
Count
Saddle
Count
Overlap
Count
ZApprox
P-value
11030.00617328220.00308664391902.4950.5055
2710.00571029200.0043213362791.1930.999
3530.00509296180.004012633225100.9860.9999
4730.00478429130.00293231301801.5880.9778
5300.004629960.290.3.6110.0301


Cluster 3 with P-value 0.9999 will be joined to cluster 1.

Cluster Statistics-Saddle Test: Version 92.7-
ClusterFrequencyMaximum
Estimated
Density
Boundary
Frequency
Estimated
Saddle
Density
Mode
Count
Saddle
Count
Overlap
Count
ZApprox
P-value
11560.00617328170.00246931391503.1300.1318
2710.00571029200.0043213362791.1930.999
3730.00478429130.00293231301801.5880.9778
4300.004629960.290.3.6110.0301


Cluster 2 with P-value 0.9990 will be joined to cluster 3.

Cluster Statistics-Saddle Test: Version 92.7-
ClusterFrequencyMaximum
Estimated
Density
Boundary
Frequency
Estimated
Saddle
Density
Mode
Count
Saddle
Count
Overlap
Count
ZApprox
P-value
11560.00617328170.00246931391503.1300.1318
21440.00571029140.00293231361802.3130.6447
3300.004629960.290.3.6110.0301


Cluster 2 with P-value 0.6447 will be joined to cluster 1.

Cluster Statistics-Saddle Test: Version 92.7-
ClusterFrequencyMaximum
Estimated
Density
Boundary
Frequency
Estimated
Saddle
Density
Mode
Count
Saddle
Count
Overlap
Count
ZApprox
P-value
13000.006173280.390.4.2460.0026
2300.004629960.290.3.6110.0301


Cluster 2 with P-value 0.0301 will be dissolved.

Cluster Statistics-Saddle Test: Version 92.7-
ClusterFrequencyMaximum
Estimated
Density
Boundary
Frequency
Estimated
Saddle
Density
Mode
Count
Saddle
Count
Overlap
Count
ZApprox
P-value
13000.006173280.390.4.2460.0026


30 observations were unassigned.


Cluster 1 with P-value 0.0026 will be dissolved.

Modeclus Analysis with the JOIN= option
A Normal Cluster Surrounded by a Ring Cluster

The MODECLUS Procedure

Cluster Summary
RNumber of
Clusters
Joined
Maximum
P-value
Number of
Clusters
Frequency of
Unclassified
Objects
2.501.000060
2.510.999950
2.520.999040
2.530.644730
2.540.030120
2.550.0026130


Output 79.3.3: Cluster Memberships When Number of Clusters Joined=0

Cluster Memberships When Number of Clusters Joined=0


Output 79.3.4: Cluster Memberships When Number of Clusters Joined=1

Cluster Memberships When Number of Clusters Joined=1


Output 79.3.5: Cluster Memberships When Number of Clusters Joined=2

Cluster Memberships When Number of Clusters Joined=2


Output 79.3.6: Cluster Memberships When Number of Clusters Joined=3

Cluster Memberships When Number of Clusters Joined=3


Output 79.3.7: Cluster Memberships When Number of Clusters Joined=4

Cluster Memberships When Number of Clusters Joined=4


Output 79.3.8: Cluster Memberships When Number of Clusters Joined=5

Cluster Memberships When Number of Clusters Joined=5