DATA Step, Macro, Functions and more

Correlation Graph matrix

Reply
Contributor
Posts: 20

Correlation Graph matrix

[ Edited ]

Hi All ,

 

I'm Tyring to create  the below Correlation Graph matrix however i'm finding difficult in implementing .Please suggest me a solution to fix it.

 

MASTER TEMPLATE

Master.PNG

           
   

 

 

We will generate the the following dataset result as below and fill it using the above template

data set 

 

0,8 
0,7 
0,6 
0,5 
0,411
0,325
0,275
0,1470
0,05115
1,8 
1,7 
1,6 
1,5 
1,42
1,32
1,26
1,135
1,0289

 

Final Result will be displayed 

 Final Results.PNG

 

I  used the following code however it doesn't run through 

 

proc template;
      edit Base.Corr.StackedMatrix;
         column (RowName RowLabel) (Matrix) * (Matrix2) * (Matrix3);
         edit matrix2;
            cellstyle
               _val_  = ._ as {backgroundcolor=CXEEEEEE},
               _val_  > 5,0 as {backgroundcolor=red},
                      _val_  <=2,0 as {backgroundcolor=green},
                      _val_ < 5,0 and > 2,0 as {backgroundcolor=yellow};
/*                      _val_ <= -0.25 as {backgroundcolor=cyan},*/
/*                      _val_ <=  0.25 as {backgroundcolor=white},*/
/*                      _val_ <=  0.50 as {backgroundcolor=cyan},*/
/*                      _val_ <=  0.75 as {backgroundcolor=blue},*/
/*                      _val_ <   1.00 as {backgroundcolor=red},*/
/*                      _val_  =  1.00 as {backgroundcolor=CXEEEEEE};*/
            end;
         end;
      run;
  
ods html body='corr.html' style=statistical;
ods listing close;

  PROC CORR DATA=excel_merge_char OUTP=pearson_corr;
  VAR cell	count_policy_char ;
  RUN;
  
proc template;
   delete Base.Corr.StackedMatrix;
   run;

Please refer the attached snapshots 

SAS Super FREQ
Posts: 3,475

Re: Correlation Graph matrix

You are obviously using the example in the SAS/STAT documentation (which would have been nice to mention!)  You do not provide the error message, but I suggest that you change the cutoff values from the European system of specifying decimals ('5,0' and '2,0' to the American notation ('5.0' and '2.0')

Ask a Question
Discussion stats
  • 1 reply
  • 101 views
  • 1 like
  • 2 in conversation