New to R, and I have two data sets -- they have the same x-axis values, but the y-axis varies.
I'm trying to find the correlation between the two. When I use R to draw the abline
s through the scatter plot, it gives me two lines-of-best-fit that seemingly makes one data set higher than the other -- but I'd really like to know the p-value between these two data sets to know the effect.
After looking it up, it seems like I should use t.test
-- but I'm unsure how to run them against each other.
For example, if I run:
t.test(t1$xaxis,t1$yaxis1)
t.test(t2$xaxis,t2$yaxis2)
It gives me the right means of x and y (t1: 16.84, 88.58 and t2: 14.79, 86.14) -- but for the rest, I'm not sure:
t1: t = -43.8061, df = 105.994, p-value < 2.2e-16
t2: t = -60.1593, df = 232.742, p-value < 2.2e-16
Obviously the p-values given are (a) microscopic, and (b) I don't know how to make it tell me about the data sets relationship with each other -- and not individually.
Any help is greatly appreciated -- thanks!