opioid_deaths/*.json
- Opioid mortality raw value count by county for every year from 1999 to 2015unemploymentByCounty.json
- Includes unemployment data for every county from 1999 to 2016Part_D_Opioid_Prescribing_Change_Geographic_2013_2014_backup.csv
- Includes opioid prescription rates from 2013-2014 by county. Retreived from the cms.gov site.
- boilerplateDataLoad.py - Automatically loads the main data set and can be copied and edited to do complex data analysis.
Under the /analyis
subdirectory are python scripts to perform statistical
operations on the data above. Currently the system supports correlating opioid
deaths with unemployment data.
Want to gain the same insights and follow our process. Do the below.
- Enter the
analysis/
directory. - Run
python3 deathsAndUnemploymentRegression.py
. A graph should pop up and statistics should be printed to terminal. In the background two files containing the slope and r^2 values will have been written to the disk. - To visualize this data you can employ
dataVisualization.py
and the accompanyingcounties.svg
. To write the r^2 values runpython3 dataVisualization.py r_2_values.json > r2byCounty.svg
and load the SVG inside a web browser. - Using the above, you can write any data that is mapped to by the county code.
- To recreate our analysis of prescription rates, run
python3 prescriptionAndDeathsRegression.py
and you can analyze the output graphs and printed statistics. You can also view the slope and r^2 values in files generated in the same directory. - To recreate the analysis of the link between unemployment and prescription,
run
python3 unemploymentAndPrescriptionRegression.py
and you can then review the output graphic showing the raw unemployment and prescription data points in a point cloud and also analyze the county by county link via manipulation and viewing ofunemployment_prescription_values.json
(slope) or its companion r^2 file.
- In the main directory simply run
python unemploymentCrawler.py
and wait for the process to complete (will likely take several hours). It will write all the data tounemploymentByCounty.json
. - For the BLS website, you will have to manually retreive entry as automated scripting of confirming use of the site is against policy.