I'm always trying to find new uses for SAS - this time I've written a proof-of-concept that shows how you might use SAS to create charts that test for color blindness. If nothing else, I think it's a fun example :)
First, I did a Google search, and looked at several online tests for color blindness. Most of them show an array of dots of varying size and color, and there is a pattern 'hidden' in the dots that only someone who can properly distinguish all the colors being used can see. There are several different types of color blindness, and different color combinations are used to test for each.
To implement something similar in SAS, I decided to re-use one of my Wafer Map examples (specifically this one). To create this circular grid of boxes of varying sizes, I create a 50x50 grid of gmap rectangular-shaped areas (think of each rectangle as a state in the US map), and then throw out all the rectangles that were farther than a certain distance from the center of the page. I then programmatically assign a color/response variable based on the position of the rectangles, to form the desired pattern. If a rectangle is part of the pattern, I randomly assign it 1, 2, or 3 and otherwise it is randomly assigned a value of 4, 5, or 6. I then arrange the 6 desired colors in my pattern statements.
After a bit of tweaking and fine-tuning, I came up with my final code that created the following color blindness test charts:
How'd you do on the test? Were you able to see the shape in all four charts?
Of course, this is just a proof-of-concept I designed to show the flexibility of SAS/GRAPH (and specifically Proc Gmap) - please don't rely on my test to determine whether you're colorblind! Hopefully in the hands of a doctor or researcher who specializes in vision and color blindness, my code could be used to set up some much better tests!