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. > Angela
cor.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) <[EMAIL PROTECTED]> Fax-to-email: +44 (0)870 094 0861 [NB: New number!] Date: 17-Nov-04 Time: 19:28:43 ------------------------------ XFMail ------------------------------ ______________________________________________ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html