Skip to content
Prev 67957 / 398506 Next

Pearson corelation and p-value for matrix

Dear Dren,

Since cor(), on which Andy's solution is based, can compute pairwise-present
correlations, you could adapt his function -- you'll have to adjust the df
for each pair. Alternatively, you could probably save some time (programming
time + computer time) by just using my solution:
[1] 518.19   1.11 520.23     NA     NA

I know that time is money, but nine minutes (on my machine) probably won't
bankrupt anyone.

Regards,
 John

--------------------------------
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario
Canada L8S 4M4
905-525-9140x23604
http://socserv.mcmaster.ca/jfox 
--------------------------------