Step 1: Go to https://open.alberta.ca/opendata/deaths-cause-by-gender-and-age
Step 2: Download a file named deaths-by-gender-and-age00.csv by clicking the bottom download button or the included link.
Step 3: Open in a spreadsheet program like Excel. I opened it using OpenOffice, which is open source, so it’s free.
The first thing I saw that every thing was laid out neatly and it was easy to spot the system.
Columns run from A to Z. Perfect. Very Organized.
year, cause, gender, 19 age categories spanning 5 years each with the exception of the 90+ category, which covers everyone who makes it there.
Then there’s people who they didn’t know how old they were when they died,
whether they died at home or not
and a totals column.
![Top of AHS deaths data spreadsheet](https://dfuc.ca.ca/wp-content/uploads/2022/09/top-of-table-1024x668.jpg)
Step 4: Looking to the rows, every year for every cause they’ve recorded 3 values for each cause of death.
- Male total
- female total
- Grandtotal
with each value recorded under the appropriate age column.
Step 5: But all is not as it seems. Note that the government had appended a category number to each cause name and separated it from the cause name with a space. Given that .csv in the filename stands for comma separated values, this means the creator of the file did not want the the ID# and the description of each cause to be separate.
Step 6: Find out why. This is why we downloaded the .csv version of the data so we can import it in a better database program for analysis. I imported the file into a mySql database that looks like this:
![Plan for the design of a mySQL database](https://dfuc.ca.ca/wp-content/uploads/2022/09/planning-Sheet-786x1024.jpg)
Step 7: Once it’s been imported into mySQL, you can start querying the data. First finding: There are 2290 “unique” category names. This can be reduced by just eliminating extra spaces, leaving us with 1903 unique causes of death.
Step 8: This is where you’ll realize that the cause ID#’s do not remain the same throughout the data.
![Screenshot showing AHS constantly changes the cause ID#s for various causes of death](https://dfuc.ca.ca/wp-content/uploads/2022/09/random-cause-category-changes-1.jpg)
Step 8: Separate the cause ID# from its name. This still leaves us with well over 1000 unique causes of death. Now we can start fixing some of the carelessness of those responsible for creating this document.
![Examples of AHS employee carelessness](https://dfuc.ca.ca/wp-content/uploads/2022/09/careless-workers.jpg)
This reduces the total # of causes of death to 439.
![439 Unique causes of death revealed by fixing AHS staff errors](https://dfuc.ca.ca/wp-content/uploads/2022/09/reduced-to-439-1024x500.jpg)
Step 9: Deal with naming inconsistencies across years. I started by finding out how many categories there were per year.
![Database query showing AHS had 356 causes of death in 2001](https://dfuc.ca.ca/wp-content/uploads/2022/09/2001-356.jpg)
![Database query showing AHS had 358 causes of death in 2004](https://dfuc.ca.ca/wp-content/uploads/2022/09/2002-356.jpg)
![Database query showing AHS had 358 causes of death in 2006](https://dfuc.ca.ca/wp-content/uploads/2022/09/2003-357.jpg)
![Database query showing AHS had 358 causes of death in 2004](https://dfuc.ca.ca/wp-content/uploads/2022/09/2004-358.jpg)
![Database query showing AHS had 358 causes of death in 2006](https://dfuc.ca.ca/wp-content/uploads/2022/09/2006-358.jpg)
![Database query showing AHS had 346 causes of death in 2007](https://dfuc.ca.ca/wp-content/uploads/2022/09/2007-246.jpg)
Step 10: Discover only two different names being used for unknown( I think – which we’ll get to in step 11)
Before:
After: (Shows columns updated appropriately)
![Final Version of blended category](https://dfuc.ca.ca/wp-content/uploads/2022/09/2001Final-1024x71.jpg)
Step 11: Establish a public forum where any medically astute truth-seekers can take a look at somehow standardizing….click here