A story about insulin prices and the time I went viral on Twitter.
|Jul 18||Public post|
Hi and welcome to the latest edition of Data for Insulin.
If you’re new, please 👇. And if you like this post, hit the ❤️ at the end.
This is an older post I’m getting back up — publishing to the website only.
In early 2018, the AEI published a “Chart of the Day” showing the percentage change in price from 1997 to 2017 for “selected items.” Shortly after, the chart got some traction with health policy twitter. They were interested in, but not surprised by, how much prices had increased within the medical field.
In my opinion, the AEI had the completely wrong take from the chart:
Blue lines = prices subject to free market forces. Red lines = prices subject to regulatory capture by government. Food and drink is debatable either way. Conclusion: remind me why socialism is so great again.
The “red lines” may be subject to regulatory capture but they are also not discretionary goods. That’s my take.
The time period was interesting to me because Humalog insulin was released in June 1996 and I have access to list price data for Humalog from 1997 to the present. Conveniently, it was the same period outlaid in this chart from the AEI. And, as we all know, insulin is another item that is not discretionary. It’s as needed for life as water or oxygen.
I took to Twitter with an idea. I layered in on MS Paint an orange line representing the percentage change in price for Humalog — to scale. The result was flooring and the tweet “went viral”. Be prepared to scroll.
Because I deleted my original @lollydaggle twitter account last year, I don’t have the original tweet but copies live on everywhere. Andy Slavitt shared the chart, attributed it to the wrong person (a lesson in watermarking your work) and it caused enough Twitter drama while I was on a plane to earn myself a meeting with US of Care. To this day, I see the chart pop up around the twitter-verse. I won’t always get credit for it but that’s not why I engage in this kind of work.
I had always felt weird that I ripped off the work of another data analyst — even if they work for the AEI and had opinions I did not agree with. So, to be fair, I recreated their analysis and visualization myself.
The AEI graph was sourced from Bureau of Labor Statistics data. I had never worked with BLS data before and it was interesting trying to compile the dataset I needed to make this graph happen.
I realized the AEI had used “Consumer Price Index - All Urban Consumers” as their data source for pricing information on the goods and services. For wages, I managed to get the BLS API to work for data from 2001 to forward, but could not get it to work for the remaining period. So, sadly, my graph is missing the wage line.
The BLS data is coded in series. Each category has its own Series ID. From the CPI - All Urban Consumers dataset, I would need to construct the IDs of the categories I wanted to pull. I kept with the “selected” goods and services and also added in “Prescription Drugs.” I pulled both “Housing - Shelter” and “Housing - Utilities.” I used “Not Seasonally Adjusted”, “Monthly” and “U.S. City Average” as my base parameters. The IDs I generated were as follows:
I used this awesome Jupyter Notebook bls-api-to-csv as a starting point to download the data. I modified the code a bit for my own use to dump all the data into one .csv file. From there, I downloaded the data in two sets of batches since the BLS API allows only calls for ten years at a time.
From there, I did the rest of my data wrangling in Excel.
I mapped the Series Code downloaded to category names and calculated a date figure for each month.
Since my insulin pricing data is on a yearly basis, I used only the first period of monthly data provided by the BLS.
Starting with 1/1/1997 as my base year of 0, I calculated the percentage difference in price for each year, as compared to that base year.
I loaded the data into R and visualized the data using R’s plotly library.
Thank you to Erin Gilmer for helping with formatting on this chart.