Charts

Part A: All Opioid Overdose Deaths

1.5 How are all opioid overdose deaths by county changing over time?

To answer this question, let's start a new worksheet by clicking the New Worksheet button next to the Indicators sheet at the bottom left corner of your screen.

Rename it Timeline deaths by county.

- Drag the Data Year dimension to the Columns shelf

- Drag the Number/Rate measure to the Rows shelf

- Drag the County Name dimension to Color mark

Expand the chart by changing the view from Standard to Fit Width.

Tip: If timeline does not appear, change your Data Year variable to a continuous measure (make sure it is a date type).

Knowing what we know about the structure of this dataset, what are some obvious problems with this visualization?

To solve these issues, we need to apply some filters so that we can visualize only deaths, for just opioids, and only number/counts.

- Drag the Category dimension to the Filters shelf. Check the Death box. Click Apply. Notice the difference. Click OK.

-Drag the Indicator dimension to the Filters shelf. Check the All Opioid Overdose Deaths box. Click OK. Notice the difference on the Number/Rate box.

- Drag the Number Type dimension to the Filters shelf. Check the Number/Count. Click OK.

- Drag the County Name from the color mark to the label mark.

- Click Control + Sum(Number/Rate) to drag it to the color mark. Change the color ramp by clicking the Color mark and select Edit Colors. Change the Palette to a Red-Gold. Click OK.

- To emphasize even more the differences, drag the Number/Rate to the Size mark.

Graph Aesthetics

- The Data Year title is redundant. To remove it, right-click on Year (Data Year), select Edit Axis, and remove the text for Axis Title .

- Change the Number/Rate axis by right-clicking on it or double-clicking on it. Change the title to: Opioid Deaths.

- Change the size of the year labels by right-clicking on any of the years. Select Format. In the Header Default section, change the font size to 12.

- The legends are not essential for this chart. To get rid of them, hover over them and click the inversed arrow on the top right of each legend. Select Hide Card

- Click the Tooltip mark. Edit it so it looks like this:

<County Name>

# of Deaths: <SUM(Number/Rate)>

Close the tooltip mark. Notice the format for number of deaths. Right-click the SUM(Number/Rate) pillow and select Format. In the Axis panel, go to the Scale section and select Numbers. Click Number (Custom) and change the number of decimals to 0. Check your results hovering over the chart on the right.

Save your Tableau workbook.

1.6 How do the distributions of deaths over time compare for each county? What is the overall distribution across the State?

In order to look at the answer to this question, we need to review the basics of box plots. In a box plot, you will see a box, a line inside the box, some whiskers, and sometimes some dots outside the box for the whiskers. The line in the box represents the median value of the group. The box shows the values half-way between the median and either the minimum and the maximum value in the data set.

If you were to take all the values in your data set and rank them so that the minimum value goes first and the maximum value goes last, you could break the ranked data into four equal groups. The three points that divide the data set into four equal groups are called quartiles. The smallest value of those three is called the first quartile. And the largest value of those three is called the third quartile.

The whiskers on a box plot usually extend to 1.5 times the interquartile range. Any data points outside of these whiskers are generally considered outliers.

- Create the same filters as in the chart before:

Indicator - All Opioid Overdose Deaths

Number Type - Number/Count

- Add the Number/Rate to the Rows shelf

- Add the Data Year to the Detail mark

- In the Show Me panel, select the Box Plot option

- Add the County Name to the columns shelf

Graph Aesthetics

- In the Number/Rate axis, make it sort descending. Change it to Opioid Deaths (double-click one).

- Rename the worksheet Boxplot deaths by county.

Duplicate the worksheet (right-click - Duplicate). Rename it Boxplot all deaths.

- Remove the County Name pill from the Columns shelf

- Remove the Year from the detail mark. Add the County Name to the detail mark

Save your Tableau workbook.

1.7 Highlighting counties by higher death rates: Tree map

Duplicate the previous worksheet (right-click - Duplicate). Rename it Treemap county deaths.

- Add County Name to Columns

- Number/Rate to Rows

- Select Tree map in the Show Me card

Graph Aesthetics

- Remove the legend

- Add the Number/Rate to the Label mark

Change the Number/Rate filter to Rate per 100,000. Discuss the difference

1.8 Geographic distribution of deaths for each year

2017:

Create a new worksheet. Rename it Map deaths 2017.

- Drag the County Name to the Columns shelf.

- Drag the Number/Rate to the Rows shelf

- Select maps in the Show Me card.

- Add the following filters:

Data year - 2017

Indicator: All Opioid Overdose Deaths

Number type: Rate per 100,000

Change the tooltip:

- Remove county and State.

- Change Number/rate to Rate per 100,000

Notice if you might have some counties are missing. Click the missing locations. Add South Carolina as the State.

- Notice you don't need to add Number/Rate to the color mark.

Change the color palette to red-gold. Repeat the same process for the other years: 2016, 2015, and 2014.

Graph Aesthetics

- Remove the legend card

- Add the County Name to the label mark. Click on Label - Font - Match Mark Color

Part B: Opioid Prescriptions

1.9 What is the overall distribution of prescriptions over time?

Create a new worksheet: name it RX by year.

- Drag the Data Year to columns. Click on the drop-down arrow and select Year.

- Drag the Number/Rate to rows

- Drag Indicator to the color mark

Change the visualization to stacked bars.

Filters:

- Category: RX

- Number Type: Number/Count

Graph Aesthetics

- Change the width of the chart. Resize the bar widths by clicking on the Size mark - move the bar.

- To add total numbers to each column, right-click on the Number/Rate axis and select Add Reference Line.

Scope: Per Cell

Line Value SUM(Number/Rate) - Sum

Label: Value

Formatting Line: None.

Click OK.

- Hide the Data Year header (Right-click, select Hide Field Labels for columns).

Part C: Deaths Vs. Prescriptions

1.10 Do counties with the highest rate of prescriptions tend to have the highest rate of deaths?

In order to create a scatterplot of two variables, we will need to create a double filter in the Number/Rate measure. In order to do that, click on the Number/Rate measure, and select Create - All OpiCalculated field. In the window that appears, type as title: All Opioids Deaths. For expression, type:

IF [Indicator]= "All Opioid Overdose Deaths" AND [Number Type]= "Number/Count" THEN [Number/Rate]

END

Repeat the same steps to create the calculated field: All Opioids RX

IF [Indicator] = "All Opioids" AND [Number Type]= "Number/Count" THEN[Number/Rate]

END

Drag All Opioids RX to the rows shelf and All Opioids Deaths to the columns shelf.

Add County Name to the Detail tip.

Adding a Trend Line:

Go to the Analysis menu - Trend Lines - Show Trend Lines.

Add the County Names to the label mark.

You can change the shape to whichever icon you want to.

There is a folder in "My Documents" called "My Tableau Repository" where you can find a shapes folder. Within this shapes folder, simply create a new folder for your shapes and name it an informative name. Save any custom shapes you would like to use in your visualization into this file (I searched for opioid icon).

Take a look at the scatterplot I created here:

Discuss with the person next to you issues with this scatterplot.

Duplicate the worksheet so we can create new fields based on rate and not count.

The expression to create the All Opioid Deaths Rate is this.

The expression for All Opioids RX Rate can be found here.