Documentation Example 4 for PROC MODECLUS

/****************************************************************/
/*          S A S   S A M P L E   L I B R A R Y                 */
/*                                                              */
/*    NAME: modecex4                                            */
/*   TITLE: Documentation Example 4 for PROC MODECLUS           */
/* PRODUCT: STAT                                                */
/*  SYSTEM: ALL                                                 */
/*    KEYS: Cluster Analysis                                    */
/*   PROCS: MODECLUS, SGPLOT                                    */
/*    DATA:                                                     */
/*                                                              */
/* SUPPORT: saswfk                UPDATE: July 25, 2010         */
/*     REF: PROC MODECLUS, Example 4                            */
/*    MISC:                                                     */
/*                                                              */
/****************************************************************/

title 'Hertzsprung-Russell Plot of Visible Stars';
title2 'Computer-Generated Simulated Data';

data hr;
   input x y @@;
   label x='-Temperature'
         y='-Luminosity';
   datalines;
1.0   12.8   0.9  13.7   0.9  12.9   1.0  12.3   1.0  12.2   2.6  10.9
2.4   10.9   2.5  11.2   2.3  11.5   2.6  12.0   2.4  12.1   2.3  10.9
2.6   11.5   2.5  11.9   2.4  11.0   3.4  11.1   3.3  11.2   3.4  11.1
3.4    9.9   3.2  10.4   3.5  10.8   3.4  11.0   3.3  11.2   3.3  10.8
3.5   10.0   3.5  10.2   3.4  10.2   3.6  10.6   3.7  10.4   3.7  10.1
3.4   10.7   3.4  10.8   3.3  11.0   3.6  10.8   3.5  10.1   4.5  10.3
4.6    9.4   4.3  10.3   4.6   9.4   4.4   9.9   4.5  10.4   4.4   9.9
4.6    9.4   4.4  10.7   4.4   9.3   4.4   9.5   4.1  10.6   4.4  10.6
4.5   10.3   4.4  10.0   4.2   9.8   4.5   9.5   4.2  13.4   4.6  10.4
4.5    9.8   5.8   8.8   5.6   8.4   5.6  13.9   5.7   9.5   5.6  14.5
5.6    9.2   5.7   8.7   5.7   9.4   5.7   9.3   5.6   9.4   5.8   9.8
5.5    8.8   5.8   8.9   5.7   9.4   5.6  12.1   5.4  10.1   5.8   9.3
5.9    9.0   5.7  10.0   5.6   9.3   6.6   8.6   6.7   8.5   6.7  12.5
6.8    8.8   6.8   8.5   6.8   7.9   6.7   9.0   6.8   8.6   6.7   9.5
6.9    7.9   6.7   8.8   6.7   8.4   6.7   8.3   6.7  10.4   6.6   8.8
6.9    8.6   6.7  10.5   6.8   8.9   6.7   9.8   6.7   8.4   7.8   9.2
7.8    7.4   7.3   8.5   7.4   8.8   7.9   8.5   7.7   8.0   7.6   7.5
7.7    8.5   7.6   7.8   7.5   8.3   7.8   8.0   7.9   7.9   7.7   8.3
7.6    8.1   7.7   8.3   7.7   8.2   7.8   8.4   7.5  15.5   7.6   7.7
7.4   15.8   8.6   8.5   8.4   7.4   8.5   7.6   8.7   8.4   8.9   7.9
8.7    7.5   8.4   7.3   8.8   8.1   8.6   7.2   8.6   8.2   8.7  12.8
8.8    7.8   8.7   7.5   8.8   8.0   8.8  14.7   8.5   7.4   8.9   7.9
8.5    8.7   8.8   7.5   8.8   7.8   9.8   7.5  10.0   8.1  10.0   7.1
10.0   8.0   9.8   9.9   9.7   8.8  10.0   7.1  10.0   7.1   9.8   7.6
10.1   7.5  10.2   7.1  10.1   8.5  10.1   7.0   9.9   7.8  10.0   7.3
9.9    7.6  10.0   7.8   9.9   7.5   9.9  14.7   9.9   8.5  11.0   7.9
11.0   9.1  11.2   7.5  11.1   7.1  11.1   6.7  11.2   7.5  11.2   7.5
11.0   7.1  11.2   7.3  11.1   7.3  11.0   6.7  11.1   7.1  11.1   7.4
11.3  10.9  11.1   8.7  11.0   7.1  11.2   7.0  11.1   7.2  11.1   7.3
11.0   6.9  12.2   6.2  12.4  12.1  12.1   6.8  12.4   6.6  12.2   7.1
12.2   7.9  12.2   6.4  12.2   6.7  12.3   7.5  12.3   7.1  12.1   6.9
12.3   6.9  12.0   7.4  12.4   7.6  12.3   7.0  12.3   6.6  12.4   5.9
12.4   6.8  12.3   7.4  12.2   6.9  12.9  15.2  12.9   8.2  12.9   6.4
12.9  13.1  12.9   7.3  12.8   6.8  12.8   6.1  13.0   6.2  13.1   7.1
13.1   7.3  12.8   7.2  12.9  13.2  12.8   6.6  12.7   6.9  13.2  10.8
12.9   7.1  12.9   6.9  12.9   6.4  13.0   6.3  12.9   7.0  13.6   6.5
14.1   6.5  13.9   6.3  13.9   5.6  14.1   6.5  14.0   5.8  13.9   6.9
14.0   6.8  14.1   6.2  13.9   7.6  14.0   6.4  14.0   6.5  13.9   6.5
14.1   6.6  14.0   6.4  13.9   7.2  14.2   6.7  13.8   6.7  14.1   6.2
13.9   6.3  14.8   6.4  14.8   6.6  14.9   6.4  14.7   7.4  14.8   6.6
14.6   6.2  14.9   5.8  14.8   7.2  14.6   5.9  14.8   5.4  14.7   6.9
14.9   6.5  14.9   5.5  14.7   6.4  14.7   7.2  14.8   6.1  14.4   6.3
14.8   6.5  14.7   6.1  14.8   6.4  15.9   6.0  16.0   6.1  15.9   6.4
15.9   5.5  15.9   6.8  16.0   5.9  15.8   6.5  16.1   7.2  16.1   6.4
16.0   5.8  15.8   5.8  16.1   6.7  16.1   5.2  16.1   5.6  16.0   5.4
15.7   5.6  15.9   6.7  16.0   5.9  15.9   5.9  16.0   6.1  16.6   5.6
17.0   6.6  16.7   6.3  16.9   5.9  16.9   6.4  16.8   6.1  16.8   6.0
16.8   5.6  16.9   5.5  16.5   6.4  17.0   6.3  17.0   5.5  16.7   5.9
16.8   6.6  17.0   6.2  16.8   5.9  16.9   6.4  16.8   6.4  16.8   5.2
16.9   5.4  18.1   5.4  17.9   5.3  18.2   5.8  17.7   4.9  18.0   5.5
17.9   5.7  17.8   4.2  18.1   5.7  18.1   5.8  18.0   5.4  17.9   5.3
18.1   4.0  17.8   5.3  18.0   4.5  17.9   4.9  18.0   5.1  18.0   4.6
17.9   5.8  17.9   4.5  17.9   5.5  18.9   4.6  19.2   4.8  18.6   5.1
18.8   5.3  19.2   5.4  19.2   5.0  19.0   5.9  19.1   5.0  18.9   5.2
19.1   5.2  19.2   4.5  19.0  10.2  19.0   6.4  19.3   4.7  19.0   5.0
19.1   4.8  19.2   4.3  19.1   4.7  19.0  15.5  19.1   5.1  19.7   4.4
19.8   3.8  19.7   5.1  20.0   4.2  20.1   4.3  19.8   3.9  19.8   4.1
19.7   4.7  20.0   5.0  20.0   5.3  20.1   4.8  20.0   4.3  20.0   5.0
19.7   3.8  20.0   3.6  19.9   4.7  19.9   3.6  19.7   5.1  20.0   4.9
19.9   5.4  20.9   5.0  20.9   4.0  21.1   4.9  21.1   3.6  20.9   3.7
21.0   4.7  20.8   3.6  21.0  13.9  20.9   3.0  21.1   4.3  20.8   3.4
21.0   4.4  20.9   4.0  21.0   4.2  20.8   3.5  21.0   4.4  21.2   4.0
20.8   4.1  21.1   3.9  20.9   3.8  22.0   2.5  21.9   2.2  22.1   3.2
22.2   3.7  22.0   3.8  22.0   3.4  22.0   3.2  21.8   3.4  21.8   3.2
21.9   3.8  23.5   2.1  23.3   3.5  23.1   2.4  23.2   3.3  23.0   3.1
23.3   2.7  23.2   2.7  23.2   2.9  23.3   2.6  23.2   1.9  24.3   1.1
24.2   1.6  24.3   1.9  24.4   1.2  24.5   0.6  24.3   1.1  24.3   0.8
24.3   1.8  24.3   1.3  24.4   1.9  25.4   0.1  25.7  -0.0  25.2   0.6
25.1  -0.0  25.3   1.7  25.2   0.7  25.3   0.3  25.3   1.3  25.1   0.6
25.4   1.2  25.3   1.2  25.0   1.0  25.4   1.1  24.9   0.3  25.2   0.7
25.4   0.2  25.2   1.3  25.2   0.2  25.4   0.4  25.2   1.1  27.0  -3.1
26.8  -3.3  26.7  -3.1  26.7  -3.4  26.8  -0.4  26.6  -3.3  26.8  -1.3
26.8  -1.7  26.8  -3.4  26.6  -2.2  26.7  -0.9  26.9  -3.8  26.7  -3.8
27.1  -2.5  26.8  -0.0  26.7  -2.4  26.8  -3.7  26.5  -4.3  26.9  -0.1
26.7  -4.0  20.8  12.5  18.4  11.5  20.8  12.3  23.0   6.8  18.9  11.9
18.9  11.2  20.8  11.9  21.8   7.2  18.0  11.0  19.0  11.8  17.9  11.7
24.3  16.8  18.6  12.1  19.8  11.6  19.5  12.1  22.4  15.7  21.1  12.1
23.4  13.0  19.9  10.9  19.9  11.9  19.9  10.5  19.9  12.8  19.9  13.3
19.9  13.3  19.9  11.9  19.9  13.0  19.9  11.4  19.9  12.4  21.1  14.2
20.9  12.1  23.9  13.4  19.9  11.2  19.9  10.0  19.9  12.9  19.9  11.4
19.9  10.1  19.9   9.7  19.9  11.9  19.9  11.4  19.9  12.8  19.9  10.0
23.6  17.3  20.0  14.1  20.0  12.1  20.0  11.1  20.0  13.0  20.0  11.9
20.0  13.4  20.0  12.9  20.0  11.0  20.0  12.8  20.0  13.3  18.8  11.2
19.4  11.5  19.1   6.1  23.8  12.5  24.1  13.0  24.0  13.1  20.6  11.4
20.6  11.9  22.0  12.5  20.5  12.2  23.8  13.8  21.5  12.0  20.9  12.1
20.7  12.3  19.4  11.3  20.7  11.6  22.1  12.6  20.6  12.3  19.1   7.0
18.7  11.8  19.1  11.4  19.8  10.5  19.8  10.9  19.8  10.4  19.8  12.2
19.8  11.4  19.8  12.7  19.8  11.5  19.8  12.0  19.8  13.2  19.8  12.2
23.5  14.4  20.4  12.2  21.4  12.3  24.0  13.1  20.5  14.1  18.7  12.0
23.8  13.1  20.8  12.1  20.2  11.3  20.2  10.5  20.2  11.3  20.2  10.3
20.2  11.9  20.2  10.3  20.2  11.5  20.2  12.9  20.2  10.4  20.2  12.9
22.8  12.7  22.8  12.5  21.8  12.7  19.7  11.8  20.7  12.0  22.3  12.5
21.2  12.2  21.2  15.3  23.1  12.6  21.1  12.7  22.4  12.3  18.1  13.3
20.4  12.0  22.4  12.4  17.9  11.1  22.8  13.9  21.6  12.1  23.7  12.8
19.5  11.7  21.9  11.9  20.7  11.8  20.7  12.0  22.5  12.6  23.8  13.9
23.2  12.3  18.8  11.4  22.7  12.9  23.3  11.2  18.6  11.7  18.8  11.6
21.0  12.9  20.6  11.1  21.1  12.4  19.2  11.8  18.7  11.5  22.3  10.4
19.7  12.1  20.1  11.6  20.1  10.3  20.1  10.0  20.1  12.6  20.1  10.4
20.1  12.4  20.1  12.0  20.1  13.6  20.1  10.3  20.1  13.5  20.6  12.1
22.4  11.3  21.7  12.5  20.0  12.2  20.0  13.0  20.0  10.4  20.0  10.7
20.0  10.4  20.0  11.6  20.0   9.6  20.0  13.1  20.0   9.9  20.0  11.2
21.7  13.0  21.8  12.0  23.6  12.9  22.6  12.7  23.9  12.7  21.1  13.3
21.6  12.2  22.7  12.7  18.7  11.7  20.5  12.6  21.2  12.3  22.7  12.8
20.3  11.5  20.2  17.0  23.3  12.6  21.8  12.6  21.2  12.4  22.7  11.3
22.6  12.6  20.0  12.6  20.0  11.1  20.0  12.5  20.0  13.6  20.0  11.0
20.0  11.0  20.0  10.0  20.0  13.6  20.0  12.7  20.0  10.1  23.9  13.7
19.8  12.1  19.8  11.1  19.8  14.2  19.8  10.9  19.8  14.1  19.8  11.0
19.8  10.9  19.8  12.8  19.8  12.6  19.8  12.6  22.2  12.6  23.2  13.0
18.3  12.0  19.7  12.2  22.8  13.0  22.8  13.2  22.1  12.6  20.4   9.0
19.5  11.8  23.9  12.7  23.4  12.8  21.4  14.5  18.8  11.8  22.4  12.5
18.5  11.9  18.9  15.6  19.3  11.9  23.7  13.1  21.8  12.5  21.1  13.4
19.4  11.9  20.0  12.8  20.0  13.8  20.0  11.8  20.0  10.3  20.0  13.7
20.0  10.8  20.0  10.4  20.0  11.9  20.0  12.4  20.0  11.4  18.1  11.7
20.2  12.7  21.4  12.3  19.9  10.7  19.9  12.8  19.9  13.3  19.9  13.2
19.9  13.7  19.9  13.7  19.9  11.8  19.9  13.0  19.9  12.5  19.9  11.2
22.1  12.5  21.5   8.0  21.2  12.2  21.7  12.2  23.3  13.0  23.1  14.8
23.6  12.8  21.6  12.4  23.2  12.8  20.4  12.1  22.9  12.7  20.4  12.0
22.1  12.2  24.2  15.7  21.7  12.4  22.0  12.8  18.8  11.2  23.6  11.0
23.6  13.2  23.0  12.5  18.9  11.7  23.7  13.7  18.6  11.5  19.7  11.6
20.2  11.9  20.2  11.4  20.2  12.9  20.2  11.2  20.2  13.2  20.2  12.1
20.2  13.3  20.2  12.6  20.2  13.2  20.2   9.6  20.1  14.1  20.1  11.4
20.1  12.4  20.1  12.7  20.1  11.6  20.1  10.4  20.1  10.4  20.1  11.3
20.1  11.8  20.1  13.4  21.9  12.4  22.7  12.8  18.2  11.3  22.3  11.7
22.3  12.5  22.1  12.8  21.7  12.0  21.1  14.4  22.1  12.4  20.3  11.5
22.6  12.1  24.1  11.9  17.9  11.4  19.5  11.8  20.0  12.4  20.0  12.9
20.0  10.7  20.0  10.7  20.0  14.3  20.0  13.2  20.0  11.6  20.0  12.1
20.0  12.2  20.0  11.2  18.0  11.5  19.7  11.6  18.5  11.8  21.5  12.3
22.4  11.2  19.9  11.9  19.9  14.2  19.9  13.3  19.9  11.8  19.9  12.8
19.9  12.0  19.9  12.6  19.9  13.3  19.9  11.3  19.9  11.4  18.6  12.4
17.9  11.5  22.3  13.8  22.6  13.0  19.3  12.1  22.2  12.7  22.3  11.5
27.4  13.9  27.5  14.2  27.5  13.9  27.1  15.0  28.0  14.2  26.9  14.2
26.1  13.4  27.4  17.0  26.2  13.9  26.7  13.8  26.4  13.5  25.9  13.3
27.6  14.1  26.7  13.5  26.8  14.1  26.5  16.5  26.8  13.9  27.8  14.3
26.6  14.3  26.1  14.8  26.8  14.0  27.3  13.9  26.3  13.8  26.4  17.3
26.1  13.7  26.7  14.2  28.2  14.3  27.4  14.2  26.4  14.1  26.7  13.6
26.4  14.1  26.6  14.2  27.5  13.7  27.6  14.4  27.8  14.0  27.4  14.7
25.8  13.5  25.6  13.6  26.8  14.4  26.4  19.0  26.0  13.4  27.3  14.0
27.5  14.3  27.4  14.5  26.3  13.8  26.9  13.7  26.3  13.7  27.7  14.3
27.3  14.1  28.3  14.2  17.4  15.5  13.8  15.2  12.0  11.6  14.1  12.8
17.1  10.2  16.9  15.4  18.5  12.6  14.2  16.1  23.2   6.6  11.4  12.4
20.4  11.7  20.9   8.1  18.9  13.7  16.9   9.7  15.5   9.9  18.3  14.2
19.3  13.7  17.0  12.9  10.1  11.6  17.9  13.5  14.3   1.4  13.1  -0.8
8.1  -0.9  20.0   7.0  21.0   8.5  15.6  13.2
;

proc sgplot data=hr;
   scatter y=y x=x;
run;

proc modeclus data=hr m=1 r=1 1.5 2 2.5 ck=5
              join=.05 short out=out;
run;

title2 'MODECLUS Analysis';

proc sgplot data=out;
   scatter y=y x=x/group=cluster;
   by _R_;
run;