# First we create the vector teamRank
teamRank = c(1,2,3,3,4,4,4,4,5,5)  

# Creating the vector Wins2012
Wins2012 = c(94,88,95,88,93,94,98,97,93,94)
#find the cor between rank and the number of wins
cor(teamRank, Wins2012)
## [1] 0.3477129

There is a low correlation between the team rank and number of wins in 2012.

A positive correlation means that as one variable increases, the other variable tends to increase as well, and vice versa. The magnitude of the correlation coefficient, 0.3477129, suggests a relatively moderate positive correlation. This value indicates that there is a tendency for the variables to move in the same direction, but the relationship may not be extremely strong.

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

p-value is greater than (alpha), meaning that the observed correlation is not statistically significant.the evidence against the null hypothesis is not strong enough to reject it.

#creating vector teamRank2013
teamRank2013 =c(1,2,3,3,4,4,4,4,5,5)

#creating vector wins2013
Wins2013 = c(97,97,92,93,92,96,94,96,92,90)
#compute the correlation coefficient
cor(teamRank2013, Wins2013)
## [1] -0.6556945

There is some correlation between th teams rank and the number of wins. In fact , they are negative related. Which means that as one variable (team rank) increases, the other variable (number of wins) tends to decrease, and vice versa. In this case, the stronger the negative correlation, the more predictable the relationship between the variables becomes.

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

Given that the pvalue is less than alpha at 0.05. We can say that in 2013 there is some correlation between winning the world series and the number of wins. we have sufficient evidence to say that the correlation between winning the world series and the number of wins is statistically significant.