Logo Icon

Because It's Friday: Spurious Correlation Edition

If the Flight of the Concords taught me anything, it’s that you can’t trust Australians. This morning I was poking around the DataMarket site, when I noticed something suspicious about Australian sheep production. I decided to investigate further: just what are the Australians doing with all those poor sheep? How might this nefarious plot impact the rest of the world? I was shocked when I noticed an apparent relationship with Global Warming.

Hot on the trail of something big, I pulled both datasets into R, using the rdatamarket package, and ran a quick correlation, which confirmed my worst suspicions:

devtools::install_github("DataMarket/rdatamarket")
library(rdatamarket)
set.seed(42)
sheep <- dmseries("http://data.is/nIEpGU")/1e+08 #Hundreds of millions of sheep in Australia
temp <- dmseries("http://data.is/oDSR9Q") #Global temperature anomaly (land+sea)
names(sheep) <- 'Sheep'
names(temp) <- 'Temp.Anomaly'

#Combine into one data frame
Data <- na.omit(cbind(sheep,temp))

#Plot
library(psych)
pairs.panels(as.data.frame(Data))
A correlation plot analyzing the relationship between sheep population and temperature anomaly. The diagonal shows histograms of sheep population and temperature anomaly, both with overlaid density curves. The lower-left scatterplot includes a linear regression line and a confidence ellipse, indicating a negative correlation. The upper-right displays the Pearson correlation coefficient of -0.78, suggesting a strong negative relationship between sheep population and temperature anomaly.

The Great Australian Sheep Decline is clearly the cause of Global Warming! To quantify this effect, I built a simple linear model, which proved to be highly significant:

library(forecast)
model <- lm(Temp.Anomaly~Sheep,Data)
summary(model)
#> Coefficients:
#>             Estimate Std. Error t value Pr(>|t|)
#> (Intercept)  1.18471    0.12130   9.767 1.08e-12 ***
#> Sheep       -0.71154    0.08546  -8.326 1.16e-10 ***

For every 100 Million Sheep that disappear from Australia, the Earth warms by 0.71 degrees C! Given that there are still 85 million sheep left in Australia, the potential for further warming is gigantic!

In all seriousness, Australian sheep have about as much to do with Global Warming as pirates. Sheep numbers have been declining in New Zealand, Uruguay, Iceland, and many other countries as well. If you wish to explore other spurious correlations, use the code above!

stay in touch