1
votes

I have the following table

ID POINTS1 POINTS2 time Table1 Table2
12  10  9    2011   A  B
13  12  8    2010   A  B
22  9   11   2011   A  C
24  8   8    2012   A  C

I would need to visually compare these results focusing on the change of points of IDs between the two tables. I am thinking about a correlation matrix or transition matrix where I have on x points1 and on y points2, possibly differently coloured based on the following conditions

A -> B
A -> C

I know that transition matrices can be created by frequency tables in SAS.

Proc freq data=my_table;
Tables points1*points2;
Run;

But I am wondering how to include information on the transition between table1 and table2, using colours in a two-way table with proc freq. I know that it could be possible using proc tabulate.

1

1 Answers

1
votes

I have found a way using proc format and tabulate, instead of proc freq.

proc format;
value cell_col low-50=“green”
50-high=“red”;
run;

proc tabulate data=my_table s=[foreground=cell_col.];
class points1 points2 table2;
table points1 points2 table2;
run;