Date: Wed, 19 Aug 2009 15:16:32 -0400
Reply-To: msz03@albany.edu
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Mike Zdeb <msz03@ALBANY.EDU>
Subject: Re: presenting/ranking data over time
Content-Type: text/plain;charset=iso-8859-1
hi ... here's one "graphic" suggestion ... how about a map
and a table suggestion (below the map code) ... "traffic lighting"
I took some population data from the 2000 census
each state is either above or below the median on two variables: population, percent hispanic population (var1 and var2 respectively)
(sort of like your data ... four groups if you concatenate var1 and var2)
the 4 colors ...
dark colors (brown and blue) are above the median for %hispanic / light colors are below
both brown colors are above the median for population / blues are below
(it makes sense when you see it and it shows patterns)
data uspop;
length var3 $2;
input statename & : $30. state pop pct_hispanic var1 var2;
var3 = cat(var1,var2);
datalines;
Alabama 1 4447100 1.6331 1 0
Alaska 2 626932 4.1097 0 0
Arizona 4 5130632 25.2467 1 1
Arkansas 5 2673400 3.2010 0 0
California 6 33871648 32.3844 1 1
Colorado 8 4301261 17.0903 1 1
Connecticut 9 3405565 9.3655 0 1
Delaware 10 783600 4.7628 0 1
District of Columbia 11 572059 7.8689 0 1
Florida 12 15982378 16.7704 1 1
Georgia 13 8186453 5.2523 1 1
Hawaii 15 1211537 7.2290 0 1
Idaho 16 1293953 7.8514 0 1
Illinois 17 12419293 12.3126 1 1
Indiana 18 6080485 3.4625 1 0
Iowa 19 2926324 2.7851 0 0
Kansas 20 2688418 6.9297 0 1
Kentucky 21 4041769 1.3958 1 0
Louisiana 22 4468976 2.4134 1 0
Maine 23 1274923 0.7237 0 0
Maryland 24 5296486 4.2878 1 0
Massachusetts 25 6349097 6.7307 1 1
Michigan 26 9938444 3.2416 1 0
Minnesota 27 4919479 2.8821 1 0
Mississippi 28 2844658 1.3285 0 0
Missouri 29 5595211 2.0799 1 0
Montana 30 902195 2.0494 0 0
Nebraska 31 1711263 5.4855 0 1
Nevada 32 1998257 19.6941 0 1
New Hampshire 33 1235786 1.6111 0 0
New Jersey 34 8414350 13.2648 1 1
New Mexico 35 1819046 42.0885 0 1
New York 36 18976457 15.0977 1 1
North Carolina 37 8049313 4.6335 1 1
North Dakota 38 642200 1.1784 0 0
Ohio 39 11353140 1.8840 1 0
Oklahoma 40 3450654 5.1517 0 1
Oregon 41 3421399 8.0066 0 1
Pennsylvania 42 12281054 3.1929 1 0
Rhode Island 44 1048319 8.6283 0 1
South Carolina 45 4012012 2.3138 1 0
South Dakota 46 754844 1.3759 0 0
Tennessee 47 5689283 2.0991 1 0
Texas 48 20851820 31.9882 1 1
Utah 49 2233169 8.9561 0 1
Vermont 50 608827 0.8732 0 0
Virginia 51 7078515 4.6235 1 0
Washington 53 5894121 7.4624 1 1
West Virginia 54 1808344 0.6511 0 0
Wisconsin 55 5363675 3.5619 1 0
Wyoming 56 493782 6.3558 0 1
;
run;
proc format;
value $var3_
'00' = 'BELOW/BELOW'
'01' = 'BELOW/ABOVE'
'10' = 'ABOVE/BELOW'
'11' = 'ABOVE/ABOVE'
;
run;
goptions reset=all ftext='arial' htext=2 gunit=pct;
pattern1 v=ms c=cxA6611A;
pattern2 v=ms c=cxDFC27D;
pattern3 v=ms c=cx018571;
pattern4 v=ms c=cx80CDC1;
legend1 label=('POPULATION / %HISPANIC') shape=bar(2,3)pct;
title1 h=3 '2000 CENSUS DATA: POPULATION AND %HISPANIC POPULATION' ls=2;
title2 '(VALUES ABOVE OR BELOW US MEDIAN)';
title3 a=90 ls=2;
title4 a=-90 ls=2;
footnote1 ls=1;
proc gmap data=uspop map=maps.us;
id state;
choro var3 / discrete legend=legend1;
format var3 $var3_.;
run;
quit;
*
choose colors for 'traffic lighting'
background: ABOVE MEDIAN is RED, OTHER is GRAY
foreground: ABOVE MEDIAN is WHITE, OTHER is BLACK
;
proc format;
* background;
value popback low -< 4012012 = 'cxe7e3e7' 4012012 - high = 'cxff0000';
value pctback low -< 4.6335 = 'cxe7e3e7' 4.6335 - high = 'cxff0000';
* foreground;
value popfore low -< 4012012 = 'cx000000' 4012012 - high = 'cxffffff';
value pctfore low -< 4.6335 = 'cx000000' 4.6335 - high = 'cxffffff';
run;
ods listing close;
ods results off;
ods html file='z:\pops.html' style=barrettsblue;
title;
proc print data=uspop noobs label;
var statename;
var pop / style=[background=popback. foreground=popfore.];
var pct_hispanic / style=[background=pctback. foreground=pctfore.];
format pop comma12. pct_hispanic 5.2;
run;
ods html close;
ods listing;
ods results on;
--
Mike Zdeb
U@Albany School of Public Health
One University Place
Rensselaer, New York 12144-3456
P/518-402-6479 F/630-604-1475
> I have 48 months of data from facilities across the U.S. Within the facilities, there are different types of facilities. Incident data are
> aggregated by year, state, facility, and type
>
> Each facility sends in data monthly on "incidents" and number of days an incident was possible. To get an incident rate per facility/type, data are
> aggregated on a monthly basis.
>
> Facilities can send in data every month, or only a few months. It is possible for a facility to send in only a few months of data that may equate
> to another facility's 12 months of data. For example, two facilities could send in 50 incidents out of 500 possible days of risk, but there be
> differing numbers of months of data sent in.
>
> My question revolves presenting this data by state in a way that captures the amount of data the state is responsible for (maybe a state's
> facilities
> 1) send in data every month AND they send in a lot of data vs
> 2) a state that sends in little monthly data, but has a lot of incident data vs
> 3) a state that sends in little monthly data and low incident numbers vs
> 4) the state that sends in data every month, but the incident numbers are low.
>
> Anyone have suggestions about presentation, either table or graphically by state. Maybe a reference to a paper. Can I come up with a number/chart
> that characterizes not only a state's contribution of incident data, but also their participation in sending in data monthly?
>
> Thanks in advance
>