Can anyone tell me why this near-perfect correlation yields a very low correlation coefficient?
a <- c(1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1) b <- c(1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1) cor.test(a,b) cor -0.06666667
Whereas this near-perfect correlation yields a very high coefficient
a <- c(1,2,3,4,5,6,8,8,9,10,11,12,13,14,15,16) b <- c(1,2,3,4,5,6,7,8,9,10,11,13,13,14,15,16) cor.test(a,b) cor 0.99719
I am running a study testing the agreement between two binary variables where, like my first example, there is near-ubiquitous agreement between the two variables (122/128 agree), yet, like my first example, I am getting a very low correlation coefficient and a very high p-value for the test. Is there any solution? Am I going mad?