If you’ve ever driven a non-electric car OR you’ve ever eaten something with wheat, this article is for you.

(but if you are a Gluten-Free Tesla driver, please still read 🙂 thank you very much)

Oil prices and wheat prices may be linked. Wheat production and transportation needs tractors and trucks, which require oil. But how strong is the relationship? In this article, we'll break down a recent data analysis that explores the connection between the two.

Our data comes from two reliable sources: Yahoo Finance for the daily prices of oil and wheat futures, and the Federal Reserve Economic Data (FRED) for inflation metrics. Using this data, we were able to get a clear picture of how these two markets have moved over time.

Big Picture

First, let's look at the big picture. When we plot the historical prices of oil futures and wheat futures side by side, we can start to see a general pattern.

It's not a perfect match, but there are periods where they seem to move in sync. Sometimes, as oil prices climb, so do wheat prices, and vice versa. This visual connection, while interesting, isn't enough to prove a real relationship.

To get a more precise understanding, let’s use some statistics:

First, correlation analysis. Correlation measures how two variables move together. The correlation between the above two is 0.64. This is actually pretty high for most random variables - the correlation isn’t perfect, but it isn’t low. There definitely is a relationship. But correlation doesn't tell the whole story. It simply shows that two things are related, not why. To dig deeper, we used other statistical measures.

Mutual information helped us understand how much information knowing the oil price gives us about the wheat price, showing that there's a significant shared "signal." The value here is 0.3701 - not huge.

We also used Cohen's effect size, which measures the magnitude of differences based on standard deviation. The absolute value is 1.1 which is a large Cohen’s size by any means.

Finally, we looked at ANOVA, which is also a measure of variance. The statistic here was 44.25 (wow!)

These measures tell us that the relationship is backed by a genuine statistical link.

On Causation

Is oil just related to wheat, or does it actually influence it? To answer this, we used some introductory causal inference techniques.

Our initial model looked at the direct link between oil and wheat futures and found a strong causal impact, under a certain condition.

complicated numbers - don’t worry I explain.

We are looking for a p-value under .05 (given that we have ample data) to say something is significant. The only significant value is the ‘Lag 4’ value. We can say that the oil prices from 4 months ago have some causality to today’s wheat prices.

But wait, what about other factors? The world is complex! We refined our model by adding inflation as a key variable. Inflation affects everything, from the cost of labor to the price of machinery, so it's a huge piece of the puzzle. The model output is below:

H_0: Oil does not Granger-cause Wheat: reject at 5% significance level. Test statistic: 2.886, critical value: 2.426>, p-value: 0.024>

We find that our p-value is less than .5 - so even when inflation is concerned, we can still say there is Granger causality between oil prices and wheat prices.

*Granger causality measures predictive ability, not true causality. We’d have to do a deeper dive into other factors to determine true causality (maybe in a part 2??)

Insights

  • Oil does affect wheat prices - even when you adjust for inflation

  • If oil prices raise now, then make sure that you account for an increase in grocery prices in about 4 months - that’s how the lag typically works

Keep Reading

No posts found