Resources

Similarity Analysis

/*--------------------------------------------------------------

                    SAS Sample Library

        Name: smyex02.sas
 Description: Example program from SAS/ETS User's Guide,
              The SIMILARITY Procedure
       Title: Similarity Analysis
     Product: SAS/ETS Software
        Keys: similarity measures, time-stamped data
        PROC: SIMILARITY
       Notes:

--------------------------------------------------------------*/

ods graphics on;

data test;
input i y x;
datalines;
1   2  3
2   4  5
3   6  3
4   7  3
5   3  3
6   8  6
7   9  3
8   3  8
9  10  .
10 11  .
;
run;

proc similarity data=test out=_null_
   print=all plot=all;
   input x;
   target y / measure=absdev;
run;

proc similarity data=test out=_null_
   print=all plot=all;
   input x;
   target y / measure=absdev 
              compress=(localabs=2)
              expand=(localabs=2);
run;

proc similarity data=test out=series
   outsequence=sequences outpath=path outsum=summary;
   input x;
   target y / measure=absdev 
              compress=(localabs=2)
              expand=(localabs=2);
run;