Re: [R] Difference betweeen cor.test() and formula everyone says to use

2014-10-17 Thread JLucke
or testing $\rho= \rho_0 $ or $\rho_1 = \rho_2$. The two statistics will not be equivalent at $\rho=0$ because the statistics are based on different assumptions. Jeremy Miles Sent by: r-help-boun...@r-project.org 10/16/2014 07:32 PM To r-help , cc Subject [R] Difference betweeen cor.

Re: [R] Difference betweeen cor.test() and formula everyone says to use

2014-10-17 Thread peter dalgaard
This is pretty much standard. I'm quite sure that other stats packages do likewise and I wouldn't know who "everyone" is. It is not unheard of that textbook authors give suboptimal formulas in order not to confuse students, though. The basic point is that the t transformation gives the exact di

Re: [R] Difference betweeen cor.test() and formula everyone says to use

2014-10-16 Thread Joshua Wiley
Hi Jeremy, I don't know about references, but this around. See for example: http://afni.nimh.nih.gov/sscc/gangc/tr.html the relevant line in cor.test is: STATISTIC <- c(t = sqrt(df) * r/sqrt(1 - r^2)) You can convert *t*s to *r*s and vice versa. Best, Josh On Fri, Oct 17, 2014 at 10:32 AM

[R] Difference betweeen cor.test() and formula everyone says to use

2014-10-16 Thread Jeremy Miles
I'm trying to understand how cor.test() is calculating the p-value of a correlation. It gives a p-value based on t, but every text I've ever seen gives the calculation based on z. For example: > data(cars) > with(cars[1:10, ], cor.test(speed, dist)) Pearson's product-moment correlation data: sp