由于没有统计学基础,但在数据分析过程中需要用到一些基础知识,在这弱弱的问一下,t.test()和cor.test()的区别?最后R给出的结果有三个值分别有什么统计学意义t , df , p-value
我需要判断两组数据的差异,应该用哪个?为什么给出的结果不一样。
例如:
a = c(1,2,3,4,5)
b = c(1,2,3,4,5)
t.test(a,b)
cor.test(a,b)
为什么给出了不同的结果?
Welch Two Sample t-test
data: a and b
t = 0, df = 8, p-value = 1
Pearson's product-moment correlation
data: a and b
t = 116235962, df = 3, p-value < 2.2e-16