The McRib's Markedly Mysterious Market Manifestations

By: Andy Lee

Much like the enigmatic cotton eyed joe, the question of where the McRib comes from and where does it go has been a subject of debate within popular culture for almost as long as the McRib has existed. The sandwich has developed a cult following and websites and apps dedicated to tracking the availability of the McRib have captivated the hearts and clicks of many. What makes the McRib's magician's disappearing act all the more difficult to study is the fact that any given McDonald's location can, at any time, order all of the necessary materials for the McRib yet national scale availability is limited to a month or two at a time every few years. Even more puzzling, the national availability of the McRib varies by nation, with Germany having the McRib available all year every year. As Willy Staley at The Awl theorized, the McRib is used by McDonald's as a means of commodity trading. That is, when pork prices are low, McDonald's re-releases the McRib knowing that it's large-scale purchase of pork will increase pork commodity prices. Taking this theory, I believe it's possible to calculate the probability of the McRib returning in any given month by using the value of lean hog futures. According to a publication from the St. Louis Federal Reserve, future prices of perishable commodities are typically a good reflection of their future value. Keeping all of this in mind, I set out to complete the world's most useless application of data science in economics.

The first step was to gather the data to be used in my analysis. Data for pork prices was sourced through CME, historic prices through a third party website hosting lean hog prices traded on CME adjusted for inflation, and futures prices sourced directly from CME's website itself, not adjusted for inflation. Because none of the sources offered easily accessible APIs, I used python's BeautifulSoup to scrape the data. After scraping the appropriate prices I preprocessed the prices by deseasonalizing them and converting the month to month prices into five month centered moving averages using Pandas. Finding data for the independent variable, wide-scale McRib availability by month, was a little bit more difficult. Though the more recent McRib farewell tours included easily identifiable start months, they often lacked end times. For the previous McRib resurgences of the 90s, even less data was available. Thus I had to make a few assumptions regarding the exact timing of the McRib availability. Unless otherwise explicitly stated, I assumed the McRib returned for a month at a time and unless otherwise explicitly stated, I assumed the McRib returned in the Summer. The Summer return assumption is largely based on the fact that the 90s returns of the McRib were generally tied in with summer backyard BBQ style promotions and in one case, the Flinstones movie which released in later May.
After collection and preprocessing the data, I plotted out some of the data in matplotlib and ran the data through a binary logistic regression using sklearn. Using a prediction data set with the moving averages calculated from the five next available futures prices. The model itself scored relatively well with 0.921 of the variance being explained by the model however unfortunately, or perhaps fortunately, by my calculations the McRib only has a 4.605% chance of returning in the Spring. Truly a sad time for McRib lovers everywhere.
Code is available here

Last Edited: 2018-01-09
View Count: 906