The SIMILARITY Procedure

Example 24.5 Clustering Time Series

This example illustrates how to cluster time series using a similarity matrix. The WORK.APPLIANCE data set contains 24 variables that record sales histories. The following statements create a similarity matrix and store the matrix in the WORK.SIMMATRIX data set:

proc similarity data=sashelp.applianc out=_null_ outsum=simmatrix;
   target units_1--units_24 / measure=mabsdev normalize=absolute;
run;

The following statements cluster the rows of the similarity matrix.

proc cluster data=simmatrix(drop=_status_) outtree=tree method=ward noprint;
   id _input_;
run;

The following statements plot the dendrogram:

proc tree data=tree horizontal;
run;