Good evening, I'm going to use R to calculate the P-value for Pearson coefficient. Does it exist an already defined function?How can I do?Thanks for helping me. Angela
On Wed, 2004-11-17 at 19:20 +0100, Angela Re wrote:> Good evening, > I'm going to use R to calculate the P-value for Pearson coefficient. > Does it exist an already defined function?How can I do?Thanks for > helping me. > Angelahelp.search("Pearson") shows you: ... cor.test(stats) Test for Association/Correlation Between Paired Samples ... See ?cor.test HTH, Marc Schwartz
On 17-Nov-04 Angela Re wrote:> Good evening, > I'm going to use R to calculate the P-value for Pearson coefficient. > Does it exist an already defined function?How can I do?Thanks for > helping me. > Angelacor.test is what you need (according to your statement). The Pearson correlation is the default coefficient. Example: u<-rnorm(10);v<-rnorm(10);X<-u+v;Y<-v; cor.test(X,Y) Pearson's product-moment correlation data: X and Y t = 2.9483, df = 8, p-value = 0.01847 alternative hypothesis: true correlation is not equal to 0 95 percent confidence interval: 0.1686027 0.9291072 sample estimates: cor 0.7216238 enter ?cor.test for details of the various different ways of using this function. Hoping this helps, Ted. -------------------------------------------------------------------- E-Mail: (Ted Harding) <Ted.Harding at nessie.mcc.ac.uk> Fax-to-email: +44 (0)870 094 0861 [NB: New number!] Date: 17-Nov-04 Time: 19:28:43 ------------------------------ XFMail ------------------------------