Created
August 26, 2011 14:52
-
-
Save zachmayer/1173581 to your computer and use it in GitHub Desktop.
Sheep and Temperature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 *** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 *** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Load Data | |
library(rdatamarket) | |
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)) | |
#Build a model | |
library(forecast) | |
model <- lm(Temp.Anomaly~Sheep,Data) | |
summary(model) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment