teamRank = c(1,2,3,3,4,4,4,4,5,5) #First we created the vector teamRank
wins2012=c(94, 88, 95, 88, 93, 94, 98, 97, 93, 94) #created the vector wins2012
#Let us find the correlation between Rank and the number of wins
cor(teamRank, wins2012)
## [1] 0.3477129
cor.test(teamRank,wins2012)
## 
##  Pearson's product-moment correlation
## 
## data:  teamRank and wins2012
## t = 1.0489, df = 8, p-value = 0.3249
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.3609319  0.8018015
## sample estimates:
##       cor 
## 0.3477129
teamRank2013=c(1,2,3,3,4,4,4,4,5,5)
Wins2013=c(97,97,92,93,92,96,94,96,92,90)
cor(teamRank2013, Wins2013)
## [1] -0.6556945

#There is some correlation between the teams rank and the number of wins. In fact, they are negatively correlated, which indicates that there is some evidence that if you win more games you are less likely to win the post season.

cor.test(teamRank2013, Wins2013)
## 
##  Pearson's product-moment correlation
## 
## data:  teamRank2013 and Wins2013
## t = -2.4563, df = 8, p-value = 0.03955
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.90974104 -0.04439732
## sample estimates:
##        cor 
## -0.6556945