File size: 6,824 Bytes
4b87448
 
8ee345a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2a0a789
8ee345a
2a0a789
8ee345a
2a0a789
8ee345a
7920d25
8ee345a
 
 
 
 
4b87448
b1a5491
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8ee345a
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
---
license: mit
language:
- en
pretty_name: USA Opioid Overdose
size_categories:
- 10K<n<100K
dataset_info:
  features:
    - name: State
      dtype: string
    - name: State_Code
      dtype: string
    - name: County
      dtype: string
    - name: County_Code
      dtype: string
    - name: Year
      dtype: int64
    - name: Population
      dtype: int64
    - name: Deaths
      dtype: int64
    - name: Original
      dtype: bool
    - name: State_Mortality_Rate
      dtype: float
    - name: County_Mortality_Rate
      dtype: float

---

## Overview

This dataset contains the number of yearly deaths due to **Unintentional** Drug Overdoses in the United States at a County Level between 2003-2015. To overcome the limitation of the original dataset, it is merged with population dataset to identify missing combinations and imputation is performed on the dataset taking into account the logical rules of the source dataset. Users can decide the proportion of the imputed values in the dataset by using the provided population and flag columns. Additional fields like state codes, FIPS codes are provided for the convenience of the user so that the dataset can be merged easily with other datasets.

## Data Structure

The dataset contains the following fields:
1. State (string): Name of the State
2. State_Code (string): 2 Character abbreviation of the state
3. County (string): Name of the County
4. County_Code (string): 5 Charter representation of the County’s FIPS code
5. Year (integer): Year
6. Population (integer): Population of the County for the given year
6. Deaths (integer): number of Drug overdose deaths in the county for the given year
7. Original (Boolean): To indicate if the Deaths are from original dataset or imputed
8. State_Mortality_Rate (float): Mortality rate of the state for the given year
9. County_Mortality_Rate (float): Mortality rate of the county for the given year

Notes:
1. County FIPS has been formatted as a string so that leading zeros are not lost and it is easier for the user to read it
2. The County_Mortality_Rate which is provided for convenience is calculated after the imputation of the missing values, hence it might not be accurate for all the combinations, refer the "Original" column to identify the imputed values.

## Data Source

1. Deaths Data: The original source of the data is the US Vital Statistics Agency [Link](https://www.cdc.gov/nchs/products/vsus.htm), however, for this project, it has been downloaded from a different [source](https://www.dropbox.com/s/kad4dwebr88l3ud/US_VitalStatistics.zip?dl=0) for convenience.

2. Population Data: To have consistency with the Mortality Data, the population Data has been downloaded from the [CDC Wonder](https://wonder.cdc.gov/bridged-race-v2020.html) portal. Population data is used for 2 purposes: to calculate the mortality rate and as a master list of Counties to perform the Imputation

3. Other Data:  To provide convenience to the users of the Dataset, additional fields such as County Fips, State Codes etc. have been added so that users can easily combine it with other datasets if required. This mapping is a standard mapping which can be found on the internet.

The raw data files are present in the ``.01_Data/01_Raw`` folder for reference.

## Methodology

To study the impact of drug related deaths, one of the primary sources is the US Vital Statistics Agency. There is a limitation in the report since US Vital Statistics does not report the deaths in a county if the number of deaths in that county is less than 10 for privacy reasons. This means that the deaths available in the report are not fully representative of the deaths and hence any analysis performed on it may not be fully accurate. To overcome this, in this dataset, values are imputed for the missing counties based on State level mortality rates and population limiting factors. While this may not be 100% representative, it gives a slightly different and better approach to perform analysis on the drug related deaths.


Post the basic data cleaning and merging, the imputation is performed in the following steps:

1. Mortality Rate is calculated at the State-Year level using the available data
2. Master combination of State-County is obtained from Population file
3. For the missing counties a reverse calculation is performed using the state level mortality rate and the population of the county. A maximum calculated limit of 9 is imposed to preserve the conditions of the original data set.
4. Flag column is added to indicate if the values seen are original values or imputed ones

Since the original trend of the dataset may distort due to the imputations, the population data is left in the dataset and an additional column is added to the dataset to indicate if the values seen are from the original dataset or if they were imputed. Using the population and the flag column, the users of the dataset can decide the proportion of the imputed data in the analysis (This is the population limit factor).

The below graph shows the relation between the population limit factor and the % of imputed values in the dataset:
![Plot](.01_Data/Missing_vs_Population.png)


## Files and Folder Structure

1. Data Files: The raw data files are present in the [.01_Data/01_Raw](./.01_Data/01_Raw) folder for reference. The intermediate Population and Mortality files are present in the [.01_Data/02_Processed](./.01_Data/02_Processed) folder. The final dataset is present in the root folder.

The Data folder is hidden so that the raw and itermediate files are not loaded by the library.

2. Code Files: The code files are present in the [02_Code](./02_Code) folder. 
    - The "*_eda.ipynb" files are the exploratory files which the user can refer to understand the processing of the data in a step by step manner.
    - The "*_script.py" files are the optimized scripts which contain only the required steps from the eda files to process the data.

provided the raw data files are present in the ``.01_Data/01_Raw`` folder, all the other intermediate and final data files can be generated using the script files provided in the ``02_Code`` folder.

## Disclaimers

1. This dataset has been created purely for educational purposes. The imputations performed is one of the many ways to handle the missing data, please consider the % of imputed data in the dataset before performing any analysis.
2. The Dataset does NOT contain data for Alaska since the original data for it is messsy, users can however make use of the raw files and modify the scripts if required to include Alaska
3. Only 1 type of drug related deaths is present in the dataset, refer to the master_eda file for details
4. Please refer to the original source of the data (links provided in the data source section) for any legal or privacy concerns.