Re: [R] Pearson and Spearman correlation coeffcients matrix

From: Jonathan Baron <baron_at_psych.upenn.edu>
Date: Sun 03 Jul 2005 - 23:33:15 EST

I think "associated statistics" means p-levels.

This post
http://finzi.psych.upenn.edu/R/Rhelp01/archive/5380.html tells how to do it and gives and example.

But I think that nobody wants to make a function for this because it would encourage bad behavior, i.e., snooping through a correlation matrix looking for "significant" correlations and then making up a story about how the 5% of them that were significant at p<.05 were really planned tests.

Jon

On 07/03/05 08:12, Douglas Bates wrote:
 On 7/3/05, Nuno Soares <ndsoares@mail.telepac.pt> wrote:
> Hi everyone,
>
> I've been trying to find a function that outputs the Pearson and/or Spearman
> correlation coefficients for several variables with the associated
> statistics in one single table/matrix. For what I've been able to understand
> the Stats package is only able to compute these coeficients/statistics only
> in defined pairs. This becomes time consuming when we want to determine
> these measures with, say, 10 variables or more. Does anyone knows a solution
> to this?
 

 I believe that the cor function already does what you want. Check  

 ?cor  

 and  

 example(cor)  

 If the first argument to cor is a matrix, it returns the correlation  matrix of all the columns.  



 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help  PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
-- 
Jonathan Baron, Professor of Psychology, University of Pennsylvania
Home page: http://www.sas.upenn.edu/~baron
R search page: http://finzi.psych.upenn.edu/

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Sun Jul 03 23:35:43 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:11 EST