You find the JSON-file here:
drydo.com/crawler/files/json/data.json
Scroll to the bottom of the JSON-file to find the
data structure. Go back up in the file and look for
position to find the
column labels.
This is the code I've done so far. I began to write in Javascript, although I realize that it was a mistake, but atleast now it finally got to me why it's called "client-side language". But don't get hanged up on that, it's already full of syntax errors and missing pieces.
The code at least contains building blocks to use in another language like PHP or Python.
$.getJSON("Infectious Disease_Cases_by_County_Year_and_Sex_2001_2014.json", function(json) {
for(var i = 0; i < json.data.length; i++) {
var data = json.data;
var disease = data[i][8];
var county = data[i][9];
var year = data[i][10];
var gender = data[i][11];
var infectionCase = data[i][12];
var population = data[i][13];
if(disease == data[--i][8] || disease == "" && county == data[--i][9] || disease == "" && gender = "Total"){
foreach(){
var sumInfectionCases;
var sumPopulations;
var sumInfectionCases = sumInfectionCases + infectioncase;
var sumPopulations = sumPopulations + population;
}
}
else(){
var CountyAverage.byDisease.everyYear = {disease: data[--i][8], county: data[--i][9], average: sumInfectionCases / sumInfectionCases};
}
};
});
The things that needs to be done is.
1. Sum all "Infection cases" by "Disease" and "County" for "Every year, 2001-2014" divide by the Sum of total population for every year.
RESULTING in a new JSON array "County average(2001-2014)" for each disease.
2. Sum all "County average(2001-2014)" for each disease divide it by the number of "County average(2001-2014)"
RESULTING in a new JSON array "National average(2001-2014)" for each disease.
3. Then divide each "County average(2001-2014)" with the "National average(2001-2014)".
RESULTING in a new JSON array "Effect size" for every county.
4. Write the new arrays to the original JSON-file in the "meta:" section.