Skip to content

Instantly share code, notes, and snippets.

@pykerl

pykerl/README.md

Last active Aug 29, 2015
Embed
What would you like to do?
Georgia Mortality by County

Georgia Mortality by County

This map displays annual all cause mortality by county for the state of Georgia. Data on mortality is obtained from the CDC WONDER database.

Although mortality rates are lower in counties with cities (see Georgia Mortality Rates by County), total mortality is often larger due to population outweighing mortality rates.

id rate name deaths population mort
13001 0 Appling County, GA 208 18236 1140.6
13003 0 Atkinson County, GA 89 8375 1062.7
13005 0 Bacon County, GA 141 11096 1270.7
13007 0 Baker County, GA 22 3451 637.5
13009 0 Baldwin County, GA 384 45720 839.9
13011 0 Banks County, GA 158 18395 858.9
13013 0 Barrow County, GA 512 69367 738.1
13015 0 Bartow County, GA 794 100157 792.8
13017 0 Ben Hill County, GA 198 17634 1122.8
13019 0 Berrien County, GA 200 19286 1037
13021 0 Bibb County, GA 1742 155547 1119.9
13023 0 Bleckley County, GA 153 13063 1171.2
13025 0 Brantley County, GA 170 18411 923.4
13027 0 Brooks County, GA 156 16243 960.4
13029 0 Bryan County, GA 238 30233 787.2
13031 0 Bulloch County, GA 447 70217 636.6
13033 0 Burke County, GA 218 23316 935
13035 0 Butts County, GA 259 23655 1094.9
13037 0 Calhoun County, GA 57 6694 851.5
13039 0 Camden County, GA 312 50513 617.7
13043 0 Candler County, GA 132 10998 1200.2
13045 0 Carroll County, GA 965 110527 873.1
13047 0 Catoosa County, GA 475 63942 742.9
13049 0 Charlton County, GA 96 12171 788.8
13051 0 Chatham County, GA 2302 265128 868.3
13053 0 Chattahoochee County, GA 32 11267 284
13055 0 Chattooga County, GA 302 26015 1160.9
13057 0 Cherokee County, GA 1280 214346 597.2
13059 0 Clarke County, GA 628 116714 538.1
13061 0 Clay County, GA 51 3183 1602.3
13063 0 Clayton County, GA 1384 259424 533.5
13065 0 Clinch County, GA 79 6798 1162.1
13067 0 Cobb County, GA 3639 688078 528.9
13069 0 Coffee County, GA 340 42356 802.7
13071 0 Colquitt County, GA 415 45498 912.1
13073 0 Columbia County, GA 751 124053 605.4
13075 0 Cook County, GA 194 17212 1127.1
13077 0 Coweta County, GA 873 127317 685.7
13079 0 Crawford County, GA 82 12630 649.2
13081 0 Crisp County, GA 231 23439 985.5
13083 0 Dade County, GA 198 16633 1190.4
13085 0 Dawson County, GA 179 22330 801.6
13087 0 Decatur County, GA 308 27842 1106.2
13089 0 DeKalb County, GA 4118 691893 595.2
13091 0 Dodge County, GA 222 21796 1018.5
13093 0 Dooly County, GA 110 14918 737.4
13095 0 Dougherty County, GA 732 94565 774.1
13097 0 Douglas County, GA 816 132403 616.3
13099 0 Early County, GA 130 11008 1181
13101 0 Echols County, GA 27 4034 669.3
13103 0 Effingham County, GA 341 52250 652.6
13105 0 Elbert County, GA 229 20166 1135.6
13107 0 Emanuel County, GA 282 22598 1247.9
13109 0 Evans County, GA 98 11000 890.9
13111 0 Fannin County, GA 299 23682 1262.6
13113 0 Fayette County, GA 738 106567 692.5
13115 0 Floyd County, GA 976 96317 1013.3
13117 0 Forsyth County, GA 722 175511 411.4
13119 0 Franklin County, GA 269 22084 1218.1
13121 0 Fulton County, GA 6172 920581 670.4
13123 0 Gilmer County, GA 225 28292 795.3
13125 0 Glascock County, GA 34 3082 1103.2
13127 0 Glynn County, GA 797 79626 1000.9
13129 0 Gordon County, GA 487 55186 882.5
13131 0 Grady County, GA 196 25011 783.7
13133 0 Greene County, GA 183 15994 1144.2
13135 0 Gwinnett County, GA 3231 805321 401.2
13137 0 Habersham County, GA 408 43041 947.9
13139 0 Hall County, GA 1156 179684 643.4
13141 0 Hancock County, GA 69 9429 731.8
13143 0 Haralson County, GA 358 28780 1243.9
13145 0 Harris County, GA 237 32024 740.1
13147 0 Hart County, GA 270 25213 1070.9
13149 0 Heard County, GA 103 11834 870.4
13151 0 Henry County, GA 1171 203922 574.2
13153 0 Houston County, GA 957 139900 684.1
13155 0 Irwin County, GA 97 9538 1017
13157 0 Jackson County, GA 511 60485 844.8
13159 0 Jasper County, GA 114 13900 820.1
13161 0 Jeff Davis County, GA 126 15068 836.2
13163 0 Jefferson County, GA 192 16930 1134.1
13165 0 Jenkins County, GA 92 8340 1103.1
13167 0 Johnson County, GA 87 9980 871.7
13169 0 Jones County, GA 189 28669 659.2
13171 0 Lamar County, GA 190 18317 1037.3
13173 0 Lanier County, GA 89 10078 883.1
13175 0 Laurens County, GA 525 48434 1083.9
13177 0 Lee County, GA 144 28298 508.9
13179 0 Liberty County, GA 288 63453 453.9
13181 0 Lincoln County, GA 92 7996 1150.6
13183 0 Long County, GA 69 14464 477
13185 0 Lowndes County, GA 826 109233 756.2
13187 0 Lumpkin County, GA 216 29966 720.8
13189 0 McDuffie County, GA 296 21875 1353.1
13191 0 McIntosh County, GA 119 14333 830.3
13193 0 Macon County, GA 133 14740 902.3
13195 0 Madison County, GA 300 28120 1066.9
13197 0 Marion County, GA 77 8742 880.8
13199 0 Meriwether County, GA 259 21992 1177.7
13201 0 Miller County, GA 89 6125 1453.1
13205 0 Mitchell County, GA 217 23498 923.5
13207 0 Monroe County, GA 226 26424 855.3
13209 0 Montgomery County, GA 78 9123 855
13211 0 Morgan County, GA 191 17868 1069
13213 0 Murray County, GA 297 39628 749.5
13215 0 Muscogee County, GA 1797 189885 946.4
13217 0 Newton County, GA 737 99958 737.3
13219 0 Oconee County, GA 214 32808 652.3
13221 0 Oglethorpe County, GA 98 14899 657.8
13223 0 Paulding County, GA 642 142324 451.1
13225 0 Peach County, GA 275 27695 993
13227 0 Pickens County, GA 289 29431 982
13229 0 Pierce County, GA 206 18758 1098.2
13231 0 Pike County, GA 159 17869 889.8
13233 0 Polk County, GA 429 41475 1034.4
13235 0 Pulaski County, GA 114 12010 949.2
13237 0 Putnam County, GA 196 21218 923.7
13239 0 Quitman County, GA 20 2513 795.9
13241 0 Rabun County, GA 183 16276 1124.4
13243 0 Randolph County, GA 104 7719 1347.3
13245 0 Richmond County, GA 1942 200549 968.3
13247 0 Rockdale County, GA 566 85215 664.2
13249 0 Schley County, GA 30 5010 598.8
13251 0 Screven County, GA 165 14593 1130.7
13253 0 Seminole County, GA 114 8729 1306
13255 0 Spalding County, GA 669 64073 1044.1
13257 0 Stephens County, GA 326 26175 1245.5
13259 0 Stewart County, GA 71 6058 1172
13261 0 Sumter County, GA 343 32819 1045.1
13263 0 Talbot County, GA 73 6865 1063.4
13265 0 Taliaferro County, GA 32 1717 1863.7
13267 0 Tattnall County, GA 252 25520 987.5
13269 0 Taylor County, GA 108 8906 1212.7
13271 0 Telfair County, GA 149 16500 903
13273 0 Terrell County, GA 89 9315 955.4
13275 0 Thomas County, GA 529 44720 1182.9
13277 0 Tift County, GA 393 40118 979.6
13279 0 Toombs County, GA 272 27223 999.2
13281 0 Towns County, GA 164 10471 1566.2
13283 0 Treutlen County, GA 76 6885 1103.8
13285 0 Troup County, GA 643 67044 959.1
13287 0 Turner County, GA 105 8930 1175.8
13289 0 Twiggs County, GA 99 9023 1097.2
13291 0 Union County, GA 287 21356 1343.9
13293 0 Upson County, GA 345 27153 1270.6
13295 0 Walker County, GA 755 68756 1098.1
13297 0 Walton County, GA 796 83768 950.2
13299 0 Ware County, GA 426 36312 1173.2
13301 0 Warren County, GA 85 5834 1457
13303 0 Washington County, GA 221 21187 1043.1
13305 0 Wayne County, GA 295 30099 980.1
13307 0 Webster County, GA 17 2799 607.4
13309 0 Wheeler County, GA 41 7421 552.5
13311 0 White County, GA 269 27144 991
13313 0 Whitfield County, GA 793 102599 772.9
13315 0 Wilcox County, GA 133 9255 1437.1
13317 0 Wilkes County, GA 155 10593 1463.2
13319 0 Wilkinson County, GA 106 9563 1108.4
13321 0 Worth County, GA 180 21679 830.3
<!DOCTYPE html>
<meta charset="utf-8">
<style>
#box {
width: 100%;
text-align: center;
}
#key {
width: 100%;
text-align: center;
}
svg {
font: 11px sans-serif;
}
.caption {
font-weight: bold;
}
.key path {
display: none;
}
.key line {
stroke: #000;
shape-rendering: crispEdges;
}
.counties {
fill: none;
stroke: white;
stroke-width: 1px;
}
.states {
fill: none;
stroke: black;
stroke-width: 1.5px;
stroke-linejoin: round;
}
.q0-5 { fill:rgb(247,251,255); }
.q1-5 { fill:rgb(198,219,239); }
.q2-5 { fill:rgb(107,174,214); }
.q3-5 { fill:rgb(33,113,181); }
.q4-9 { fill:rgb(8,48,107); }
</style>
<body>
<div id="box"></div>
<div id="key"></div>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://d3js.org/queue.v1.min.js"></script>
<script src="http://d3js.org/topojson.v1.min.js"></script>
<script>
var max_val = 1400;
var min_val = 500;
var width = 400,
height = 420;
var rateById = d3.map();
var color = d3.scale.threshold()
//.domain([0, 43, 86, 173, 217])
.domain([0, 300, 600, 1200, 2400, 6400])
.range(["#EFF3FF","#C6DBEF","#9ECAE1","#6BAED6","#3182BD","#08519C"]);
//.range(["#FFF","#C6DBEF","#9ECAE1","#6BAED6","#3182BD","#08519C"]);
/*var quantize = d3.scale.quantize()
.domain([min_val, max_val])
.range(d3.range(5).map(function(i) {
return "q" + i + "-5";
}));
*/
var projection = d3.geo.conicConformal()
.rotate([85, 0])
.center([6, 32])
.parallels([29.5, 45.5])
.scale(4800)
.precision(.1);
var path = d3.geo.path()
.projection(projection);
var svg = d3.select("#box").append("svg")
.attr("width", width)
.attr("height", height);
queue()
.defer(d3.json, "us.json")
.defer(d3.tsv, "ga_mortality.tsv", function(d) { rateById.set(d.id, +d.deaths); })
.await(ready);
function ready(error, us) {
svg.append("g")
.attr("class", "counties")
.selectAll("path")
.data(topojson.feature(us, us.objects.counties).features)
.enter().append("path")
.style("fill", function(d) {
county_id = "" + d.id;
if(county_id.substring(0,2) == "13") {
return color(rateById.get(d.id))
}
return "#FFF";
})
//.attr("class", function(d) { return quantize(rateById.get(d.id)); })
.attr("d", path);
svg.append("path")
.datum(topojson.mesh(us, us.objects.states, function(a, b) { return a !== b; }))
.attr("class", "states")
.attr("d", path);
}
// A position encoding for the key only.
var x = d3.scale.linear()
.domain([0, 6500])
.range([0, 500]);
//.range([500, 2000]);
var svg2 = d3.select("#key").append("svg")
.attr("width", 600)
.attr("height", height);
var xAxis = d3.svg.axis()
.scale(x)
.orient("bottom")
.tickSize(13)
.tickValues(color.domain());
var g = svg2.append("g")
.attr("class", "key")
.attr("transform", "translate(40,18)");
g.selectAll("rect")
.data(color.range().map(function(d, i) {
return {
x0: i ? x(color.domain()[i - 1]) : x.range()[0],
x1: i < color.domain().length ? x(color.domain()[i]) : x.range()[1],
z: d
};
}))
.enter().append("rect")
.attr("height", 8)
.attr("x", function(d) { return d.x0; })
.attr("width", function(d) { return d.x1 - d.x0; })
.style("fill", function(d) { return d.z; });
g.call(xAxis).append("text")
.attr("class", "caption")
.attr("y", -6)
.text("All Cause Mortality, 2010");
</script>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment