/****************************************************************/ /* S A S S A M P L E L I B R A R Y */ /* */ /* NAME: hpred04.sas */ /* TITLE: Example 5 for PROC HPREDUCE */ /* Unsupervised variable selection */ /* Output an ODS Table */ /* PRODUCT: HPA */ /* SYSTEM: ALL */ /* KEYS: Variable Selection, */ /* Unsupervised */ /* Output an ODS Table */ /* PROCS: HPREDUCE */ /* DATA: */ /* */ /* SUPPORT: Z. Alan Zhao */ /* REF: SAS/HPA User's Guide, PROC HPREDUCE chapter */ /* MISC: */ /* */ /****************************************************************/ data one; array x{10}; array c{10}; do i=1 to 2000; do j=1 to 10; x{j}=ranuni(1); c{j}=int(ranuni(1)*4); end; if c{1} eq 0 Then b1 = 'aa'; if c{1} eq 1 Then b1 = 'bb'; if c{1} eq 2 then b1 = 'cc'; if c{1} eq 3 then b1 = 'dd'; if c{1} eq 4 then b1 = 'ee'; if c{2} eq 0 Then b2 = 'ff'; if c{2} eq 1 Then b2 = 'gg'; if c{2} eq 2 then b2 = 'hh'; if c{2} eq 3 then b2 = 'ii'; if c{2} eq 4 then b2 = 'jj'; if c{3} eq 0 Then b3 = 'kk'; if c{3} eq 1 Then b3 = 'll'; if c{3} eq 2 then b3 = 'mm'; if c{3} eq 3 then b3 = 'nn'; if c{3} eq 4 then b3 = 'oo'; output; end; run; proc hpreduce data=one; ods output SelectionSummary=Summary; class b1-b3 c1-c3; reduce unsupervised b1 b1*b2 b3 c1-c3 x1-x10 /maxsteps =5; performance details; run;