Posted By

webonomic on 03/31/08


Tagged

format proc


Versions (?)

Traffic Light Analysis


 / Published in: SAS
 

URL: http://jaredprins.squarespace.com/blog/2008/3/31/more-colours-with-proc-print-and-traffic-light-analysis.html

Colour code table cells to help visually reveal results.

  1. data tempdata;
  2. length Q1 $15;
  3. input Site Q1 $ evaltot_Sum Red Amber Green;
  4. cards;
  5. 3 Cleanliness 2 4 2 4
  6. 3 Friendliness 3 4 4 3
  7. 3 Responsiveness 3 4 4 3
  8. 3 Condition 3 4 4 3
  9. 3 Safety 3 4 4 3
  10. 4 Cleanliness 1 1 4 4
  11. 4 Friendliness 3 4 4 3
  12. 4 Responsiveness 3 4 4 3
  13. 4 Condition 3 4 4 3
  14. 4 Safety 3 4 4 3
  15. 9 Cleanliness 2 4 2 4
  16. 9 Friendliness 3 4 4 3
  17. 9 Responsiveness 3 4 4 3
  18. 9 Condition 3 4 4 3
  19. 9 Safety 1 1 4 4
  20. ;
  21. run;
  22.  
  23. Proc Format ;
  24. Value BGColor
  25. 1 = CXFF0000
  26. 2 = CXFFFF00
  27. 3 = CX00FF00
  28. 4 = CXD3D3D3
  29. 5 = CXA69F7A ;
  30. Run ;
  31.  
  32.  
  33. ods html;
  34. proc print data = tempdata noobs label;
  35. var Q1;
  36. var Red / style={background=bgcolor.};
  37. var Amber / style={background=bgcolor.};
  38. var Green / style={background=bgcolor.};
  39. by Site;
  40. label Red=’R’ Amber=’A’ Green=’G’ Q1=’Services and Facilities’;
  41. run;
  42. ods html close;

Report this snippet  

You need to login to post a comment.