Re: [R] Obtaining correlation parameters for multiple rows

2008-04-25 Thread jpnitya
Hi Jorge, That was great! Thank you very much for the suggestion. I just had to make a couple of minor changes (e.g., pearson vs. spearman) and it worked perfectly. Thanks, Joao Pedro Hi, I'm sure it could be better but try this: # F statistics based on lm FSTAT=function(y,x) summary(lm(y~

Re: [R] Obtaining correlation parameters for multiple rows

2008-04-24 Thread Jorge Ivan Velez
Hi, I'm sure it could be better but try this: # F statistics based on lm FSTAT=function(y,x) summary(lm(y~x))$f[1] # Correlation and p-value CORR=function(y,x){ tc=cor.test(x,y,method="spearman",alternative="two.sided") temp=matrix(c(tc$estimate,tc$p.value),ncol=2) colnames(temp)=c('rho','pvalue