# Solved – Paired t-test and correlation

Say I have \$n\$ pairs of observations. I can run a paired t-test to test for the significance of the difference in means. I can also look at the coefficient of correlation between the 2 sets of observations. What factors could be causing a low correlation coefficient but giving me statistically insignificant difference in means? To give some context, I measured the same units twice, and want to see how similar the results from the 2 measurements are.

Contents

``# same mean, no correlation # t.test Not significant # cor.test Not significant options(scipen = 99) set.seed(1) s1 <- rnorm(20,0,1) s2 <- rnorm(20,0,1) t.test(s1,s2,paired=T)\$p.value     cor.test(s1,s2)\$p.value  # different means, no correlation # t.test Significant # cor.test Not significant set.seed(2) s1 <- rnorm(20,0,1) s2 <- rnorm(20,2,1) t.test(s1,s2,paired=T)\$p.value     cor.test(s1,s2)\$p.value  # different means, high correlation # t.test Significant # cor.test Significant set.seed(3) s1 <- rnorm(20) s2 <- s1+2+rnorm(20,0,0.5) t.test(s1,s2,paired=T)\$p.value     cor.test(s1,s2)\$p.value  # same means, high correlation # t.test Not significant # cor.test Significant set.seed(4) s1 <- rnorm(20) s2 <- s1+rnorm(20,0,0.5) t.test(s1,s2,paired=T)\$p.value     cor.test(s1,s2)\$p.value ``
``# same means, low correlation because # high measurement error in sample 2 # t.test Not significant # cor.test Not significant set.seed(5) s1 <- rnorm(20) s2 <- s1+rnorm(20,0,3) t.test(s1,s2,paired=T)\$p.value     cor.test(s1,s2)\$p.value ``